linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* help, build Cross GCC
@ 1999-10-28 13:00 Wang Yong
  1999-10-28 13:21 ` Andreas Tobler
  1999-10-28 15:15 ` Grant Erickson
  0 siblings, 2 replies; 7+ messages in thread
From: Wang Yong @ 1999-10-28 13:00 UTC (permalink / raw)
  To: linux-ce-devel; +Cc: linux-ppc, linuxppc embedded mail list


hi,
  i want to build a cross GCC to build program for PPC401 in my 586. I
have downloaded binutils-2.9.5.0.16 and gcc-2.95.2. when i build gcc,
i was told that as: unrecognized option `-ppc'. Do i miss something?
would you please show me how to build a cross GCC for PPC step by step?
thank you very much.

regards,
Wang

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: help, build Cross GCC
  1999-10-28 13:00 help, build Cross GCC Wang Yong
@ 1999-10-28 13:21 ` Andreas Tobler
  1999-10-28 16:25   ` Dan Malek
  1999-10-28 15:15 ` Grant Erickson
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Tobler @ 1999-10-28 13:21 UTC (permalink / raw)
  To: wung_y; +Cc: linux-ce-devel, linux-ppc, linuxppc embedded mail list




Wang Yong wrote:
> 
> hi,
>   i want to build a cross GCC to build program for PPC401 in my 586. I
> have downloaded binutils-2.9.5.0.16 and gcc-2.95.2. when i build gcc,
> i was told that as: unrecognized option `-ppc'. Do i miss something?
> would you please show me how to build a cross GCC for PPC step by step?
> thank you very much.
Try here:
http://members.home.com/mmporter/linux/cross/

Some infos you'll get on th egcs.cygnus.com site

Andreas
-- 
| Andreas Tobler				
| CH-8004 Zuerich 							
| E-Mail: andreas.tobler@alcatel.ch	| a.tobler@schweiz.ch
-----------------------------------------------------------

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: help, build Cross GCC
  1999-10-28 13:00 help, build Cross GCC Wang Yong
  1999-10-28 13:21 ` Andreas Tobler
@ 1999-10-28 15:15 ` Grant Erickson
  1 sibling, 0 replies; 7+ messages in thread
From: Grant Erickson @ 1999-10-28 15:15 UTC (permalink / raw)
  To: Wang Yong; +Cc: linux-ppc, linuxppc embedded mail list


On Thu, 28 Oct 1999, Wang Yong wrote:
> I want to build a cross GCC to build program for PPC401 in my 586. I
> have downloaded binutils-2.9.5.0.16 and gcc-2.95.2. when i build gcc,
> i was told that as: unrecognized option `-ppc'. Do i miss something?
> would you please show me how to build a cross GCC for PPC step by
> step? Thank you very much.

Wang,

This was posted to the list a few months back and should* be in the mail
archives. However, for those of you who missed it, here it is again. These
notes were drafted for EGCS and cross compiling from Solaris to Linux/PPC;
however, the steps are just as applicable to GCC 2.95.x and x86 to
Linux/PPC.

-----

    Building an EGCS PowerPC/Linux Cross Compiler For SPARC/Solaris

There are a number of resources on the Internet serving as a guide for
building a cross compiler. However, each addresses a particular version
of the compiler as well as a particular host/target combination; which
while generally useful as a base instruction set, doesn't cover the
intricacies of performing the feat for a different version and
host/target combination. This document attempts to document the process
of building an EGCS 1.1.2 cross compiler for PowerPC/Linux 2.2.10 on
SPARC/ Solaris 2.7 (aka Solaris 7, SunOS 5.7).

Conventions

In the instructions below, the following conventions are used:

              <archive dir> Location in which you store your
                            archive (i.e. *.tar.gz) files.

              <source dir>  Location in which you unpack your
                            archive files as various source
                            directories.

              <object dir>  Location in which you will build
                            object files from the source
                            dirctories located in
                            <source dir>. This may be the same
                            as <source dir>; however, that is
                            not recommended.

              <tool dir>    Location in which you will place
                            all of the built cross-compiler
                            tools and libraries.

              gmake         GNU version of make

              gtar          GNU version of tar

Instructions

