Igor Marnat wrote:
Hello, all!
I'm trying to build cross-compiler to build the programs for PowerPC processor. Host is Fedora Core 3, i686, kernel of 2.6.10 version. GPC is of 20050217 version, is being built together with GCC 3.3.3.
I've configured it with
../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --with-newlib --enable-languages=c,pascal --disable-libgcj --target=ppc-linux.
Compiler itself (xgpc) has been built successfully but it doesn't want to build rts and tells me that c compiler cannot create executables. In the <build>/gcc/p/rts there is the only one file, config.log (attached) where cc1 (of just built xgcc) tells that arch=i686 is an invalid option for him (sounds reasonable since it's the compiler for ppc platform). So, could you please make some clarifications for me:
- why GPC didn't see that it's being built as a cross compiler (there is
nothing about it in config.log, it even doesn't try to determine it). 2. what should be done to avoid passing of the CFLAGS of the native host compiler to cross compiler xgcc which has been just built.
IIRC CFLAGS contains general flags, for _all_ stages of compilation. Gcc makefiles contain a lot of variables like HOST_LIB_PATH and TARGET_LIB_PATH or FLAGS_FOR_TARGET. If you want to pass flags just to native compiler you need to find correct variable (sorry ATM I do not know which one).
FYI I have built to Mac-OSX cross compiler based on 3.4.3. The runtime build failed since I have no OSX libc headers (and no OSX binutils...). But it got past configure stage and attempted to compile files.
I have also build cross mingw-32 compiler based on 3.2.3. This time the runtime built OK, however I had to manually change configure script for the runtime (configure found out that compiled executables can not run, but still did not belive that I am cross-compiling).