gcc/libffi/testsuite/Makefile.am
Maciej W. Rozycki a0b48358cb 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.
2020-04-25 21:27:14 +01:00

97 lines
4.4 KiB
Makefile

## Process this file with automake to produce Makefile.in.
AUTOMAKE_OPTIONS = foreign dejagnu
# Setup the testing framework, if you have one
EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
echo $(top_builddir)/../expect/expect ; \
else echo expect ; fi`
RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
echo $(top_srcdir)/../dejagnu/runtest ; \
else echo runtest; fi`
AM_RUNTESTFLAGS =
EXTRA_DEJAGNU_SITE_CONFIG=../local.exp
CLEANFILES = *.exe core* *.log *.sum
EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
libffi.call/cls_align_longdouble_split.c \
libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \
libffi.call/closure_fn1.c \
libffi.call/return_ul.c libffi.call/cls_align_double.c \
libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \
libffi.call/cls_64byte.c libffi.call/nested_struct7.c \
libffi.call/cls_align_sint32.c libffi.call/nested_struct2.c \
libffi.call/ffitest.h libffi.call/nested_struct4.c \
libffi.call/cls_multi_ushort.c libffi.call/struct3.c \
libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \
libffi.call/struct8.c libffi.call/nested_struct8.c \
libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \
libffi.call/cls_pointer.c \
libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \
libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \
libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \
libffi.call/call.exp libffi.call/cls_double.c \
libffi.call/cls_align_sint16.c libffi.call/cls_uint.c \
libffi.call/return_ll1.c libffi.call/nested_struct3.c \
libffi.call/cls_20byte1.c libffi.call/closure_fn4.c \
libffi.call/cls_uchar.c libffi.call/struct2.c libffi.call/cls_7byte.c \
libffi.call/strlen.c libffi.call/many.c libffi.call/testclosure.c \
libffi.call/return_fl.c libffi.call/struct5.c \
libffi.call/cls_12byte.c libffi.call/cls_multi_sshortchar.c \
libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
libffi.call/return_fl3.c libffi.call/stret_medium.c \
libffi.call/nested_struct6.c libffi.call/closure_fn3.c \
libffi.call/float3.c libffi.call/many2.c \
libffi.call/closure_simple.c libffi.call/cls_align_uint16.c \
libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
libffi.call/cls_sshort.c \
libffi.call/nested_struct.c libffi.call/cls_20byte.c \
libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
libffi.call/return_uc.c \
libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
libffi.call/promotion.c \
libffi.call/return_dbl.c libffi.call/cls_24byte.c \
libffi.call/struct4.c libffi.call/cls_6byte.c \
libffi.call/cls_align_uint32.c libffi.call/float.c \
libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
libffi.call/cls_align_float.c libffi.call/return_fl1.c \
libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
libffi.call/cls_align_sint64.c \
libffi.call/stret_large2.c libffi.call/return_sl.c \
libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
libffi.call/cls_2byte.c libffi.call/float2.c \
libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
libffi.call/struct1.c libffi.call/nested_struct9.c \
libffi.call/huge_struct.c libffi.call/problem1.c \
libffi.call/float4.c \
libffi.call/return_ldl.c \
libffi.call/closure_fn5.c \
libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \
libffi.call/return_sc.c libffi.call/struct7.c \
libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \
libffi.call/cls_6_1_byte.c \
libffi.call/cls_7_1_byte.c libffi.call/unwindtest.cc \
libffi.call/unwindtest_ffi_call.cc \
lib/wrapper.exp lib/target-libpath.exp \
lib/libffi.exp libffi.call/cls_struct_va1.c \
libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \
libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \
libffi.call/nested_struct11.c libffi.call/uninitialized.c \
libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \
libffi.call/va_struct3.c \
libffi.call/strlen2.c \
libffi.call/strlen3.c \
libffi.call/strlen4.c