Most of the following steps should work fine with default system tools.
However, the process for building tends to make a number of assumptions
about running with a GNU tool set, in particular, a native EGCS
compiler. That said, it may be useful (I certainly found it to be) to
have /usr/local/gnu/bin or an equivalent GNU tool set in your PATH
before your normal system tools (/usr/bin, /usr/xpg4/bin, /usr/ucb,
etc.). I used these tools:

Package   Version   Package   Version
=======   =======   =======   =======
autoconf    2.13    gzip       1.2.4a
automake    1.4	    id-utils    3.2  
bash        2.03    indent     1.10.0
binutils   2.9.1    less        340  
bison       1.28    libtool     1.3  
cpio       2.4.2    m4          1.4  
cvs        1.10.6   make        3.77 
diffutils   2.7	    patch       2.5  
ed          0.2	    rcs         5.7
egcs       1.1.2    readline    4.0  
enscript   1.6.1    regex       0.12 
fileutils   4.0	    sed         3.02 
findutils   4.1	    sh-utils    1.16 
flex       2.5.4a   sharutils   4.2  
gawk       3.0.4    tar         1.12 
gdb         4.18    termcap     1.3  
gdbm       1.8.0    termutils   2.0  
gettext     0.10    texinfo     3.12 
grep        2.3	    textutils   1.22 
groff      1.11a    time        1.7  
		    which       2.6  

It is also highly encouraged that all the below commands be run while
using bash (preferrably) or ksh as your shell. You will likely even have
better luck if you set the environment variable SHELL to bash or
ksh. All the subsequent examples will assume that this is the
case. Adjust accordingly if you are using csh, tcsh or some other shell.

