aboutsummaryrefslogtreecommitdiff
path: root/libctf/Makefile.in
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2023-04-05 16:36:45 +0100
committerNick Alcock <nick.alcock@oracle.com>2023-04-08 16:07:17 +0100
commit30a794e9f1db2de9099ed4c494d917d4e86de0fd (patch)
tree0f4cfb385762718ccc854508b9507a99e9b77ac6 /libctf/Makefile.in
parent2dd5ec24c8560a7aca27475b1698aa3f133c3eae (diff)
downloadbinutils-30a794e9f1db2de9099ed4c494d917d4e86de0fd.zip
binutils-30a794e9f1db2de9099ed4c494d917d4e86de0fd.tar.gz
binutils-30a794e9f1db2de9099ed4c494d917d4e86de0fd.tar.bz2
libctf, tests: do not assume host and target have identical field offsets
The newly-introduced libctf-lookup unnamed-field-info test checks C compiler-observed field offsets against libctf-computed ones by #including the testcase in the lookup runner as well as generating CTF for it. This only works if the host, on which the lookup runner is compiled and executed, is the same architecture as the target, for which the CTF is generated: when crossing, the trick may fail. So pass down an indication of whether this is a cross into the testsuite, and add a new no_cross flag to .lk files that is used to suppress test execution when a cross-compiler is being tested. libctf/ * Makefile.am (check_DEJAGNU): Pass down TEST_CROSS. * Makefile.in: Regenerated. * testsuite/lib/ctf-lib.exp (run_lookup_test): Use it to implement the new no_cross option. * testsuite/libctf-lookup/unnamed-field-info.lk: Mark as no_cross.
Diffstat (limited to 'libctf/Makefile.in')
-rw-r--r--libctf/Makefile.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/libctf/Makefile.in b/libctf/Makefile.in
index c6cb55c..3d2696b 100644
--- a/libctf/Makefile.in
+++ b/libctf/Makefile.in
@@ -1678,10 +1678,15 @@ check-DEJAGNU: site.exp development.exp
r=`pwd`; export r; \
LC_ALL=C; export LC_ALL; \
EXPECT=$(EXPECT); export EXPECT; \
+ if [ "@host@" = "@target@" ] ; then \
+ TEST_CROSS=no; \
+ else \
+ TEST_CROSS=yes; \
+ fi; \
runtest=$(RUNTEST); \
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
$$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
- CC="$(CC)" CC_FOR_TARGET="$(CC_FOR_TARGET)" \
+ CC="$(CC)" CC_FOR_TARGET="$(CC_FOR_TARGET)" TEST_CROSS="$${TEST_CROSS}" \
CFLAGS="$(CFLAGS) -I$(INCDIR) -I$(srcdir) -I$(builddir) -I$(builddir)/../bfd $(ZLIBINC)" \
LIBS="$(libctf_nobfd_la_LIBADD) $(LIBS)" $(RUNTESTFLAGS); \
else echo "WARNING: could not find \`runtest'" 1>&2; :;\