diorcety / crosstool-ng

crosstool-ng fork with the full support of Darwin/Linux/Windows as build and host machine
Other
33 stars 15 forks source link

target=i686-apple-darwin10 host=i686-w64-mingw32 failure #16

Closed class101 closed 10 years ago

class101 commented 10 years ago

Hello

I have been able to successfully build gcc-5666.3

target=x86_64-apple-darwin10 host=x86_64-w64-mingw32 (no multilib)
bitness:64bit -m64 --with-arch=nocona --with-tune=core2

'CC_FOR_BUILD=x86_64-build_w64-mingw32-gcc' 'CFLAGS_FOR_BUILD=-m64' 'CFLAGS=-O2 -pipe -m64 -D__USE_MINGW_ANSI_STDIO=1' 'CXXFLAGS=-O2 -pipe -m64 -D__USE_MINGW_ANSI_STDIO=1' 'LDFLAGS= -pipe -m64 -static -lstdc++ -lm' 'CFLAGS_FOR_TARGET=  -march=nocona   -mtune=core2   ' 'CXXFLAGS_FOR_TARGET=  -march=nocona   -mtune=core2   ' 'LDFLAGS_FOR_TARGET=  ' '../../../src/gcc-5666.3/configure' '--build=x86_64-build_w64-mingw32' '--host=x86_64-build_w64-mingw32' '--target=x86_64-apple-darwin10' '--prefix=/libs/gcc-5666.3-x86_64-apple-darwin10-dw2' '--with-sysroot=/libs/gcc-5666.3-x86_64-apple-darwin10-dw2' '--enable-languages=c,c++' '--with-arch=nocona' '--with-tune=core2' '--enable-shared' '--enable-static' '--enable-__cxa_atexit' '--disable-libmudflap' '--disable-libgomp' '--disable-libssp' '--with-cloog=/libs/tmp/.build/x86_64-apple-darwin10/buildtools' '--with-libelf=/libs/tmp/.build/x86_64-apple-darwin10/buildtools' '--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++ -lm' '--enable-threads=posix' '--enable-target-optspace' '--without-long-double-128' '--disable-nls' '--disable-multilib' '--with-gxx-include-dir=./usr/include/c++/4.2.1' '--with-ld=/libs/gcc-5666.3-x86_64-apple-darwin10-dw2/bin/x86_64-apple-darwin10-ld.exe' '--with-ar=/libs/gcc-5666.3-x86_64-apple-darwin10-dw2/bin/x86_64-apple-darwin10-ar.exe' '--with-as=/libs/gcc-5666.3-x86_64-apple-darwin10-dw2/bin/x86_64-apple-darwin10-as.exe' '--with-ranlib=/libs/gcc-5666.3-x86_64-apple-darwin10-dw2/bin/x86_64-apple-darwin10-ranlib.exe' '--with-lipo=/libs/gcc-5666.3-x86_64-apple-darwin10-dw2/bin/x86_64-apple-darwin10-lipo.exe' '--with-local-prefix=/libs/gcc-5666.3-x86_64-apple-darwin10-dw2' '--enable-c99' '--enable-long-long' '--enable-version-specific-runtime-libs' '--enable-fully-dynamic-string' '--disable-libstdcxx-debug' '--disable-werror' '--disable-symvers' '--disable-isl-version-check' '--disable-cloog-version-check' '--disable-rpath' '--enable-cloog-backend=isl' '--enable-dw2-exceptions' '--disable-sjlj-exceptions' '--with-arch=nocona' '--with-tune=core2' 

but I fail with

target=i686-apple-darwin10 host=i686-w64-mingw32 failure (no multilib)
bitness:32bit -m32 --with-arch=i686 --with-tune=generic

'CC_FOR_BUILD=i686-build_w64-mingw32-gcc' 'CFLAGS_FOR_BUILD=-m32' 'CFLAGS=-O2 -pipe -m32 -D__USE_MINGW_ANSI_STDIO=1' 'CXXFLAGS=-O2 -pipe -m32 -D__USE_MINGW_ANSI_STDIO=1' 'LDFLAGS= -pipe -m32 -static -lstdc++ -lm' 'CFLAGS_FOR_TARGET=  -march=i686   -mtune=generic   ' 'CXXFLAGS_FOR_TARGET=  -march=i686   -mtune=generic   ' 'LDFLAGS_FOR_TARGET=  ' '../../../src/gcc-5666.3/configure' '--build=i686-build_w64-mingw32' '--host=i686-build_w64-mingw32' '--target=i686-apple-darwin10' '--prefix=/libs/gcc-5666.3-i686-apple-darwin10-dw2' '--with-sysroot=/libs/gcc-5666.3-i686-apple-darwin10-dw2' '--enable-languages=c,c++' '--with-arch=i686' '--with-tune=generic' '--enable-shared' '--enable-static' '--enable-__cxa_atexit' '--disable-libmudflap' '--disable-libgomp' '--disable-libssp' '--with-cloog=/libs/tmp/.build/i686-apple-darwin10/buildtools' '--with-libelf=/libs/tmp/.build/i686-apple-darwin10/buildtools' '--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++ -lm' '--enable-threads=posix' '--enable-target-optspace' '--without-long-double-128' '--disable-nls' '--disable-multilib' '--with-gxx-include-dir=./usr/include/c++/4.2.1' '--with-ld=/libs/gcc-5666.3-i686-apple-darwin10-dw2/bin/i686-apple-darwin10-ld.exe' '--with-ar=/libs/gcc-5666.3-i686-apple-darwin10-dw2/bin/i686-apple-darwin10-ar.exe' '--with-as=/libs/gcc-5666.3-i686-apple-darwin10-dw2/bin/i686-apple-darwin10-as.exe' '--with-ranlib=/libs/gcc-5666.3-i686-apple-darwin10-dw2/bin/i686-apple-darwin10-ranlib.exe' '--with-lipo=/libs/gcc-5666.3-i686-apple-darwin10-dw2/bin/i686-apple-darwin10-lipo.exe' '--with-local-prefix=/libs/gcc-5666.3-i686-apple-darwin10-dw2' '--enable-c99' '--enable-long-long' '--enable-version-specific-runtime-libs' '--enable-fully-dynamic-string' '--disable-libstdcxx-debug' '--disable-werror' '--disable-symvers' '--disable-isl-version-check' '--disable-cloog-version-check' '--disable-rpath' '--enable-cloog-backend=isl' '--enable-dw2-exceptions' '--disable-sjlj-exceptions' '--with-arch=i686' '--with-tune=generic' 