Changing the optimization level of the compiler (e.g. -O3), either via
CFLAGS or by another means, is not recommened. Doing so will likely
result in either a failed build step in glibc or a broken
cross-compilation environment.

  1. Packages

     The following packages are required for this endeavor:

      Package              Version   Location

      binutils           2.9.1.0.25  Download

      egcs-core             1.1.2    Download

      egcs                  1.1.2    Download

      glibc                 2.1.1    Download

      glibc-crypt          2.0.111   Download

      glibc-linuxthreads    2.1.1    Download

      linux                2.2.10    Download

  2. Binutils

       1. Extract

            1. cd <source dir>
            2. gtar zxvf <archive dir>/binutils-2.9.1.0.25.tar.gz

       2. Build

            1. mkdir <tool dir>/host
            2. mkdir <tool dir>/host/sparc-sun-solaris
            3. mkdir <object dir>/binutils-2.9.1.0.25
            4. cd <object dir>/binutils-2.9.1.0.25
            5. <source dir>/binutils-2.9.1.0.25/configure
               --target=powerpc-linux
               --prefix=<tool dir>/host/sparc-sun-solaris
            6. gmake

       3. Install

            1. gmake install

       4. Access

          Subsequent build steps will need to use the tools created by
          this step. As such, the path to these tools will need to be 
          added to your environment's PATH variable:

            1. PATH=${PATH}":<tool dir>/host/sparc-sun-solaris/bin"
            2. export PATH

  3. Egcs (Core)

       1. Extract

            1. cd <source dir>
            2. gtar zxvf <archive dir>/egcs-core-1.1.2.tar.gz

       2. Build

            1. mkdir <object dir>/egcs-1.1.2
            2. cd <object dir>/egcs-1.1.2
            3. <source dir>/egcs-1.1.2/configure --target=powerpc-linux
               --prefix=<tool dir>/host/sparc-sun-solaris --with-newlib
            4. gmake

       3. Install

            1. gmake install

  4. Linux Headers

     The 2.2.10 kernel contains PowerPC support; however, it may not
     contain the absolute latest bleeding-edge changes to accomodate
     various PowerPC architectures. Such changes are maintained in the
     "vger" source tree. This is the code repository for the development
     work on non-x86 architectures.

       1. Extract

            1. cd <source dir>
            2. gtar zxvf <archive dir>/linux-2.2.10.tar.gz

          If you want to use the vger source instead of the 2.2.10 version
          source, do so.

            1. cd <source dir>
            2. set CVSROOT=":pserver:anonymous@cvs.on.openprojects.net:\
               /cvs/linux"
            3. export CVSROOT
            4. cvs login
            5. cvs -z 3 checkout -r linux_2_2 linux
            6. cvs logout

       2. Build

            1. cd <source dir>/linux
            2. Edit the Makefile
                 1. Comment out the existing "ARCH :=" line and add a new
                    line with "ARCH := ppc". line.
                 2. Find the "CROSS_COMPILE =" line and append
                    'powerpc-linux-' so that it reads "CROSS_COMPILE =
                    powerpc-linux-"

            3. If you have the GNU ncurses library installed, then "gmake
               menuconfig", otherwise "gmake config".
            4. gmake dep
            5. gmake clean
            6. gmake zImage

          The zImage build process does not have to complete successfully;
          only the headers are required.

       3. Verify

          Verify that the headers were created.

            1. find ./include/. -name "version.h"

          You should see output similar to: "./include/./linux/version.h".

          If you do not have the appropriate headers, use the "gmake
          distclean" command and repeat the steps for this section again.

  5. Glibc

       1. Link

            1. ln -sf <linux source dir>/include/asm
               <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/asm
            2. ln -sf <linux source dir>/include/linux
               <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/linux
            3. ls -la
               <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/asm/*
            4. ls -la
               <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/linux/*

       2. Extract

            1. cd <source dir>
            2. gtar zxvf <archive dir>/glibc-2.1.1.tar.gz
            3. cd <source dir>/glibc-2.1.1
            4. gtar zxvf <archive dir>/glibc-crypt-2.1.1.tar.gz
            5. gtar zxvf <archive dir>/glibc-linuxthreads-2.1.1.tar.gz

       3. Build

          First, Create a separate subdirectory, such as <tool dir>
          /target/powerpc-linux-gnu in which to install the glibc libraries.
          This will be the target of the --prefix configure switch.

          The configure script is quite specific about what versions (and
          flavors) of various build tools it requires. If it doesn't find
          what it's looking for, chance are that things won't build. Try to
          appease it.

            1. mkdir <tool dir>target
            2. mkdir <tool dir>target/powerpc-linux-gnu
            3. mkdir <object dir>/glibc-2.1.1
            4. cd <object dir>/glibc-2.1.1
            5. CC=powerpc-linux-gcc AR=powerpc-linux-ar
               RANLIB=powerpc-linux-ranlib
               <source dir>/glibc-2.1.1/configure --host=powerpc-linux
               --with-headers=<linux source dir>/include
               --enable-add-ons=crypt,linuxthreads
               --prefix=<tool dir>/target/powerpc-linux-gnu
            6. gmake

               There are a few likely pitfalls here. First, depending on
               which echo the make process finds (SVR4, BSD, GNU, shell
               built-in, etc.) there will be an error in csu/version-info.h
               if it picks the wrong one. Picking the wrong one results in
               '-n Version...' rather than the intended 'Version...' in
               csu/version-info.h.

               You will also probably notice in the csu/version-info.h file
               that it reports that it was compiled "on a Linux 5.7 system".
               I am not certain whether or not this should report "on a
               Solaris 2.7 system", on a "SunOS 5.7 system", or "on a Linux
               2.2.10 system". The first or second seem most reasonable. The
               choice you make here will in no may impact the success of
               your build.

            7. Edit and fix the csu/version-info.h file as necessary.
            8. gmake

               The second pitfall when building on a stock Solaris 2.7
               machine, is that there is a limit of 64 open file
               descriptors. This will result in an error building in the
               iconvdata/ subdirectory. This can be remedied by ratcheting
               up the limit to 1024:

            9. /usr/sbin/ulimit -n 1024
           10. gmake

          The overall build process should take several hours to complete,
          even on the brawniest of hardware.

       4. Install

            1. gmake install

               If your build process has completed successfully, the install
               process should go fairly smoothly. One tangle may occur when
               the install process attempts to run in the locale/ directory.
               There are either missing rules for, or the rules don't work
               quite correctly for, the i18n/locales/ and
               i18n/repertoiremaps/ targets.

               If you encounter this problem, to work around it, simply
               create the following directories yourself:

                 1. cd <tool dir>/target/powerpc-linux-gnu/share/
                 2. mkdir i18n
                 3. cd i18n
                 4. mkdir locales
                 5. mkdir repertoiremaps
                 6. cd <object dir>/glibc-2.1.1
                 7. gmake install

          The install process should take about 15 or so minutes, assuming
          that no errors are encountered.

  6. EGCS

     Provided that glibc compiled successfully, you are ready to go back 
     and rebuild the C compiler and, if you wish, build the Objective C, 
     C++ and F77 compilers.

       1. Extract

            1. cd <source dir>
            2. mv egcs-1.1.2 egcs-core-1.1.2
            3. gtar zxvf <archive dir>/egcs-1.1.2.tar.gz

       2. Build

            1. cd <object dir>
            2. mv egcs-1.1.2 egcs-core-1.1.2
            3. mkdir egcs-1.1.2
            4. cd egcs-1.1.2
            5. <source dir>/egcs-1.1.2/configure --target=powerpc-linux
               --prefix=<tool dir>/host/sparc-sun-solaris
               --with-headers=<tool dir>/target/powerpc-linux-gnu/include
               --with-libs=<tool dir>/target/powerpc-linux-gnu/lib
               --enable-shared --enable-languages="c,c++,f77"
            6. gmake

       3. Install

            1. gmake install

  7. Test

     user@ultraSPARC% pwd
     /home/user

     user@ultraSPARC% uname -a
     SunOS ultraSPARC 5.7 Generic sun4u sparc

     user@ultraSPARC% cat > hello.c
     #include <stdio.h>

     int main (void)
     {
             printf("Hello, %s!\n", argc >= 2 ? argv[1] : "world");

             return (0);
     }

     user@ultraSPARC% cat > hello.C
     #include <iostream.h>

     int main (void)
     {
             cout << "Hello, " << ((argc >= 2) ? argv[1] : "world") << "!" << endl;

             return (0);
     }

     user@ultraSPARC% cat > hello.f
             program hello

             print*,'Hello, world!'
             end

     user@ultraSPARC% ~/linuxppc/dev/bin/powerpc-linux-gcc -dumpmachine
     powerpc-linux

     user@ultraSPARC% ~/linuxppc/dev/bin/powerpc-linux-gcc -o helloc -s hello.c

     user@ultraSPARC% file helloc
     hello-c:        ELF 32-bit MSB executable PowerPC Version 1, dynamically linked, stripped

     user@ultraSPARC% ~/linuxppc/dev/bin/powerpc-linux-g++ -dumpmachine
     powerpc-linux

     user@ultraSPARC% ~/linuxppc/dev/bin/powerpc-linux-g++ -o helloC -s hello.C

     user@ultraSPARC% file helloC
     hello-c:        ELF 32-bit MSB executable PowerPC Version 1, dynamically linked, stripped

     user@ultraSPARC% ~/linuxppc/dev/bin/powerpc-linux-g77 -dumpmachine
     powerpc-linux

     user@ultraSPARC% ~/linuxppc/dev/bin/powerpc-linux-g77 -o hellof -s hello.f

     user@ultraSPARC% file hellof
     hello-c:        ELF 32-bit MSB executable PowerPC Version 1, dynamically linked, stripped

     user@ultraSPARC% ssh PowerMac

     user@PowerMac% pwd
     /home/user

     user@PowerMac% uname -a
     Linux PowerMac 2.2.6-15apmac #1 Mon May 31 03:54:09 EDT 1999 ppc unknown

     user@PowerMac% file helloc
     hello: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1, dynamically linked, stripped

     user@PowerMac% file helloC
     hello: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1, dynamically linked, stripped

     user@PowerMac% file hellof
     hello: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1, dynamically linked, stripped

     user@PowerMac% ldd ./helloc
             libc.so.6 => /lib/libc.so.6 (0x016be000)
             /lib/ld.so.1 => /lib/ld.so.1 (0x30000000)

     user@PowerMac% ldd ./helloC
             libstdc++.so.2.9 => /usr/lib/libstdc++.so.2.9 (0x0175b000)
             libm.so.6 => /lib/libm.so.6 (0x01783000)
             libc.so.6 => /lib/libc.so.6 (0x01641000)
             /lib/ld.so.1 => /lib/ld.so.1 (0x30000000)

     user@PowerMac% ldd ./hellof
             libm.so.6 => /lib/libm.so.6 (0x01783000)
             libc.so.6 => /lib/libc.so.6 (0x01641000)
             /lib/ld.so.1 => /lib/ld.so.1 (0x30000000)

     user@PowerMac% ./helloc
     Hello, world!

     user@PowerMac% ./helloC
     Hello, world!

     user@PowerMac% ./hellof
     Hello, world!

Parting Notes

Building all of the above requires a significant amount of space, on the
order of 150 MB for the powerpc-linux cross-development system hosted on
Sun Solaris 2.7. None of the above tools are stripped by default, so
doing so after installation will save an appreciable amount of space.

Useful Resources

   * http://egcs.cygnus.com/install/index.html
   * http://members.home.com/mmporter/cross.html
   * http://developer.intel.com/design/strong/applnots/sa1100lx/sa1100lx.htm
   * http://www.objsw.com/CrossGCC/


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: help, build Cross GCC
  1999-10-28 13:21 ` Andreas Tobler
@ 1999-10-28 16:25   ` Dan Malek
  1999-10-29  3:21     ` Wang Yong
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Malek @ 1999-10-28 16:25 UTC (permalink / raw)
  To: Andreas Tobler
  Cc: wung_y, linux-ce-devel, linux-ppc, linuxppc embedded mail list


Andreas Tobler wrote:


> Try here:
> http://members.home.com/mmporter/linux/cross/

I have binaries for RedHat 5.2 Linux/x86 on ppc.kernel.org in
the embedded directory.  It is a tar file called xppctools or
something like that.  These load into /opt, so they are easy
to remove if you want to do something else.  Just put the bin
directory in your search path.

I believe this was the last EGCS version before the GCC merge.
You will need to select your favorite libraries and include
files, as those are not included.  It will build the kernel
just fine.

It is something to get you started....


	-- Dan

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: help, build Cross GCC
  1999-10-28 16:25   ` Dan Malek
@ 1999-10-29  3:21     ` Wang Yong
  1999-10-29 13:03       ` Momchil Velikov
  0 siblings, 1 reply; 7+ messages in thread
From: Wang Yong @ 1999-10-29  3:21 UTC (permalink / raw)
  To: Dan Malek
  Cc: Andreas Tobler, linux-ce-devel, linux-ppc,
	linuxppc embedded mail list


hi, Dan:
i am now building a gcc for powerpc on i686. i have downloaded 
binutils-2.9.5.0.16 and gcc-2.95.2. i need the latest version of gcc
for i want to build program for powerpc403 and powerpc401.
and then, i first built binutils by these step:
1. decompress the binutils-2.9.5.0.16.tar to a temp directory.
2. chdir to that directory and run "./configure
--target=powerpc-linux-gnu"
3. run "make" and "make install"

after all these done, i build binutils to /usr/local/bin. 
next i begin to build gcc:
1. decompress the gcc-2.95.2 to another temp directory.
2. chdir to that directory and run "./configure
--target=powerpc-linux-gnu"
3. run "make" and "make install"

but this time, i failed. make told me it failed to find stdlib.h and
uinstd.h
when build libgcc2.a. then i tried to modify the Makefile and this line:
CFLAGS = -g -O2 -Dinhibit_libc

after run make, another error came out :-(
--------------------
checking for sys/time.h... yes
checking for sys/resource.h... yes
checking for sys/wait.h that is POSIX.1 compatible... no
checking whether the C compiler (/root/gcc-2.95.2/gcc/xgcc
-B/root/gcc-2.95.2/gcc/ -B/usr/local/powerpc-linux-gnu/bin/ -g -O2
-Dinho
configure: error: installation or configuration problem: C compiler
cannot create executables.
make[1]: Entering directory `/root/gcc-2.95.2/powerpc-linux-gnu/libio'
test x"no" != xyes ||\
  /root/gcc-2.95.2/gcc/xgcc -B/root/gcc-2.95.2/gcc/
-B/usr/local/powerpc-linux-gnu/bin/ -c -g -O2 -Dinhibit_libc -I. -I.
-D_IO_MTSAo
/root/gcc-2.95.2/gcc/xgcc -B/root/gcc-2.95.2/gcc/
-B/usr/local/powerpc-linux-gnu/bin/ -c -g -O2 -Dinhibit_libc -I. -I.
-D_IO_MTSAFEc
In file included from iogetline.c:26:
libioP.h:30: errno.h: No such file or directory
In file included from iolibio.h:1,
                 from libioP.h:47,
                 from iogetline.c:26:
libio.h:30: _G_config.h: No such file or directory
iogetline.c:27: string.h: No such file or directory
make[1]: *** [iogetline.o] Error 1
make[1]: Leaving directory `/root/gcc-2.95.2/powerpc-linux-gnu/libio'
make: *** [all-target-libio] Error 2
--------------------
somebody told me i must install lib and include file for the ppc first. 
but where to download them. 
do you think i still miss something.  would you please show me the right
step to build?

regards,
Wang



Dan Malek wrote:
> 
> Andreas Tobler wrote:
> 
> > Try here:
> > http://members.home.com/mmporter/linux/cross/
> 
> I have binaries for RedHat 5.2 Linux/x86 on ppc.kernel.org in
> the embedded directory.  It is a tar file called xppctools or
> something like that.  These load into /opt, so they are easy
> to remove if you want to do something else.  Just put the bin
> directory in your search path.
> 
> I believe this was the last EGCS version before the GCC merge.
> You will need to select your favorite libraries and include
> files, as those are not included.  It will build the kernel
> just fine.
> 
> It is something to get you started....
> 
>         -- Dan

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: help, build Cross GCC
  1999-10-29  3:21     ` Wang Yong
@ 1999-10-29 13:03       ` Momchil Velikov
  1999-10-30  1:48         ` Wang Yong
  0 siblings, 1 reply; 7+ messages in thread
From: Momchil Velikov @ 1999-10-29 13:03 UTC (permalink / raw)
  To: wung_y
  Cc: Dan Malek, Andreas Tobler, linux-ce-devel, linux-ppc,
	linuxppc embedded mail list


Wang Yong wrote:
> 
> hi, Dan:
> i am now building a gcc for powerpc on i686. i have downloaded
> binutils-2.9.5.0.16 and gcc-2.95.2. i need the latest version of gcc
> for i want to build program for powerpc403 and powerpc401.
> and then, i first built binutils by these step:
> 1. decompress the binutils-2.9.5.0.16.tar to a temp directory.
> 2. chdir to that directory and run "./configure
> --target=powerpc-linux-gnu"
> 3. run "make" and "make install"
> 
> after all these done, i build binutils to /usr/local/bin.
> next i begin to build gcc:
> 1. decompress the gcc-2.95.2 to another temp directory.
> 2. chdir to that directory and run "./configure
> --target=powerpc-linux-gnu"
> 3. run "make" and "make install"
> 
> but this time, i failed. make told me it failed to find stdlib.h and
> uinstd.h
> when build libgcc2.a. then i tried to modify the Makefile and this line:
> CFLAGS = -g -O2 -Dinhibit_libc
> 
> after run make, another error came out :-(
> --------------------
> checking for sys/time.h... yes
> checking for sys/resource.h... yes
> checking for sys/wait.h that is POSIX.1 compatible... no
> checking whether the C compiler (/root/gcc-2.95.2/gcc/xgcc
> -B/root/gcc-2.95.2/gcc/ -B/usr/local/powerpc-linux-gnu/bin/ -g -O2
> -Dinho
> configure: error: installation or configuration problem: C compiler
> cannot create executables.
> make[1]: Entering directory `/root/gcc-2.95.2/powerpc-linux-gnu/libio'
> test x"no" != xyes ||\
>   /root/gcc-2.95.2/gcc/xgcc -B/root/gcc-2.95.2/gcc/
> -B/usr/local/powerpc-linux-gnu/bin/ -c -g -O2 -Dinhibit_libc -I. -I.
> -D_IO_MTSAo
> /root/gcc-2.95.2/gcc/xgcc -B/root/gcc-2.95.2/gcc/
> -B/usr/local/powerpc-linux-gnu/bin/ -c -g -O2 -Dinhibit_libc -I. -I.
> -D_IO_MTSAFEc
> In file included from iogetline.c:26:
> libioP.h:30: errno.h: No such file or directory
> In file included from iolibio.h:1,
>                  from libioP.h:47,
>                  from iogetline.c:26:
> libio.h:30: _G_config.h: No such file or directory
> iogetline.c:27: string.h: No such file or directory
> make[1]: *** [iogetline.o] Error 1
> make[1]: Leaving directory `/root/gcc-2.95.2/powerpc-linux-gnu/libio'
> make: *** [all-target-libio] Error 2
> --------------------
> somebody told me i must install lib and include file for the ppc first.
> but where to download them.
> do you think i still miss something.  would you please show me the right
> step to build?

I built a cross-dev environment sometime ago. Here's what I did:

0. got glibc-?.tar.gz from the usual places
   get binutils-?.tar.gz
   get egcs-?.tar.gz

1. Built and installed binutils

2. Began with the egcs
   configure --prefix=/usr/local                   \
             --build=i686-pc-linux-gnu             \
             --host=i686-pc-linux-gnu              \
             --target=powerpc-unknown-linux-gnu
   make LANGUAGES=c
   make -k
/* make fails, trying to build libgcc.a */

   make -k LANGUAGES=c install
