From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1962 invoked by alias); 16 Apr 2012 15:09:50 -0000 Received: (qmail 1954 invoked by uid 22791); 16 Apr 2012 15:09:49 -0000 X-SWARE-Spam-Status: No, hits=-4.4 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_CX,TW_MF X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Apr 2012 15:09:34 +0000 Received: by vcbfk14 with SMTP id fk14so4286723vcb.0 for ; Mon, 16 Apr 2012 08:09:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.75.5 with SMTP id y5mr5013645vdv.41.1334588973842; Mon, 16 Apr 2012 08:09:33 -0700 (PDT) Received: by 10.52.182.38 with HTTP; Mon, 16 Apr 2012 08:09:33 -0700 (PDT) In-Reply-To: References: Date: Mon, 16 Apr 2012 15:09:00 -0000 Message-ID: Subject: Re: how could I compile a gcc that can run on a powerpc target From: lei yang To: David Smoot , crossgcc@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00010.txt.bz2 On Mon, Apr 16, 2012 at 2:59 AM, David Smoot wrote: > When you create a toolchain, you have three variables: > > The target architecture that the toolchain will produce binaries for. > In this case you have said you want to make powerPC binaries. > > The host that the toolchain will run upon. =A0You have also stated that > this is powerPC. > > The question is, where do you want to create this toolchain? =A0If you > want to create this toolchain on a non-powerPC host, you are in the > right place. =A0This is known as a "Canandian Cross" and is one of the > more difficult things to do. > Thanks for the response, and what you said make me clear more. yes, I will crate a toolchain on a x86 platform and the toolchain created by it can run on a powerpc target and produce powerpc binary my cross-toochain for powerpc on x86 is named "/buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-wrs-linux-gnu/x86-lin= ux2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std-gcc" and I have cross built gmp and mfpr and put it on /buildarea1/lyang0/gcc/gmp and buildarea1/lyang0/gcc/mpfr my step is export CC=3D"/buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-wrs-linux= -gnu/x86-linux2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std-gcc" && export CXX=3D"/buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-wrs-l= inux-gnu/x86-linux2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std-g++" && export AR=3D"/buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-wrs-li= nux-gnu/x86-linux2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std-ar"&& export AS=3D"/buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-wrs-linux= -gnu/x86-linux2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std-as" && export RANLIB=3D"/buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-wr= s-linux-gnu/x86-linux2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std-ranlib" && export LD=3D"/buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-wrs-li= nux-gnu/x86-linux2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std-ld" && export STRIP=3D"/buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-wrs= -linux-gnu/x86-linux2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std-strip" && export NM=3D"/buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-wrs-li= nux-gnu/x86-linux2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std-nm" ./configure --prefix=3D/buildarea1/lyang0/gcc/mygcc --with-local-prefix=3D/buildarea1/lyang0/gcc/mygcc -with-gmp=3D/buildarea1/lyang0/gcc/gmp --with-mpfr=3D/buildarea1/lyang0/gcc/mpfr --disable-multilib --host=3Dpowerpc-unknown-linux-gnu --build=3Dx86_64 --target=3Dpowerpc-elf --disable-multilib --disable-libgomp --enable-c99 --disable-nls --disable-libssp --disable-libmudflap --enable-languages=3Dc --enable-__cxa_atexit --enable-clocale=3Dgnu --enable-long-long --enable-shared make CROSS_COMPILE=3D/buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-w= rs-linux-gnu/x86-linux2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std- I met below error: ......... ......... /buildarea1/lyang0/fsl_p4080.tool/host-cross/powerpc-wrs-linux-gnu/x86-linu= x2/powerpc-wrs-linux-gnu-ppc_e500mc-glibc_std-gcc --sysroot=3D/buildarea1/lyang0/fsl_p4080.tool/export/sysroot/fsl_p4080-glib= c_std/sysroot -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -o cpp gcc.o opts-common.o gcc-options.o cppspec.o \ intl.o prefix.o version.o driver-rs6000.o ../libcpp/libcpp.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a powerpc-elf-gcc -dumpspecs > tmp-specs /bin/sh: powerpc-elf-gcc: command not found make[2]: *** [specs] Any help? Lei > If you want to build your toolchain from source on your PowerPC, then > there is nothing "cross" about your toolchain. =A0It is a less common > architecture than x86 but fully supported by several distributions. > In that case, you are not in the right place. > > Hope that makes sense and I hope I am correct. > David > > > On Sun, Apr 15, 2012 at 9:41 AM, lei yang wrote: >> Hello, >> >> I'm not sure this is the right place to ask this question,but I >> attempt to ask here >> >> I have a powerpc board running with linux. I want build some >> application *on this board* (not cross build) >> so I need a gcc can running on the board. I have a cross gcc named >> "powerpc-linux-gcc", >> How could I compiler a gcc that can run on the powerpc target,can >> someone give me a >> step? >> >> Lei >> >> -- >> For unsubscribe information see http://sourceware.org/lists.html#faq >> -- For unsubscribe information see http://sourceware.org/lists.html#faq