I attempted to compare both builds, it seems in i686 mode it is attempting to use -m64 that is set within a makefile call that is not made in x86_64 mode, the stmp-multilib that is building kext64, strange because in 64bit mode it does not compile kext64 but kext only

    [ALL  ]  /usr/bin/make GCC_FOR_TARGET="/libs/tmp/.build/i686-apple-darwin10/build/build-cc-gcc-final/./gcc/xgcc -B/libs/tmp/.build/i686-apple-darwin10/build/build-cc-gcc-final/./gcc/ -B/libs/gcc-5666.3-i686-apple-darwin10-dw2/i686-apple-darwin10/bin/ -B/libs/gcc-5666.3-i686-apple-darwin10-dw2/i686-apple-darwin10/lib/ -B/libs/gcc-5666.3-i686-apple-darwin10-dw2/i686-apple-darwin10/lib/system -isystem /libs/gcc-5666.3-i686-apple-darwin10-dw2/i686-apple-darwin10/include -isystem /libs/gcc-5666.3-i686-apple-darwin10-dw2/i686-apple-darwin10/sys-include "   AR_FOR_TARGET="i686-apple-darwin10-ar"   AR_CREATE_FOR_TARGET="i686-apple-darwin10-ar  rc"   AR_EXTRACT_FOR_TARGET="i686-apple-darwin10-ar  x"   AR_FLAGS_FOR_TARGET=""   CC="gcc" CFLAGS="-O2 -pipe -m32 -D__USE_MINGW_ANSI_STDIO=1 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute  "   BUILD_PREFIX=""   BUILD_PREFIX_1=""   LANGUAGES=""   LIBGCC2_CFLAGS="-O2  -g -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -mkernel -m64 -Dmalloc=kern_os_malloc -Dfree=kern_os_free -DLIBCC_KEXT "    LIBGCC2_STATIC_CFLAGS="-mmacosx-version-min=10.4"    MULTILIB_CFLAGS=" -mkernel -m64 -Dmalloc=kern_os_malloc -Dfree=kern_os_free -DLIBCC_KEXT" T=kext64/ kext64/crt3.o
[ALL  ]  /libs/tmp/.build/i686-apple-darwin10/build/build-cc-gcc-final/./gcc/xgcc -B/libs/tmp/.build/i686-apple-darwin10/build/build-cc-gcc-final/./gcc/ -B/libs/gcc-5666.3-i686-apple-darwin10-dw2/i686-apple-darwin10/bin/ -B/libs/gcc-5666.3-i686-apple-darwin10-dw2/i686-apple-darwin10/lib/ -B/libs/gcc-5666.3-i686-apple-darwin10-dw2/i686-apple-darwin10/lib/system -isystem /libs/gcc-5666.3-i686-apple-darwin10-dw2/i686-apple-darwin10/include -isystem /libs/gcc-5666.3-i686-apple-darwin10-dw2/i686-apple-darwin10/sys-include  -O2  -g -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../../../src/gcc-5666.3/gcc -I../../../../src/gcc-5666.3/gcc/. -I../../../../src/gcc-5666.3/gcc/../include -I../../../../src/gcc-5666.3/gcc/../libcpp/include  -I../../../../src/gcc-5666.3/gcc/../libdecnumber -I../libdecnumber -DSHARED -mkernel -m64 -Dmalloc=kern_os_malloc -Dfree=kern_os_free -DLIBCC_KEXT -DL_get_pc_thunk_ax -xassembler-with-cpp -c ../../../../src/gcc-5666.3/gcc/config/i386/lib1funcs.asm -o libgcc/kext64/_get_pc_thunk_ax_s.o
[ALL  ]  make[5]: Entering directory '/libs/tmp/.build/i686-apple-darwin10/build/build-cc-gcc-final/gcc'
[ERROR]  ../../../../src/gcc-5666.3/gcc/config/i386/lib1funcs.asm:0: error: CPU you selected does not support x86-64 instruction set
[ALL  ]  libgcc.mk:2517: recipe for target 'libgcc/kext64/_get_pc_thunk_ax_s.o' failed
[ERROR]  make[4]: *** [libgcc/kext64/_get_pc_thunk_ax_s.o] Error 
class101 commented 10 years ago

nvm on this one, I think I generate myself this issue, will update later if I find why it happens

mingwandroid commented 10 years ago

Apple does not support non-multilib in GCC nor in cctools. Because of this fact, and because there is no advantage to it neither do I (you can build either 32bit or 64bit compiler executables on Windows that target both of 32bit and/or 64bit Darwin (using -m32/-m64 flags). i.e. you do not need a 64bit Windows system or compiler to generate 64bit Darwin binaries - FWIW, I would not recommend trying to link very large software on 32bit systems these days either, you will probably run out of address space.

Since Linux cleanly supports non-multilib I am happy to also support this (but IMHO there is no good reason not to build them as multilib).

Since Windows has advantages for non-multilib (different exception handling models) we must support this use case.