This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix build for newish MSVC


Anthony Green skrev 2012-03-20 06:00:
> On Tue, Mar 13, 2012 at 10:24 AM, Peter Rosin <peda@lysator.liu.se> wrote:
>> ---
>>  ChangeLog       |    6 ++++++
>>  src/x86/win32.S |    2 +-
>>  2 files changed, 7 insertions(+), 1 deletions(-)
>>
>> Hi!
>>
>> I tried to build libffi using MSYS/MSVC and ml stumbled with
>>
>> win32.asm(958) : error A2006: undefined symbol : stub
>>
>> when it compiled win32.S.  Looking into that, I could fix it
>> with this patch, but it seems a bit strange that I need it,
>> given that it fails like this regardless if I use MSVC 2005
>> or MSVC 2010 (I can't find any ml.exe in my old MSVC 6 (1998)
>> install, I might have selected to not install it?).  It seems
>> like this double colon problem should have been detected
>> earlier...
> 
> 
> Thanks Peter.  I don't have the ability to test this, but I looked up
> the uses for ::, and I agree.

Ok, good.

>> I would also like a hint on how to do basic tests given that
>> dejagnu isn't available for MSYS (or is it?).  "make check"
>> complains with:
>>
>> WARNING: could not find `runtest'
> 
> DejaGNU is available for cygwin, and a quick google search shows that
> there's also an MSYS version.

Ok, I tried the Cygwin version in a Cygwin build (mixing Cygwin and
MSYS is bad for your health, so I'm not going there as a first stop)
and got the below output.  It should be noted that I don't know the
first thing about dejagnu so this is probably some simple cockpit
error... (the summary numbers at the end of the testsuite run seem
strange to me though)

Cheers,
Peter

$ gcc -v # the most recent gcc provided by Cygwin
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.5.3/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3/configure --srcdir=/gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --datarootdir=/usr/share --docdir=/usr/share/doc/gcc4 -C --datadir=/usr/share --infodir=/usr/share/info --mandir=/usr/share/man -v --with-gmp=/usr --with-mpfr=/usr --enable-bootstrap --enable-version-specific-runtime-libs --libexecdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-lto --enable-java-awt=gtk --disable-symvers --enable-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --enable-libada --enable-threads=posix --with-arch=i686 --with-tune=generic --enable-libg
 cj-subl
ibs CC=gcc-4 CXX=g++-4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g++-4 GNATMAKE_FOR_TARGET=gnatmake GNATBIND_FOR_TARGET=gnatbind --with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.5.3 (GCC)
$ mkdir cyg
$ cd cyg
$ ../configure
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... i686-pc-cygwin
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/i686-pc-cygwin/bin/ld.exe
checking if the linker (/usr/i686-pc-cygwin/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 8192
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-cygwin file names to i686-pc-cygwin format... func_convert_file_noop
checking how to convert i686-pc-cygwin file names to toolchain format... func_convert_file_noop
checking for /usr/i686-pc-cygwin/bin/ld.exe option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/i686-pc-cygwin/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for C compiler vendor... gnu
checking whether C compiler accepts -malign-double... yes
checking whether C compiler accepts -fstrict-aliasing... yes
checking whether C compiler accepts -ffast-math... yes
checking for gcc architecture flag...
checking for x86 cpuid 0 output... d:756e6547:6c65746e:49656e69
checking for x86 cpuid 1 output... 206a7:3100800:1fbae3ff:bfebfbff
checking whether C compiler accepts -march=pentium2... yes
checking for gcc architecture flag... -march=pentium2
checking whether C compiler accepts -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -march=pentium2... yes
checking CFLAGS for maximum warnings... -Wall
checking whether to enable maintainer-specific portions of Makefiles... no
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking for sys/mman.h... (cached) yes
checking for mmap... (cached) yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... no
checking for MAP_ANON(YMOUS)... yes
checking whether mmap with MAP_ANON(YMOUS) works... no
checking for ANSI C header files... (cached) yes
checking for memcpy... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking size of double... 8
checking size of long double... 12
checking whether byte ordering is bigendian... no
checking assembler .cfi pseudo-op support... yes
checking assembler supports pc related relocs... yes
checking assembler .ascii pseudo-op support... yes
checking assembler .string pseudo-op support... yes
checking whether .eh_frame section should be read-only... no
checking for __attribute__((visibility("hidden")))... no
configure: creating ./config.status
config.status: creating include/Makefile
config.status: creating include/ffi.h
config.status: creating Makefile
config.status: creating testsuite/Makefile
config.status: creating man/Makefile
config.status: creating libffi.pc
config.status: creating fficonfig.h
config.status: linking ../src/x86/ffitarget.h to include/ffitarget.h
config.status: executing buildir commands
config.status: skipping top_srcdir/Makefile - not created
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing include commands
config.status: executing src commands
$ make
make "AR_FLAGS="  "CC_FOR_BUILD="  "CFLAGS=-O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -march=pentium2 -Wall -fexceptions"  "CXXFLAGS="  "CFLAGS_FOR_BUILD="  "CFLAGS_FOR_TARGET="  "INSTALL=/usr/bin/install -c"  "INSTALL_DATA=/usr/bin/install -c -m 644"  "INSTALL_PROGRAM=/usr/bin/install -c"  "INSTALL_SCRIPT=/usr/bin/install -c"  "JC1FLAGS="  "LDFLAGS="  "LIBCFLAGS="  "LIBCFLAGS_FOR_TARGET="  "MAKE=make"  "MAKEINFO=/bin/sh /home/peda/libffi/missing --run makeinfo "  "PICFLAG="  "PICFLAG_FOR_TARGET="  "RUNTESTFLAGS="  "SHELL=/bin/sh"  "exec_prefix=/usr/local"  "infodir=/usr/local/share/info"  "libdir=/usr/local/lib"  "mandir=/usr/local/share/man"  "prefix=/usr/local"  "AR=ar"  "AS=as"  "CC=gcc"  "CXX=g++"  "LD=/usr/i686-pc-cygwin/bin/ld.exe"  "NM=/usr/bin/nm -B"  "RANLIB=ranlib"  "DESTDIR=" all-recursive
make[1]: Entering directory `/home/peda/libffi/cyg'
Making all in include
make[2]: Entering directory `/home/peda/libffi/cyg/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/peda/libffi/cyg/include'
Making all in testsuite
make[2]: Entering directory `/home/peda/libffi/cyg/testsuite'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/peda/libffi/cyg/testsuite'
Making all in man
make[2]: Entering directory `/home/peda/libffi/cyg/man'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/peda/libffi/cyg/man'
make[2]: Entering directory `/home/peda/libffi/cyg'
depbase=`echo src/prep_cif.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --tag=CC    --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I. -I../include -Iinclude -I../src  -g  -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -march=pentium2 -Wall -fexceptions -MT src/prep_cif.lo -MD -MP -MF $depbase.Tpo -c -o src/prep_cif.lo ../src/prep_cif.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -g -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -march=pentium2 -Wall -fexceptions -MT src/prep_cif.lo -MD -MP -MF src/.deps/prep_cif.Tpo -c ../src/prep_cif.c  -DDLL_EXPORT -DPIC -o src/.libs/prep_cif.o
../src/prep_cif.c: In function 'ffi_prep_cif_core':
../src/prep_cif.c:118:3: warning: suggest parentheses around '&&' within '||'
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -g -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -march=pentium2 -Wall -fexceptions -MT src/prep_cif.lo -MD -MP -MF src/.deps/prep_cif.Tpo -c ../src/prep_cif.c -o src/prep_cif.o >/dev/null 2>&1
depbase=`echo src/types.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\

