From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15945 invoked by alias); 24 Feb 2009 13:02:41 -0000 Received: (qmail 15930 invoked by uid 22791); 24 Feb 2009 13:02:40 -0000 X-SWARE-Spam-Status: No, hits=0.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62,J_CHICKENPOX_63,SARE_MSGID_LONG40,SPF_PASS,URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from mail-bw0-f162.google.com (HELO mail-bw0-f162.google.com) (209.85.218.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Feb 2009 13:02:32 +0000 Received: by bwz6 with SMTP id 6so5863596bwz.8 for ; Tue, 24 Feb 2009 05:02:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.11.5 with SMTP id o5mr4313120mui.132.1235480548316; Tue, 24 Feb 2009 05:02:28 -0800 (PST) Date: Tue, 24 Feb 2009 13:02:00 -0000 Message-ID: <8502af3c0902240502n10554520ie839252cb4624577@mail.gmail.com> Subject: Porting GCC on a new arch (cross-compilation) From: Florent DEFAY To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 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: 2009-02/txt/msg00176.txt.bz2 Hi, I have to port GCC on a new arch. I'm working on an i686-pc-linux-gnu machine so it is cross-compilation. I read tutorials from IIT of Bombay. I read parts of GCC Internals. I'm working with gcc-4.3.3 sources. The binutils are already installed in /home/me/target/. I began the port from scratch, I have done these steps : - modify config.gcc and config.sub to recognize the new target - create empty files $GCCSOURCES/gcc/config/target/target.h target.c target.md - fill in target.h with macros, following GCC internals's list, adding new macros until able to compile target-gcc. I configure gcc this way : configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=target --enable-langauges=c --prefix=/home/me/target/ When I run 'make', it finishes with this : checking for suffix of object files... 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/me/gcc/build_target' make: *** [all] Error 2 When I look at config.log in libgcc I find these errors : configure:2398: /home/me/gcc/build_target/./gcc/xgcc -B/home/me/gcc/build_target/./gcc/ -B/home/me/target/target/bin/ -B/home/me/target/target/lib/ -isystem /home/me/target/target/include -isystem /home/me/target/target/sys-include -o conftest -O2 -g -g -O2 conftest.c >&5 xgcc: Internal error: Killed (program cc1) configure:2567: checking for suffix of object files configure:2588: /home/me/gcc/build_target/./gcc/xgcc -B/home/me/gcc/build_target/./gcc/ -B/home/me/target/target/bin/ -B/home/me/target/target/lib/ -isystem /home/me/target/target/include -isystem /home/me/target/target/sys-include -c -O2 -g -g -O2 conftest.c >&5 xgcc: Internal error: Killed (program cc1) 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 "" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:2605: error: cannot compute suffix of object files: cannot compile Is these errors about libgcc in my machine description ? Is libgcc compulsory in a port ? If it is, how should I implement it ? If not, how to configure to avoid these problems ? Finally, I can run 'make install' and in /home/me/target/bin/ I have my target-gcc built. But when I use it this way : target-gcc -da -S emptyfile.c the result is that it does nothing for a while and respond : target-gcc: Internal error: Killed (program cc1) Please submit a full bug report. See for instructions. Maybe the target-gcc error and make errors are linked ? Are xgcc and target-gcc equals ? Thank you. Florent