diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2009-11-12 13:30:02 +1100 |
---|---|---|
committer | Jon Loeliger <jdl@jdl.com> | 2009-11-11 21:41:14 -0600 |
commit | b31b271f91b867343fe21a20da4d24b03c1ef421 (patch) | |
tree | bf5181e2256cadef69931ec4a60a2fdf9938a02e /tests/value-labels.c | |
parent | f2f6d0f2f02b4713e9d0cdc840e211535689a2e6 (diff) | |
download | dtc-b31b271f91b867343fe21a20da4d24b03c1ef421.zip dtc-b31b271f91b867343fe21a20da4d24b03c1ef421.tar.gz dtc-b31b271f91b867343fe21a20da4d24b03c1ef421.tar.bz2 |
Fix dtc bugs for 64-bit compile
I've just tested building dtc as an x86_64 binary on a 32-bit i386
host by using:
make CC="gcc -m64"
This patch fixes a handful of minor bugs thus discovered:
* There is a printf() type mismatch on 64-bit in value-labels.c
* For the tests which use libdl, we were using the GNU make feature
where it will find libdl.so given a dependency in the form '-ldl'.
But this built-in make logic doesn't know we're compiling 64-bit so
finds the 32-bit version of the library. We avoid using this and
instead explicitly pass -ldl to CC, which being the 64-bit version
does know where to look.
* To process dtc's asm output into .so files, run_tests.sh was
directly invoking the (default instance of) the assembler and linker.
Instead invoke these via the CC driver, and allow that to be overriden
from the make environment.
* The x86_64 assembler doesn't 0 fill with the .balign directive
(presumably it is NOP filling). That doesn't produce strictly
incorrect trees, but it is confusing and confounds are testcases which
do byte-by-byte comparison of the trees produced by asm output with
direct dtb output (which does 0 pad where necessary, of course). This
patch uses the optional second argument to .balign to force gas to
zero-fill instead.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/value-labels.c')
-rw-r--r-- | tests/value-labels.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/value-labels.c b/tests/value-labels.c index d11c34e..c5aea8f 100644 --- a/tests/value-labels.c +++ b/tests/value-labels.c @@ -89,9 +89,9 @@ void check_prop_labels(void *sohandle, void *fdt, const char *name, FAIL("Couldn't locate label symbol \"%s\"", name); if ((p - prop->data) != off) - FAIL("Label \"%s\" points to offset %d instead of %d" + FAIL("Label \"%s\" points to offset %ld instead of %d" "in property \"%s\"", labels[i].labelname, - p - prop->data, off, name); + (long)(p - prop->data), off, name); } } |