From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2512 invoked by alias); 4 Mar 2013 15:14:51 -0000 Received: (qmail 2503 invoked by uid 22791); 4 Mar 2013 15:14:49 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_XG X-Spam-Check-By: sourceware.org Received: from mail-oa0-f49.google.com (HELO mail-oa0-f49.google.com) (209.85.219.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Mar 2013 15:14:43 +0000 Received: by mail-oa0-f49.google.com with SMTP id j6so9339692oag.36 for ; Mon, 04 Mar 2013 07:14:43 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.235.49 with SMTP id uj17mr15648298obc.18.1362410083214; Mon, 04 Mar 2013 07:14:43 -0800 (PST) Received: by 10.182.53.194 with HTTP; Mon, 4 Mar 2013 07:14:43 -0800 (PST) In-Reply-To: References: Date: Mon, 04 Mar 2013 15:14:00 -0000 Message-ID: Subject: Re: cross compiling gcc for i686 target From: vijay nag To: Ian Lance Taylor Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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: 2013-03/txt/msg00020.txt.bz2 Will cross compile of gcc create xgcc by any chance ? xgcc is trying to make references to the target specific libraries like libcrt, libc, et al while compiling libstdc++-v3. Tail of my config logs. configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES=94 configure:3885: /auto/nobackup-bgl-mitg-dev13/vinag/tmpv/sbtools.tmp.201302221200/sbtools/s= ystemsw/tools/src/objdir_201302221200_linux-x86/gcc_stage1/./gcc/xgcc -B/auto/nobackup-bgl-mitg-dev13/vinag/tmpv/sbtools.tmp.201302221200/sbtools= /systemsw/tools/src/objdir_201302221200_linux-x86/gcc_stage1/./gcc/ -B/ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu= /bin/ -B/ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu= /lib/ -isystem /ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-li= nux-gnu/include -isystem /ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-li= nux-gnu/sys-include -o conftest -m32 conftest.c >&5 /ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/b= in/ld: cannot find crt1.o: No such file or directory /ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/b= in/ld: cannot find crti.o: No such file or directory /ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/b= in/ld: cannot find -lc /ws/vinag-bgl/tools/bintools/linux-x86/gcc/201302221200/i686-pc-linux-gnu/b= in/ld: cannot find crtn.o: No such file or directory Why is this error ? On Sat, Mar 2, 2013 at 1:15 PM, vijay nag wrote: > I tried to build with host,build =3D amd64-pc-linux-gnu and > target=3Di686-pc-linux-gnu. Binutils compile successfully for > i686-pc-linux-gnu target , but when native compiler tries to invoke > "i686-pc-linux-gn-as" which by default emits 32 bit code i see the > following errors. > > gcc -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall > -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes > -Wmissing-format-attribute -Wold-style-definition -Wc++-compat > -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../../gcc/gcc > -I../../../gcc/gcc/build -I../../../gcc/gcc/../include > -I../../../gcc/gcc/../libcpp/include > -I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/sr= c/objdir_201302221200_linux-x86/gcc_stage1/./gmp > -I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/sr= c/gcc/gmp > -I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/sr= c/objdir_201302221200_linux-x86/gcc_stage1/./mpfr > -I/localdiskvinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/src= /gcc/mpfr > -I/localdisk/vinag/tmp/sbtools.tmp.201302221200/sbtools/systemsw/tools/sr= c/gcc/mpc/src > -I../../../gcc/gcc/../libdecnumber > -I../../../gcc/gcc/../libdecnumber/bid -I../libdecnumber \ > -DBASEVER=3D"\"4.7.2\"" -DDATESTAMP=3D"\"\"" \ > -DREVISION=3D"\"\"" \ > -DDEVPHASE=3D"\"\"" -DPKGVERSION=3D"\"(GCC) \"" \ > -DBUGURL=3D"\"\"" -o > build/version.o ../../../gcc/gcc/version.c > /tmp/ccAlfevC.s: Assembler messages: > /tmp/ccAlfevC.s:37: Error: cannot represent relocation type BFD_RELOC_64 > /tmp/ccAlfevC.s:38: Error: cannot represent relocation type BFD_RELOC_64 > /tmp/ccAlfevC.s:66: Error: cannot represent relocation type BFD_RELOC_64 > /tmp/ccAlfevC.s:84: Error: cannot represent relocation type BFD_RELOC_64 > /tmp/ccAlfevC.s:102: Error: cannot represent relocation type BFD_RELOC_64 > make[2]: *** [build/version.o] Error 1 > make[2]: *** Waiting for unfinished jobs.... > /bin/sh ../../../gcc/gcc/../move-if-change tmp-optionlist optionlist > echo timestamp > s-options > make[2]: *** wait: No child processes. Stop. > make[1]: *** [all-gcc] Error 2 > > exporting CFLAGS=3D'-m64' I could go past this point. It bails out in > the next stage of compilation when the target compiler is used with > -m64 option with the error "cc1plus: sorry, unimplemented: 64-bit mode > not compiled in" > > On Fri, Mar 1, 2013 at 11:58 PM, Ian Lance Taylor wrote: >> On Fri, Mar 1, 2013 at 9:39 AM, vijay nag wrote: >>> >>> Is it possible to do a cross compile of gcc-4.7.2 on AMD x86_64 to >>> produce i686 target ? >>> >>> My build, host and target parameters are amd64-pc-linux-gnu, >>> amd64-pc-linux-gnu and i686-pc-linux-gnu. My native compiler again is >>> a 64 bit compiler emitting default 64 bit object code. >> >> Yes, it is possible. >> >> It is also usually unnecessary. A typical x86_64 compiler >> installation will produce 32-bit x86 code with the -m32 option. >> >> Ian