summaryrefslogtreecommitdiffstats
path: root/libffi
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@wdc.com>2020-04-25 21:27:14 +0100
committerMaciej W. Rozycki <macro@wdc.com>2020-04-25 21:27:14 +0100
commita0b48358cb1e70e161a87ec5deb7a4b25defba6b (patch)
tree882af17057eb6651175b2c2c2ff983600af5f3c9 /libffi
parentEnable Intel CET in liblto_plugin.so on Intel CET enabled host (diff)
downloadgcc-a0b48358cb1e70e161a87ec5deb7a4b25defba6b.tar.gz
gcc-a0b48358cb1e70e161a87ec5deb7a4b25defba6b.tar.bz2
gcc-a0b48358cb1e70e161a87ec5deb7a4b25defba6b.tar.xz
libffi/test: Fix compilation for build sysroot
Fix a problem with the libffi testsuite using a method to determine the compiler to use resulting in the tool being different from one the library has been built with, and causing a catastrophic failure from the inability to actually choose any compiler at all in a cross-compilation configuration. Address this problem by providing a DejaGNU configuration file defining the compiler to use, via the CC_FOR_TARGET TCL variable, set from $CC by autoconf, which will have all the required options set for the target compiler to build executables in the environment configured, removing failures like: FAIL: libffi.call/closure_fn0.c -W -Wall -Wno-psabi -O0 (test for excess errors) Excess errors: default_target_compile: No compiler to compile with UNRESOLVED: libffi.call/closure_fn0.c -W -Wall -Wno-psabi -O0 compilation failed to produce executable and bringing overall test results for the `riscv64-linux-gnu' target (here with the `x86_64-linux-gnu' host and RISC-V QEMU in the Linux user emulation mode as the target board) from: === libffi Summary === # of unexpected failures 708 # of unresolved testcases 708 # of unsupported tests 30 to: === libffi Summary === # of expected passes 1934 # of unsupported tests 28 This is a combined backport of the relevant parts of upstream libffi changes as follows: - commit 8308984e479e ("[PATCH] Make sure we're running dejagnu tests with the right compiler."), - commit 2d9b3939751b ("[PATCH] Fix for closures with sunpro compiler"), - commit 0c3824702d3d ("[PATCH] Always set CC_FOR_TARGET for dejagnu, to make the testsuite respect $CC"), - commit 7d698125b1f0 ("[PATCH] Use the proper C++ compiler to run C++ tests"), - commit 6b6df1a7bb37 ("[PATCH] Adds `local.exp` to CLEANFILES"), - commit 6cf0dea78a5a ("[PATCH] Change CLEANFILES to DISTCLEANFILES") libffi/ * Makefile.am (DISTCLEANFILES): New variable. * configure.ac: Produce `local.exp'. * Makefile.in: Regenerate. * configure: Regenerate. * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New variable. * testsuite/Makefile.in: Regenerate.
Diffstat (limited to 'libffi')
-rw-r--r--libffi/ChangeLog10
-rw-r--r--libffi/Makefile.am3
-rw-r--r--libffi/Makefile.in4
-rwxr-xr-xlibffi/configure5
-rw-r--r--libffi/configure.ac5
-rw-r--r--libffi/testsuite/Makefile.am2
-rw-r--r--libffi/testsuite/Makefile.in1
7 files changed, 30 insertions, 0 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 47648d31abd..7ad4b70eb00 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,13 @@
12020-04-25 Maciej W. Rozycki <macro@wdc.com>
2
3 * Makefile.am (DISTCLEANFILES): New variable.
4 * configure.ac: Produce `local.exp'.
5 * Makefile.in: Regenerate.
6 * configure: Regenerate.
7 * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New
8 variable.
9 * testsuite/Makefile.in: Regenerate.
10
12020-01-24 Maciej W. Rozycki <macro@wdc.com> 112020-01-24 Maciej W. Rozycki <macro@wdc.com>
2 12
3 * configure.ac: Handle `--with-toolexeclibdir='. 13 * configure.ac: Handle `--with-toolexeclibdir='.
diff --git a/libffi/Makefile.am b/libffi/Makefile.am
index 86e22496152..203b7d10a42 100644
--- a/libffi/Makefile.am
+++ b/libffi/Makefile.am
@@ -15,6 +15,9 @@ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj \
15 libffi.xcodeproj/project.pbxproj \ 15 libffi.xcodeproj/project.pbxproj \
16 libtool-ldflags 16 libtool-ldflags
17 17
18# local.exp is generated by configure
19DISTCLEANFILES = local.exp
20
18# Automake Documentation: 21# Automake Documentation:
19# If your package has Texinfo files in many directories, you can use the 22# If your package has Texinfo files in many directories, you can use the
20# variable TEXINFO_TEX to tell Automake where to find the canonical 23# variable TEXINFO_TEX to tell Automake where to find the canonical
diff --git a/libffi/Makefile.in b/libffi/Makefile.in
index f7786ff3fd1..745bdd80777 100644
--- a/libffi/Makefile.in
+++ b/libffi/Makefile.in
@@ -454,6 +454,9 @@ EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj \
454 libtool-ldflags 454 libtool-ldflags
455 455
456 456
457# local.exp is generated by configure
458DISTCLEANFILES = local.exp
459
457# Automake Documentation: 460# Automake Documentation:
458# If your package has Texinfo files in many directories, you can use the 461# If your package has Texinfo files in many directories, you can use the
459# variable TEXINFO_TEX to tell Automake where to find the canonical 462# variable TEXINFO_TEX to tell Automake where to find the canonical
@@ -1674,6 +1677,7 @@ distclean-generic:
1674 -rm -f src/x86/$(am__dirstamp) 1677 -rm -f src/x86/$(am__dirstamp)
1675 -rm -f src/xtensa/$(DEPDIR)/$(am__dirstamp) 1678 -rm -f src/xtensa/$(DEPDIR)/$(am__dirstamp)
1676 -rm -f src/xtensa/$(am__dirstamp) 1679 -rm -f src/xtensa/$(am__dirstamp)
1680 -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
1677 1681
1678maintainer-clean-generic: 1682maintainer-clean-generic:
1679 @echo "This command is intended for maintainers to use" 1683 @echo "This command is intended for maintainers to use"
diff --git a/libffi/configure b/libffi/configure
index ca0a2965c7a..f0051505d10 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -14961,6 +14961,11 @@ _ACEOF
14961 14961
14962 14962
14963 14963
14964cat > local.exp <<EOF
14965set CC_FOR_TARGET "$CC"
14966set CXX_FOR_TARGET "$CXX"
14967EOF
14968
14964 14969
14965{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 14970{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
14966$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } 14971$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
diff --git a/libffi/configure.ac b/libffi/configure.ac
index 93e655803e7..0bf4af410d3 100644
--- a/libffi/configure.ac
+++ b/libffi/configure.ac
@@ -61,6 +61,11 @@ AC_PROG_LIBTOOL
61# Test for 64-bit build. 61# Test for 64-bit build.
62AC_CHECK_SIZEOF([size_t]) 62AC_CHECK_SIZEOF([size_t])
63 63
64cat > local.exp <<EOF
65set CC_FOR_TARGET "$CC"
66set CXX_FOR_TARGET "$CXX"
67EOF
68
64AM_MAINTAINER_MODE 69AM_MAINTAINER_MODE
65 70
66AC_CHECK_HEADERS(sys/mman.h) 71AC_CHECK_HEADERS(sys/mman.h)
diff --git a/libffi/testsuite/Makefile.am b/libffi/testsuite/Makefile.am
index 209e8976635..88509fc35d6 100644
--- a/libffi/testsuite/Makefile.am
+++ b/libffi/testsuite/Makefile.am
@@ -13,6 +13,8 @@ RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
13 13
14AM_RUNTESTFLAGS = 14AM_RUNTESTFLAGS =
15 15
16EXTRA_DEJAGNU_SITE_CONFIG=../local.exp
17
16CLEANFILES = *.exe core* *.log *.sum 18CLEANFILES = *.exe core* *.log *.sum
17 19
18EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \ 20EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
diff --git a/libffi/testsuite/Makefile.in b/libffi/testsuite/Makefile.in
index 31e9cf520b8..8b574dad5d7 100644
--- a/libffi/testsuite/Makefile.in
+++ b/libffi/testsuite/Makefile.in
@@ -279,6 +279,7 @@ RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
279 echo $(top_srcdir)/../dejagnu/runtest ; \ 279 echo $(top_srcdir)/../dejagnu/runtest ; \
280 else echo runtest; fi` 280 else echo runtest; fi`
281 281
282EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp
282CLEANFILES = *.exe core* *.log *.sum 283CLEANFILES = *.exe core* *.log *.sum
283EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \ 284EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
284libffi.call/cls_align_longdouble_split.c \ 285libffi.call/cls_align_longdouble_split.c \