From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30542 invoked by alias); 13 Mar 2011 14:23:28 -0000 Received: (qmail 30533 invoked by uid 22791); 13 Mar 2011 14:23:27 -0000 X-SWARE-Spam-Status: No, hits=1.3 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_CX,TW_GC,TW_QV X-Spam-Check-By: sourceware.org Received: from mail-ey0-f175.google.com (HELO mail-ey0-f175.google.com) (209.85.215.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 13 Mar 2011 14:23:20 +0000 Received: by eye27 with SMTP id 27so1287047eye.20 for ; Sun, 13 Mar 2011 07:23:18 -0700 (PDT) Received: by 10.14.49.66 with SMTP id w42mr4651741eeb.17.1300026198041; Sun, 13 Mar 2011 07:23:18 -0700 (PDT) Received: from [127.0.0.1] ([46.182.126.126]) by mx.google.com with ESMTPS id t50sm5114948eeh.6.2011.03.13.07.23.13 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 Mar 2011 07:23:15 -0700 (PDT) Message-ID: <4D7CD348.2060509@googlemail.com> Date: Sun, 13 Mar 2011 14:23:00 -0000 From: Michael Zintakis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 MIME-Version: 1.0 To: Ian Lance Taylor CC: gcc-help@gcc.gnu.org Subject: Re: building native cross compiler References: <4D7A37DD.8030205@googlemail.com> <4D7A5420.4000608@googlemail.com> <4D7A8A4D.2080706@googlemail.com> <4D7AB3BB.7060208@googlemail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg00128.txt.bz2 Ian, I spent the whole day yesterday trying to build GCC2, though unfortunately, I wasn't successful! >> And my second (speculative) query - would it be wise to skip the first >> step in this process (building GCC1) and build GCC2 instead and >> continue the path from there? What would be the implications if such >> path is to be followed (if at all possible that is)? >> > > It would be neither wise nor unwise. It would save some time, and there > would be a very small risk that the compiler you used instead of GCC1 > had a bug. (That has actually happened to me--a bug in the first > compiler which subtly miscompiled the second compiler and caused > problems in the code it generated--but not for many years.) > I did try this just as a 'test run', but hit a brick wall. Here is what I did: I've downloaded and unpacked gcc 4.5.2 (didn't want to use the new version as 4.5.2 was already installed on my host system) in ~/gcc-test/gcc-4.5.2. I then created ~/gcc-test/gcc-build, jumped to it and executed the following: CC=gcc CFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4" CXXFLAGS="-O2 -g -pipe -fexceptions -fstack-protector --param=ssp-buffer-size=4" XCFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4" TCFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4" GCJFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4" ../gcc-4.5.2/configure --target=powerpc-redhat-linux --host=x86_64-redhat-linux --build=x86_64-redhat-linux --prefix=/usr --disable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --disable-nls --enable-languages=c,c++,objc,obj-c++,fortran --disable-libgcj --with-ppl --with-cloog --disable-multilib That went well. I then executed the following: GCJFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4" make BOOT_CFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4" After a while I've got this error: Configuring in powerpc-redhat-linux/libgcc configure: creating cache ./config.cache checking for --enable-version-specific-runtime-libs... no checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... gawk checking build system type... x86_64-redhat-linux-gnu checking host system type... powerpc-redhat-linux-gnu checking for powerpc-redhat-linux-ar... powerpc-redhat-linux-ar checking for powerpc-redhat-linux-lipo... powerpc-redhat-linux-lipo checking for powerpc-redhat-linux-nm... /home/mz/gcc-test/gcc-build/./gcc/nm checking for powerpc-redhat-linux-ranlib... powerpc-redhat-linux-ranlib checking for powerpc-redhat-linux-strip... powerpc-redhat-linux-strip checking whether ln -s works... yes checking for powerpc-redhat-linux-gcc... /home/mz/gcc-test/gcc-build/./gcc/xgcc -B/home/mz/gcc-test/gcc-build/./gcc/ -B/usr/powerpc-redhat-linux/bin/ -B/usr/powerpc-redhat-linux/lib/ -isystem /usr/powerpc-redhat-linux/include -isystem /usr/powerpc-redhat-linux/sys-include checking for suffix of object files... configure: error: in `/home/mz/gcc-test/gcc-build/powerpc-redhat-linux/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make[1]: *** [configure-target-libgcc] Error 1 make[1]: Leaving directory `/home/mz/gcc-test/gcc-build' make: *** [all] Error 2 Closer examination reveals that build-x86_64-redhat-linux is built, though the above error happens when the build up of the ppc branch starts. configure.log (which I have a copy of here and can attach, if needed) shows this: configure:2993: /home/mz/gcc-test/gcc-build/./gcc/xgcc -B/home/mz/gcc-test/gcc-build/./gcc/ -B/usr/powerpc-redhat-linux/bin/ -B/usr/powerpc-redhat-linux/lib/ -isystem /usr/powerpc-redhat-linux/include -isystem /usr/powerpc-redhat-linux/sys-include -V >&5 xgcc: '-V' must come at the start of the command line configure:3004: $? = 1 configure:2993: /home/mz/gcc-test/gcc-build/./gcc/xgcc -B/home/mz/gcc-test/gcc-build/./gcc/ -B/usr/powerpc-redhat-linux/bin/ -B/usr/powerpc-redhat-linux/lib/ -isystem /usr/powerpc-redhat-linux/include -isystem /usr/powerpc-redhat-linux/sys-include -qversion >&5 xgcc: unrecognized option '-qversion' xgcc: no input files configure:3004: $? = 1 configure:3020: /home/mz/gcc-test/gcc-build/./gcc/xgcc -B/home/mz/gcc-test/gcc-build/./gcc/ -B/usr/powerpc-redhat-linux/bin/ -B/usr/powerpc-redhat-linux/lib/ -isystem /usr/powerpc-redhat-linux/include -isystem /usr/powerpc-redhat-linux/sys-include -o conftest -O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 conftest.c >&5 /home/mz/gcc-test/gcc-build/./gcc/as: line 83: exec: : not found configure:3023: $? = 2 configure:3211: checking for suffix of object files configure:3233: /home/mz/gcc-test/gcc-build/./gcc/xgcc -B/home/mz/gcc-test/gcc-build/./gcc/ -B/usr/powerpc-redhat-linux/bin/ -B/usr/powerpc-redhat-linux/lib/ -isystem /usr/powerpc-redhat-linux/include -isystem /usr/powerpc-redhat-linux/sys-include -c -O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 conftest.c >&5 /home/mz/gcc-test/gcc-build/./gcc/as: line 83: exec: : not found configure:3237: $? = 2 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "GNU C Runtime Library" | #define PACKAGE_TARNAME "libgcc" | #define PACKAGE_VERSION "1.0" | #define PACKAGE_STRING "GNU C Runtime Library 1.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "http://www.gnu.org/software/libgcc/" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3251: error: in `/home/mz/gcc-test/gcc-build/powerpc-redhat-linux/libgcc': configure:3254: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. There is obviously something I am missing, but do not know what. When I build gcc, but without cross compilation (i.e. multilib x86_64 -> i586/i686) and execute this as a configure & make: CC=gcc CFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=core2" CXXFLAGS="-O2 -g -pipe -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=core2" XCFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=core2" TCFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=core2" GCJFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=core2" ../gcc-4.5.2/configure --prefix=/usr --disable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --disable-nls --enable-languages=c,c++,objc,obj-c++,fortran --disable-libgcj --with-ppl --with-cloog --with-tune-32=pentium4 --with-tune-64=core2 --with-cpu-32=pentium4 --with-cpu-64=core2 --with-arch-32=pentium4 --with-arch-64=core2 --enable-multilib GCJFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=core2" make BOOT_CFLAGS="-O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=core2" I do not have the above error and everything is OK. I end up with "build-x86_64-redhat-linux" as well as "x86_64-redhat-linux" directories and they have their 32/ counterparts completely built as well. So, to me it is something to do with the cross-compilation I am attempting. There is another 'weird' problem I am getting - when I execute 'make -j3' instead of just 'make' the build stops with the following error: config.status: linking ../../gcc-4.5.2/gmp/mpn/generic/gmp-mparam.h to gmp-mparam.h config.status: executing libtool commands make[1]: Leaving directory `/home/mz/gcc-test/gcc-build' make: *** [all] Error 2 When I restart make again with the same command after that error (i.e. execute the same 'make -j3' from that point) the build continues without problems! Weird!