/* now we have a compiler, which compiles. We can't link yet, so
 * we can't create shared libs or executables, but we _can_ create
 * static glibc
 */

3. Began with glibc
   configure --prefix=/usr/local                 \
             --build=i686-pc-linux-gnu           \
             --host=powerpc-unknown-linux-gnu    \
             --enable-add-ons=crypt,linuxthreads \
             --disable-profile

   make -k
/* build fails when trying to link some execitables
 * and some shared libs 
 */

   make -k install install_root=whatever
/* now we have enough headers and static librararies to complete
 * the build of gcc 
 */

4. Back to egcs
   make
   make install
/* no errors at this point, now we have complete gcc */

5. Back to glibc
   make
   make install install_root=whatever
/* no errors anymore */

That's all. Don't rely on the exact parameters to configure,
I got them from memory.

Regards,
-velco

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: help, build Cross GCC
  1999-10-29 13:03       ` Momchil Velikov
@ 1999-10-30  1:48         ` Wang Yong
  0 siblings, 0 replies; 7+ messages in thread
From: Wang Yong @ 1999-10-30  1:48 UTC (permalink / raw)
  To: Momchil Velikov; +Cc: linux-ce-devel, linuxppc embedded mail list, linux-ppc


thank you sir, i have got xgcc. but now the problem is glibc. it seems
glibc2.0 still support PPC. GNU say glibc for ppc is still under
development.
how about libc?