*snip*

/bin/sh ./libtool    --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I. -I../include -Iinclude -I../src  -I. -I../include -Iinclude -I../src -g  -MT src/x86/win32.lo -MD -MP -MF $depbase.Tpo -c -o src/x86/win32.lo ../src/x86/win32.S &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -g -MT src/x86/win32.lo -MD -MP -MF src/x86/.deps/win32.Tpo -c ../src/x86/win32.S  -DDLL_EXPORT -DPIC -o src/x86/.libs/win32.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -g -MT src/x86/win32.lo -MD -MP -MF src/x86/.deps/win32.Tpo -c ../src/x86/win32.S -o src/x86/win32.o >/dev/null 2>&1
/bin/sh ./libtool --tag=CC    --mode=link gcc -g  -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -march=pentium2 -Wall -fexceptions  -version-info `grep -v '^#' ../libtool-version`  -no-undefined -bindir "/usr/local/bin"  -o libffi.la -rpath /usr/local/lib src/prep_cif.lo src/types.lo src/raw_api.lo  src/java_raw_api.lo src/closures.lo       src/x86/ffi.lo src/x86/win32.lo  
libtool: link: rm -fr  .libs/libffi.a .libs/libffi.dll.a .libs/libffi.la .libs/libffi.lai
libtool: link: gcc -shared  src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/win32.o    -O3 -malign-double -march=pentium2   -o .libs/cygffi-6.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libffi.dll.a
Creating library file: .libs/libffi.dll.a
libtool: link: ar cru .libs/libffi.a  src/prep_cif.o src/types.o src/raw_api.o src/java_raw_api.o src/closures.o src/x86/ffi.o src/x86/win32.o
libtool: link: ranlib .libs/libffi.a
libtool: link: ( cd ".libs" && rm -f "libffi.la" && ln -s "../libffi.la" "libffi.la" )
/bin/sh ./libtool --tag=CC    --mode=link gcc -g  -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -march=pentium2 -Wall -fexceptions    -o libffi_convenience.la  src/prep_cif.lo src/types.lo src/raw_api.lo  src/java_raw_api.lo src/closures.lo       src/x86/ffi.lo src/x86/win32.lo                  
libtool: link: rm -fr  .libs/libffi_convenience.a .libs/libffi_convenience.la
libtool: link: ar cru .libs/libffi_convenience.a src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/win32.o
libtool: link: ranlib .libs/libffi_convenience.a
libtool: link: ( cd ".libs" && rm -f "libffi_convenience.la" && ln -s "../libffi_convenience.la" "libffi_convenience.la" )
make[2]: Leaving directory `/home/peda/libffi/cyg'
make[1]: Leaving directory `/home/peda/libffi/cyg'
$ make check
Making check in include
make[1]: Entering directory `/home/peda/libffi/cyg/include'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/home/peda/libffi/cyg/include'
Making check in testsuite
make[1]: Entering directory `/home/peda/libffi/cyg/testsuite'
make  check-DEJAGNU
make[2]: Entering directory `/home/peda/libffi/cyg/testsuite'
srcdir=`CDPATH="${ZSH_VERSION+.}:" && cd ../../testsuite && pwd`; export srcdir; \
EXPECT=`if [ -f ../../expect/expect ] ; then  echo ../../expect/expect ;  else echo expect ; fi`; export EXPECT; \
runtest=`if [ -f ../../../dejagnu/runtest ] ; then  echo ../../../dejagnu/runtest ;  else echo runtest; fi`; \
if /bin/sh -c "$runtest --version" > /dev/null 2>&1; then \
  exit_status=0; l='libffi'; for tool in $l; do \
    if $runtest  --tool $tool --srcdir $srcdir ; \
    then :; else exit_status=1; fi; \
  done; \
else echo "WARNING: could not find \`runtest'" 1>&2; :;\
fi; \
exit $exit_status
WARNING: Couldn't find the global config file.
Test Run By peda on Tue Mar 20 08:38:46 2012
Native configuration is i686-pc-cygwin

                === libffi tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /home/peda/libffi/testsuite/config/default.exp as tool-and-target-specific interface file.
Running /home/peda/libffi/testsuite/libffi.call/call.exp ...
FAIL: libffi.call/closure_fn0.c execution test
FAIL: libffi.call/closure_fn1.c execution test
FAIL: libffi.call/closure_fn2.c execution test
FAIL: libffi.call/closure_fn3.c execution test
FAIL: libffi.call/closure_fn4.c execution test
FAIL: libffi.call/closure_fn5.c execution test
FAIL: libffi.call/closure_fn6.c execution test
FAIL: libffi.call/closure_loc_fn0.c execution test
FAIL: libffi.call/closure_stdcall.c execution test
FAIL: libffi.call/closure_thiscall.c (test for excess errors)
WARNING: libffi.call/closure_thiscall.c compilation failed to produce executable
FAIL: libffi.call/cls_12byte.c execution test
FAIL: libffi.call/cls_16byte.c execution test

*snip* tons of FAILs

FAIL: libffi.call/struct7.c execution test
FAIL: libffi.call/struct8.c execution test
FAIL: libffi.call/struct9.c execution test
FAIL: libffi.call/testclosure.c execution test
Running /home/peda/libffi/testsuite/libffi.special/special.exp ...
FAIL: libffi.special/unwindtest.cc execution test
FAIL: libffi.special/unwindtest_ffi_call.cc execution test
FAIL: libffi.special/unwindtest.cc execution test
FAIL: libffi.special/unwindtest_ffi_call.cc execution test
FAIL: libffi.special/unwindtest.cc execution test
FAIL: libffi.special/unwindtest_ffi_call.cc execution test
FAIL: libffi.special/unwindtest.cc execution test
FAIL: libffi.special/unwindtest_ffi_call.cc execution test

                === libffi Summary ===

# of expected passes            658
# of unexpected failures        663
Makefile:317: recipe for target `check-DEJAGNU' failed
make[2]: *** [check-DEJAGNU] Error 1
make[2]: Leaving directory `/home/peda/libffi/cyg/testsuite'
Makefile:385: recipe for target `check-am' failed
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/home/peda/libffi/cyg/testsuite'
Makefile:1286: recipe for target `check-recursive' failed
make: *** [check-recursive] Error 1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]