From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22555 invoked by alias); 24 Feb 2009 13:12:28 -0000 Received: (qmail 22545 invoked by uid 22791); 24 Feb 2009 13:12:27 -0000 X-SWARE-Spam-Status: No, hits=2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62,J_CHICKENPOX_63,KAM_MX3,SPF_HELO_PASS,SPF_PASS,URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Feb 2009 13:12:22 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1ODCKnU031067; Tue, 24 Feb 2009 08:12:20 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n1ODCHBb004752; Tue, 24 Feb 2009 08:12:18 -0500 Received: from zebedee.pink (vpn-12-153.rdu.redhat.com [10.11.12.153]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1ODCGxe000455; Tue, 24 Feb 2009 08:12:17 -0500 Message-ID: <49A3F22F.20807@redhat.com> Date: Tue, 24 Feb 2009 13:12:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.17 (X11/20081009) MIME-Version: 1.0 To: Florent DEFAY CC: gcc-help@gcc.gnu.org Subject: Re: Porting GCC on a new arch (cross-compilation) References: <8502af3c0902240502n10554520ie839252cb4624577@mail.gmail.com> In-Reply-To: <8502af3c0902240502n10554520ie839252cb4624577@mail.gmail.com> 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/msg00177.txt.bz2 Florent DEFAY wrote: > 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 ? xgcc is your newly built cross-compiler. It aborts because there is an error. Now you have to debug your compiler with gdb. > 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 ? xgcc is the target gcc. Andrew.