Momchil Velikov wrote:
> 
> I built a cross-dev environment sometime ago. Here's what I did:
> 
> 0. got glibc-?.tar.gz from the usual places
>    get binutils-?.tar.gz
>    get egcs-?.tar.gz
> 
> 1. Built and installed binutils
> 
> 2. Began with the egcs
>    configure --prefix=/usr/local                   \
>              --build=i686-pc-linux-gnu             \
>              --host=i686-pc-linux-gnu              \
>              --target=powerpc-unknown-linux-gnu
>    make LANGUAGES=c
>    make -k
> /* make fails, trying to build libgcc.a */
> 
>    make -k LANGUAGES=c install
> /* now we have a compiler, which compiles. We can't link yet, so
>  * we can't create shared libs or executables, but we _can_ create
>  * static glibc
>  */
> 
> 3. Began with glibc
>    configure --prefix=/usr/local                 \
>              --build=i686-pc-linux-gnu           \
>              --host=powerpc-unknown-linux-gnu    \
>              --enable-add-ons=crypt,linuxthreads \
>              --disable-profile
> 
>    make -k
> /* build fails when trying to link some execitables
>  * and some shared libs
>  */
> 
>    make -k install install_root=whatever
> /* now we have enough headers and static librararies to complete
>  * the build of gcc
>  */
> 
> 4. Back to egcs
>    make
>    make install
> /* no errors at this point, now we have complete gcc */
> 
> 5. Back to glibc
>    make
>    make install install_root=whatever
> /* no errors anymore */
> 
> That's all. Don't rely on the exact parameters to configure,
> I got them from memory.
> 
> Regards,
> -velco

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1999-10-30  1:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-10-28 13:00 help, build Cross GCC Wang Yong
1999-10-28 13:21 ` Andreas Tobler
1999-10-28 16:25   ` Dan Malek
1999-10-29  3:21     ` Wang Yong
1999-10-29 13:03       ` Momchil Velikov
1999-10-30  1:48         ` Wang Yong
1999-10-28 15:15 ` Grant Erickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).