From acb202325215058639234efb7af1f04c1c8a1f44 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 26 Mar 2014 20:18:41 -0700 Subject: [PATCH 1/7] Stop setting an empty AM_RUNTESTFLAGS --- testsuite/Makefile.am | 2 -- 1 file changed, 2 deletions(-) diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 912e8e18..4128536f 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -11,8 +11,6 @@ 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 From 9946a92af31b30cb7760150d1f8ca6c11b01aeea Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 26 Mar 2014 20:18:58 -0700 Subject: [PATCH 2/7] Stop looking for expect and runtest above top_builddir Users wishing to test hand-compiled versions of expect and runtest can easily enough put them in their path or set EXPECT and RUNTEST themselves. --- testsuite/Makefile.am | 9 --------- 1 file changed, 9 deletions(-) diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 4128536f..acd15c5e 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -2,15 +2,6 @@ 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` - EXTRA_DEJAGNU_SITE_CONFIG=../local.exp CLEANFILES = *.exe core* *.log *.sum From 0c3824702d3d59d37f8c177d646303f546187683 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 26 Mar 2014 14:51:32 -0700 Subject: [PATCH 3/7] Always set CC_FOR_TARGET for dejagnu, to make the testsuite respect $CC This fixes cross-compilation and compilation with CC="gcc -m32". --- .travis.yml | 10 +++++----- configure.ac | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6633e6fe..7c8d3025 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,15 +3,15 @@ compiler: - gcc - clang env: - - build32=false - - build32=true + - + - HOST=i386-pc-linux-gnu matrix: exclude: - compiler: clang - env: build32=true + env: HOST=i386-pc-linux-gnu before_script: - sudo apt-get install dejagnu texinfo - - if $build32 ; then sudo apt-get install gcc-multilib g++-multilib ; fi + - if [ "$HOST" = i386-pc-linux-gnu ] ; then sudo apt-get install gcc-multilib g++-multilib && CC="$CC -m32" ; fi -script: run= && if $build32 ; then run=i386 && mkdir path32 && PATH="$(pwd)/path32:$PATH" && printf '#!/bin/sh\nexec /usr/bin/'"$CC"' -m32 "$@"' > "path32/$CC" && chmod a+x "path32/$CC" ; fi && ./autogen.sh && $run ./configure && make && make dist && make check +script: ./autogen.sh && ./configure ${HOST+--host=$HOST} && make && make dist && make check diff --git a/configure.ac b/configure.ac index 3c1632c1..0369b308 100644 --- a/configure.ac +++ b/configure.ac @@ -53,12 +53,11 @@ fi if test "x$GCC" = "xyes"; then CFLAGS="$CFLAGS -fexceptions" - touch local.exp -else - cat > local.exp < local.exp < Date: Wed, 26 Mar 2014 23:53:57 -0700 Subject: [PATCH 4/7] .travis.yml: Make the build command more readable by splitting at && "script" can contain multiple commands to run in sequence. --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7c8d3025..6cf07912 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,9 @@ before_script: - sudo apt-get install dejagnu texinfo - if [ "$HOST" = i386-pc-linux-gnu ] ; then sudo apt-get install gcc-multilib g++-multilib && CC="$CC -m32" ; fi -script: ./autogen.sh && ./configure ${HOST+--host=$HOST} && make && make dist && make check +script: + - ./autogen.sh + - ./configure ${HOST+--host=$HOST} + - make + - make dist + - make check From 7d698125b1f05173f3656a89755a2eb58813b002 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 26 Mar 2014 23:17:56 -0700 Subject: [PATCH 5/7] Use the proper C++ compiler to run C++ tests Running the C compiler with -shared-libgcc -lstdc++ does not work on non-GCC compilers. --- .travis.yml | 4 ++-- configure.ac | 2 ++ testsuite/lib/libffi.exp | 4 ++++ testsuite/libffi.call/call.exp | 5 +---- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6cf07912..6c14fcd0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -language: c +language: cpp compiler: - gcc - clang @@ -12,7 +12,7 @@ matrix: before_script: - sudo apt-get install dejagnu texinfo - - if [ "$HOST" = i386-pc-linux-gnu ] ; then sudo apt-get install gcc-multilib g++-multilib && CC="$CC -m32" ; fi + - if [ "$HOST" = i386-pc-linux-gnu ] ; then sudo apt-get install gcc-multilib g++-multilib && CC="$CC -m32" && CXX="$CXX -m32" ; fi script: - ./autogen.sh diff --git a/configure.ac b/configure.ac index 0369b308..30580954 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,7 @@ m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) m4_define([_AC_ARG_VAR_PRECIOUS],[]) save_CFLAGS=$CFLAGS AC_PROG_CC +AC_PROG_CXX CFLAGS=$save_CFLAGS m4_undefine([_AC_ARG_VAR_PRECIOUS]) m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) @@ -57,6 +58,7 @@ fi cat > local.exp < Date: Thu, 27 Mar 2014 00:44:12 -0700 Subject: [PATCH 6/7] README: Update Windows example to set both CC and CXX --- README | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README b/README index 7c52607e..c26be6bc 100644 --- a/README +++ b/README @@ -146,13 +146,16 @@ It's also possible to build libffi on Windows platforms with Microsoft's Visual C++ compiler. In this case, use the msvcc.sh wrapper script during configuration like so: -path/to/configure CC=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\" +path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\" -For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64". -You may also need to specify --build appropriately. When building with MSVC -under a MingW environment, you may need to remove the line in configure -that sets 'fix_srcfile_path' to a 'cygpath' command. ('cygpath' is not -present in MingW, and is not required when using MingW-style paths.) +For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64" and +CXX="path/to/msvcc.sh -m64". You may also need to specify --build +appropriately. + +When building with MSVC under a MingW environment, you may need to +remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath' +command. ('cygpath' is not present in MingW, and is not required when +using MingW-style paths.) For iOS builds, the 'libffi.xcodeproj' Xcode project is available. From 03ca880081b22efab09ba72268270f83017d3d7b Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 27 Mar 2014 08:44:34 -0700 Subject: [PATCH 7/7] README: Note the testsuite changes to respect $CC and $CXX --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index c26be6bc..b4cdb858 100644 --- a/README +++ b/README @@ -183,8 +183,8 @@ See the git log for details at http://github.com/atgreen/libffi. 32-bit x86 targets such as Linux. Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi fixes. - Make the testsuite more robust: eliminated several spurious - failures. + Make the testsuite more robust: eliminate several spurious + failures, and respect the $CC and $CXX environment variables. Archive off the manually maintained ChangeLog in favor of git log.