GCC cross compiler build troubles ...

GCC cross compiler build troubles ...

Post by Jim » Sun, 12 Jan 2003 04:50:01



Hi,

I am current having problems building gcc with glibc ... it seems to die
not being able to find a bunch of header files ... any tips?

So far I have succesfully:
1.) build bootstrapped gcc with glibc
2.) build embedded kernel & bootloader (ran kernel)

I use three scripts for compiling gcc (see below) ...

1.) build-gccBOOTSTRAP
2.) build-glibc
3.) build-gccWITH_GLBIC

I will don't need a full blown gcc until i write some C++ code ... but i
will evetually need it ...

Thanks,
Jim
Ottawa,Canada

-----------------------------------------------------------------------------
1.) build-gccBOOTSTRAP
-----------------------------------------------------------------------------

#!/bin/bash
#-------------------------------------------------------------
# This bash script creates a linux x866 gcc cross compiler
# for powerpc. This file has been tested with the following
# modules:
#    1.) binutils-2.13.90.0.2.tar.gz
#    2.) gcc-3.2.tar.gz
#    3.) newlib-synSept12-2002.tar.gz
#-------------------------------------------------------------

# Defining target
TARGET=powerpc-linux

# Defining prefix - final toolchain location
PREFIX=$HOME/ppcgcc

# PATH must updated
PATH=$PREFIX/bin:$PATH
export PATH

# My local includes
INCLUDE=/usr/include/

# Configuring packages versions
GCC_VER=2.95.3
BINUTILS_VER=2.13.90.0.2
NEWLIB_VER=1.10.0

echo ===================================================
echo BUILDING BINUTILS FOR $TARGET
echo ===================================================
# binutils
rm -rf binutils-$BINUTILS_VER binutils
tar zxvf binutils-$BINUTILS_VER.tar.gz
mkdir binutils
cd binutils
../binutils-$BINUTILS_VER/configure --target=$TARGET --prefix=$PREFIX
make all
make install
cd ..

echo ===================================================
echo BUILDING GCC FOR $TARGET
echo ===================================================

echo extract GCC source from tar ball ...
rm -rf gcc-$GCC_VER gcc
tar zxvf gcc-core-$GCC_VER.tar.gz
tar zxvf gcc-g++-$GCC_VER.tar.gz

echo extract newlib source from tar ball- needed for gcc ...
rm -rf  newlib-$NEWLIB_VER newlib
tar zxvf newlib-$NEWLIB_VER.tar.gz

echo set up symbolic links to newlib in gcc dir
cd  gcc-$GCC_VER
ln -s ../newlib-$NEWLIB_VER/newlib newlib
ln -s ../newlib-$NEWLIB_VER/libgloss libgloss
cd ..

echo build gcc ...
mkdir gcc
cd gcc
../gcc-$GCC_VER/configure --target=$TARGET --with-newlib
--prefix=$PREFIX --with-gnu-as --with-gnu-ld --with-headers=$INCLUDE
make all
make install
cd ..

echo ===================================================
echo BUILDING NEWLIB FOR $TARGET
echo ===================================================
# newlib
mkdir newlib
cd newlib
../newlib-$NEWLIB_VER/configure --target=$TARGET --prefix=$PREFIX --nfp
make all
make install
cd ..

-----------------------------------------------------------------------------
2.) build-glibc
-----------------------------------------------------------------------------
#!/bin/bash

#-------------------------------------------------------------
# This file builds glibc and recompiles gcc to link it to gcc
#
# This bash script creates a linux x866 gcc cross compiler
# for powerpc. This file has been tested with the following
# modules:
#    1.) binutils-2.13.90.0.2.tar.gz
#    2.) gcc-3.2.tar.gz
#    3.) newlib-synSept12-2002.tar.gz
#-------------------------------------------------------------

# Defining target
TARGET=powerpc-linux

# Defining prefix - final toolchain location
PREFIX=$HOME/ppcgcc

# PATH must updated
PATH=$PREFIX/bin:$PATH
export PATH

# My local includes
INCLUDE=/usr/include/

# Configuring packages versions
GCC_VER=2.95.3
BINUTILS_VER=2.13.90.0.2
NEWLIB_VER=1.10.0

#Define where kernel source is
KERNEL_SOURCE=$HOME/ppclinux

#These are the glibc files I am using ...
#   glibc-linuxthreads-2.3.1.tar.gz
#   glibc-2.3.1.tar.gz
GLIBC_THREADS_VER=2.2.3
GLIBC_VER=2.2.3

#
#Where we want to install compiled glibc
#
INSTALL_DIR=$HOME/powerpc-linux-gcc-glibc/

echo ===================================================
echo BUILDING GLIBC FOR $TARGET
echo ===================================================
ln -sf $KERNEL_SOURCE/include/asm $INSTALL_DIR/include/asm
ln -sf $KERNEL_SOURCE/include/linux $INSTALL_DIR/include/linux
tar zxfv glibc-$GLIBC_VER.tar.gz
cd glibc-$GLIBC_VER
tar zxfv ../glibc-linuxthreads-$GLIBC_THREADS_VER.tar.gz
CC=powerpc-linux-gcc AR=powerpc-linux-ar RANLIB=powerpc-linux-ranlib
./configure --host=powerpc-linux --enable-add-ons
--with-headers=$INSTALL_DIR/include --prefix=
make
make install_root=$INSTALL_DIR install

-----------------------------------------------------------------------------
3.) build-gccWITH_GLBIC
-----------------------------------------------------------------------------
#!/bin/bash

#-------------------------------------------------------------
# This file builds glibc and recompiles gcc to link it to gcc
#
# This bash script creates a linux x866 gcc cross compiler
# for powerpc. This file has been tested with the following
# modules:
#    1.) binutils-2.13.90.0.2.tar.gz
#    2.) gcc-3.2.tar.gz
#    3.) newlib-synSept12-2002.tar.gz
#-------------------------------------------------------------

# Defining target
TARGET=powerpc-linux

# Defining prefix - final toolchain location
PREFIX=$HOME/ppcgcc

# PATH must updated
PATH=$PREFIX/bin:$PATH
export PATH

# My local includes
#INCLUDE=/usr/include/
INCLUDE=$HOME/powerpc-linux-gcc-glibc/include

# Configuring packages versions
GCC_VER=2.95.3
BINUTILS_VER=2.13.90.0.2
NEWLIB_VER=1.10.0

#Define where kernel source is
KERNEL_SOURCE=$HOME/ppclinux

#These are the glibc files I am using ...
#   glibc-linuxthreads-2.3.1.tar.gz
#   glibc-2.3.1.tar.gz
GLIBC_THREADS_VER=2.2.3
GLIBC_VER=2.2.3

#
#Where we want to install compiled glibc
#
INSTALL_DIR=$HOME/powerpc-linux-gcc-glibc/

# These are the instructions to build glibc from penguinppc.org ...
#
#You must first follow the kernel instructions, but you may omit the
make zImage portion
#      ln -sf <top of Linux kernel tree>/include/asm
/usr/powerpc-linux/include/asm
#      ln -sf <top of Linux kernel tree>/include/linux
/usr/powerpc-linux/include/linux
#      tar zxf glibc-x.x.x.tar.gz
#      cd glibc-x.x.x
#      tar zxf ../glibc-linuxthreads-x.x.x.tar.gz
#      CC=powerpc-linux-gcc
#      AR=powerpc-linux-ar
#      RANLIB=powerpc-linux-ranlib
#      ./configure --host=powerpc-linux --enable-add-ons
--with-headers=/usr/local/powerpc-linux/include --prefix=
#      make
#DANGER: You WILL*up your system if you forget the install_root
part of the next command.
#      make install_root=/usr/local/powerpc-linux install

echo ===================================================
echo BUILDING GLIBC FOR $TARGET
echo ===================================================
#ln -sf $KERNEL_SOURCE/include/asm $INSTALL_DIR/include/asm

#ln -sf $KERNEL_SOURCE/include/linux $INSTALL_DIR/include/linux

#tar zxfv glibc-$GLIBC_VER.tar.gz

#cd glibc-$GLIBC_VER

#tar zxfv ../glibc-linuxthreads-$GLIBC_THREADS_VER.tar.gz

#CC=powerpc-linux-gcc AR=powerpc-linux-ar RANLIB=powerpc-linux-ranlib
./configure --host=powerpc-linux --enable-add-ons
--with-headers=$INSTALL_DIR/include --prefix=

#make

#make install_root=$INSTALL_DIR install

echo ===================================================
echo BUILDING GCC WITH GLIBC FOR $TARGET
echo ===================================================
cd $PREFIX
rm -rf gcc-$GCC_VER gcc-glibc
tar zxvf gcc-core-$GCC_VER.tar.gz
tar zxvf gcc-g++-$GCC_VER.tar.gz

#To rebuild gcc using glibc instead of newlib for the library:
mkdir gcc-glibc
cd gcc-glibc
#../gcc-$GCC_VER/configure --target=powerpc-linux --enable-shared
--enable-threads
../gcc-$GCC_VER/configure --target=$TARGET --prefix=$PREFIX
--enable-shared --enable-threads --with-gnu-as --with-gnu-ld
--with-headers=$INCLUDE
make
make install
cd ..

echo ===================================================
echo FINISHED BUILDING GCC WITH GLIBC FOR $TARGET
echo ===================================================

 
 
 

GCC cross compiler build troubles ...

Post by Jim » Sun, 12 Jan 2003 05:35:09


Sorry here is my actual error ... its problems compiling headers not
finding ...

In file included from gthr-default.h:1,
                  from ../../gcc-2.95.3/gcc/gthr.h:98,
                  from ../../gcc-2.95.3/gcc/libgcc2.c:3034:
../../gcc-2.95.3/gcc/gthr-posix.h:39: parse error before `__gthread_key_t'
../../gcc-2.95.3/gcc/gthr-posix.h:39: warning: data definition has no
type or storage class
../../gcc-2.95.3/gcc/gthr-posix.h:40: parse error before `__gthread_once_t'
../../gcc-2.95.3/gcc/gthr-posix.h:40: warning: data definition has no
type or storage class
../../gcc-2.95.3/gcc/gthr-posix.h:41: parse error before `__gthread_mutex_t'
../../gcc-2.95.3/gcc/gthr-posix.h:41: warning: data definition has no
type or storage class
../../gcc-2.95.3/gcc/gthr-posix.h:59: `pthread_create' undeclared here
(not in a function)
../../gcc-2.95.3/gcc/gthr-posix.h:78: parse error before `*'
../../gcc-2.95.3/gcc/gthr-posix.h:78: parse error before `)'
../../gcc-2.95.3/gcc/gthr-posix.h:87: parse error before `*'
../../gcc-2.95.3/gcc/gthr-posix.h:87: parse error before `)'
../../gcc-2.95.3/gcc/gthr-posix.h:93: parse error before `key'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_key_dtor':
../../gcc-2.95.3/gcc/gthr-posix.h:96: `ptr' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h:96: (Each undeclared identifier is
reported only once
../../gcc-2.95.3/gcc/gthr-posix.h:96: for each function it appears in.)
../../gcc-2.95.3/gcc/gthr-posix.h:97: `key' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:103: parse error before `key'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_key_delete':
../../gcc-2.95.3/gcc/gthr-posix.h:105: `key' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:109: parse error before `key'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_getspecific':
../../gcc-2.95.3/gcc/gthr-posix.h:111: `key' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h:111: warning: return makes pointer
from integer without a cast
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:115: parse error before `key'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_setspecific':
../../gcc-2.95.3/gcc/gthr-posix.h:117: `key' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h:117: `ptr' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:121: parse error before `*'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_mutex_lock':
../../gcc-2.95.3/gcc/gthr-posix.h:124: `mutex' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:130: parse error before `*'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_mutex_trylock':
../../gcc-2.95.3/gcc/gthr-posix.h:133: `mutex' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:139: parse error before `*'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_mutex_unlock':
../../gcc-2.95.3/gcc/gthr-posix.h:142: `mutex' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/libgcc2.c: At top level:
../../gcc-2.95.3/gcc/libgcc2.c:3109: parse error before `eh_context_key'
../../gcc-2.95.3/gcc/libgcc2.c:3109: warning: data definition has no
type or storage class
../../gcc-2.95.3/gcc/libgcc2.c: In function `eh_context_initialize':
../../gcc-2.95.3/gcc/libgcc2.c:3171: syntax error before `once'
../../gcc-2.95.3/gcc/libgcc2.c:3175: `once' undeclared (first use in
this function)
make[3]: *** [libgcc2.a] Error 1
make[3]: Leaving directory `/home/jgdon/ppcgcc/gcc-glibc/gcc'
make[2]: *** [stmp-multilib-sub] Error 2
make[2]: Leaving directory `/home/jgdon/ppcgcc/gcc-glibc/gcc'
make[1]: *** [stmp-multilib] Error 1
make[1]: Leaving directory `/home/jgdon/ppcgcc/gcc-glibc/gcc'
make: *** [install-gcc] Error 2

Jim wrote:
> Hi,

> I am current having problems building gcc with glibc ... it seems to die
> not being able to find a bunch of header files ... any tips?

> So far I have succesfully:
> 1.) build bootstrapped gcc with glibc
> 2.) build embedded kernel & bootloader (ran kernel)

> I use three scripts for compiling gcc (see below) ...

> 1.) build-gccBOOTSTRAP
> 2.) build-glibc
> 3.) build-gccWITH_GLBIC

> I will don't need a full blown gcc until i write some C++ code ... but i
> will evetually need it ...

> Thanks,
> Jim
> Ottawa,Canada

> -----------------------------------------------------------------------------

> 1.) build-gccBOOTSTRAP
> -----------------------------------------------------------------------------

> #!/bin/bash
> #-------------------------------------------------------------
> # This bash script creates a linux x866 gcc cross compiler
> # for powerpc. This file has been tested with the following
> # modules:
> #    1.) binutils-2.13.90.0.2.tar.gz
> #    2.) gcc-3.2.tar.gz
> #    3.) newlib-synSept12-2002.tar.gz
> #-------------------------------------------------------------

> # Defining target
> TARGET=powerpc-linux

> # Defining prefix - final toolchain location
> PREFIX=$HOME/ppcgcc

> # PATH must updated
> PATH=$PREFIX/bin:$PATH
> export PATH

> # My local includes
> INCLUDE=/usr/include/

> # Configuring packages versions
> GCC_VER=2.95.3
> BINUTILS_VER=2.13.90.0.2
> NEWLIB_VER=1.10.0

> echo ===================================================
> echo BUILDING BINUTILS FOR $TARGET
> echo ===================================================
> # binutils
> rm -rf binutils-$BINUTILS_VER binutils
> tar zxvf binutils-$BINUTILS_VER.tar.gz
> mkdir binutils
> cd binutils
> ../binutils-$BINUTILS_VER/configure --target=$TARGET --prefix=$PREFIX
> make all
> make install
> cd ..

> echo ===================================================
> echo BUILDING GCC FOR $TARGET
> echo ===================================================

> echo extract GCC source from tar ball ...
> rm -rf gcc-$GCC_VER gcc
> tar zxvf gcc-core-$GCC_VER.tar.gz
> tar zxvf gcc-g++-$GCC_VER.tar.gz

> echo extract newlib source from tar ball- needed for gcc ...
> rm -rf  newlib-$NEWLIB_VER newlib
> tar zxvf newlib-$NEWLIB_VER.tar.gz

> echo set up symbolic links to newlib in gcc dir
> cd  gcc-$GCC_VER
> ln -s ../newlib-$NEWLIB_VER/newlib newlib
> ln -s ../newlib-$NEWLIB_VER/libgloss libgloss
> cd ..

> echo build gcc ...
> mkdir gcc
> cd gcc
> ../gcc-$GCC_VER/configure --target=$TARGET --with-newlib
> --prefix=$PREFIX --with-gnu-as --with-gnu-ld --with-headers=$INCLUDE
> make all
> make install
> cd ..

> echo ===================================================
> echo BUILDING NEWLIB FOR $TARGET
> echo ===================================================
> # newlib
> mkdir newlib
> cd newlib
> ../newlib-$NEWLIB_VER/configure --target=$TARGET --prefix=$PREFIX --nfp
> make all
> make install
> cd ..

> -----------------------------------------------------------------------------

> 2.) build-glibc
> -----------------------------------------------------------------------------

> #!/bin/bash

> #-------------------------------------------------------------
> # This file builds glibc and recompiles gcc to link it to gcc
> #
> # This bash script creates a linux x866 gcc cross compiler
> # for powerpc. This file has been tested with the following
> # modules:
> #    1.) binutils-2.13.90.0.2.tar.gz
> #    2.) gcc-3.2.tar.gz
> #    3.) newlib-synSept12-2002.tar.gz
> #-------------------------------------------------------------

> # Defining target
> TARGET=powerpc-linux

> # Defining prefix - final toolchain location
> PREFIX=$HOME/ppcgcc

> # PATH must updated
> PATH=$PREFIX/bin:$PATH
> export PATH

> # My local includes
> INCLUDE=/usr/include/

> # Configuring packages versions
> GCC_VER=2.95.3
> BINUTILS_VER=2.13.90.0.2
> NEWLIB_VER=1.10.0

> #Define where kernel source is
> KERNEL_SOURCE=$HOME/ppclinux

> #These are the glibc files I am using ...
> #   glibc-linuxthreads-2.3.1.tar.gz
> #   glibc-2.3.1.tar.gz
> GLIBC_THREADS_VER=2.2.3
> GLIBC_VER=2.2.3

> #
> #Where we want to install compiled glibc
> #
> INSTALL_DIR=$HOME/powerpc-linux-gcc-glibc/

> echo ===================================================
> echo BUILDING GLIBC FOR $TARGET
> echo ===================================================
> ln -sf $KERNEL_SOURCE/include/asm $INSTALL_DIR/include/asm
> ln -sf $KERNEL_SOURCE/include/linux $INSTALL_DIR/include/linux
> tar zxfv glibc-$GLIBC_VER.tar.gz
> cd glibc-$GLIBC_VER
> tar zxfv ../glibc-linuxthreads-$GLIBC_THREADS_VER.tar.gz
> CC=powerpc-linux-gcc AR=powerpc-linux-ar RANLIB=powerpc-linux-ranlib
> ./configure --host=powerpc-linux --enable-add-ons
> --with-headers=$INSTALL_DIR/include --prefix=
> make
> make install_root=$INSTALL_DIR install

> -----------------------------------------------------------------------------

> 3.) build-gccWITH_GLBIC
> -----------------------------------------------------------------------------

> #!/bin/bash

> #-------------------------------------------------------------
> # This file builds glibc and recompiles gcc to link it to gcc
> #
> # This bash script creates a linux x866 gcc cross compiler
> # for powerpc. This file has been tested with the following
> # modules:
> #    1.) binutils-2.13.90.0.2.tar.gz
> #    2.) gcc-3.2.tar.gz
> #    3.) newlib-synSept12-2002.tar.gz
> #-------------------------------------------------------------

> # Defining target
> TARGET=powerpc-linux

> # Defining prefix - final toolchain location
> PREFIX=$HOME/ppcgcc

> # PATH must updated
> PATH=$PREFIX/bin:$PATH
> export PATH

> # My local includes
> #INCLUDE=/usr/include/

...

read more »

 
 
 

GCC cross compiler build troubles ...

Post by Jim » Sun, 12 Jan 2003 05:38:06


orry here is my actual error ... its problems compiling headers not
finding ...

In file included from gthr-default.h:1,
                  from ../../gcc-2.95.3/gcc/gthr.h:98,
                  from ../../gcc-2.95.3/gcc/libgcc2.c:3034:
../../gcc-2.95.3/gcc/gthr-posix.h:39: parse error before `__gthread_key_t'
../../gcc-2.95.3/gcc/gthr-posix.h:39: warning: data definition has no
type or storage class
../../gcc-2.95.3/gcc/gthr-posix.h:40: parse error before `__gthread_once_t'
../../gcc-2.95.3/gcc/gthr-posix.h:40: warning: data definition has no
type or storage class
../../gcc-2.95.3/gcc/gthr-posix.h:41: parse error before `__gthread_mutex_t'
../../gcc-2.95.3/gcc/gthr-posix.h:41: warning: data definition has no
type or storage class
../../gcc-2.95.3/gcc/gthr-posix.h:59: `pthread_create' undeclared here
(not in a function)
../../gcc-2.95.3/gcc/gthr-posix.h:78: parse error before `*'
../../gcc-2.95.3/gcc/gthr-posix.h:78: parse error before `)'
../../gcc-2.95.3/gcc/gthr-posix.h:87: parse error before `*'
../../gcc-2.95.3/gcc/gthr-posix.h:87: parse error before `)'
../../gcc-2.95.3/gcc/gthr-posix.h:93: parse error before `key'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_key_dtor':
../../gcc-2.95.3/gcc/gthr-posix.h:96: `ptr' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h:96: (Each undeclared identifier is
reported only once
../../gcc-2.95.3/gcc/gthr-posix.h:96: for each function it appears in.)
../../gcc-2.95.3/gcc/gthr-posix.h:97: `key' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:103: parse error before `key'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_key_delete':
../../gcc-2.95.3/gcc/gthr-posix.h:105: `key' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:109: parse error before `key'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_getspecific':
../../gcc-2.95.3/gcc/gthr-posix.h:111: `key' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h:111: warning: return makes pointer
from integer without a cast
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:115: parse error before `key'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_setspecific':
../../gcc-2.95.3/gcc/gthr-posix.h:117: `key' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h:117: `ptr' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:121: parse error before `*'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_mutex_lock':
../../gcc-2.95.3/gcc/gthr-posix.h:124: `mutex' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:130: parse error before `*'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_mutex_trylock':
../../gcc-2.95.3/gcc/gthr-posix.h:133: `mutex' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/gthr-posix.h: At top level:
../../gcc-2.95.3/gcc/gthr-posix.h:139: parse error before `*'
../../gcc-2.95.3/gcc/gthr-posix.h: In function `__gthread_mutex_unlock':
../../gcc-2.95.3/gcc/gthr-posix.h:142: `mutex' undeclared (first use in
this function)
../../gcc-2.95.3/gcc/libgcc2.c: At top level:
../../gcc-2.95.3/gcc/libgcc2.c:3109: parse error before `eh_context_key'
../../gcc-2.95.3/gcc/libgcc2.c:3109: warning: data definition has no
type or storage class
../../gcc-2.95.3/gcc/libgcc2.c: In function `eh_context_initialize':
../../gcc-2.95.3/gcc/libgcc2.c:3171: syntax error before `once'
../../gcc-2.95.3/gcc/libgcc2.c:3175: `once' undeclared (first use in
this function)
make[3]: *** [libgcc2.a] Error 1
make[3]: Leaving directory `/home/jgdon/ppcgcc/gcc-glibc/gcc'
make[2]: *** [stmp-multilib-sub] Error 2
make[2]: Leaving directory `/home/jgdon/ppcgcc/gcc-glibc/gcc'
make[1]: *** [stmp-multilib] Error 1
make[1]: Leaving directory `/home/jgdon/ppcgcc/gcc-glibc/gcc'
make: *** [install-gcc] Error 2

Jim wrote:
> Hi,

> I am current having problems building gcc with glibc ... it seems to die
> not being able to find a bunch of header files ... any tips?

> So far I have succesfully:
> 1.) build bootstrapped gcc with glibc
> 2.) build embedded kernel & bootloader (ran kernel)

> I use three scripts for compiling gcc (see below) ...

> 1.) build-gccBOOTSTRAP
> 2.) build-glibc
> 3.) build-gccWITH_GLBIC

> I will don't need a full blown gcc until i write some C++ code ... but i
> will evetually need it ...

> Thanks,
> Jim
> Ottawa,Canada

> -----------------------------------------------------------------------------

> 1.) build-gccBOOTSTRAP
> -----------------------------------------------------------------------------

> #!/bin/bash
> #-------------------------------------------------------------
> # This bash script creates a linux x866 gcc cross compiler
> # for powerpc. This file has been tested with the following
> # modules:
> #    1.) binutils-2.13.90.0.2.tar.gz
> #    2.) gcc-3.2.tar.gz
> #    3.) newlib-synSept12-2002.tar.gz
> #-------------------------------------------------------------

> # Defining target
> TARGET=powerpc-linux

> # Defining prefix - final toolchain location
> PREFIX=$HOME/ppcgcc

> # PATH must updated
> PATH=$PREFIX/bin:$PATH
> export PATH

> # My local includes
> INCLUDE=/usr/include/

> # Configuring packages versions
> GCC_VER=2.95.3
> BINUTILS_VER=2.13.90.0.2
> NEWLIB_VER=1.10.0

> echo ===================================================
> echo BUILDING BINUTILS FOR $TARGET
> echo ===================================================
> # binutils
> rm -rf binutils-$BINUTILS_VER binutils
> tar zxvf binutils-$BINUTILS_VER.tar.gz
> mkdir binutils
> cd binutils
> ../binutils-$BINUTILS_VER/configure --target=$TARGET --prefix=$PREFIX
> make all
> make install
> cd ..

> echo ===================================================
> echo BUILDING GCC FOR $TARGET
> echo ===================================================

> echo extract GCC source from tar ball ...
> rm -rf gcc-$GCC_VER gcc
> tar zxvf gcc-core-$GCC_VER.tar.gz
> tar zxvf gcc-g++-$GCC_VER.tar.gz

> echo extract newlib source from tar ball- needed for gcc ...
> rm -rf  newlib-$NEWLIB_VER newlib
> tar zxvf newlib-$NEWLIB_VER.tar.gz

> echo set up symbolic links to newlib in gcc dir
> cd  gcc-$GCC_VER
> ln -s ../newlib-$NEWLIB_VER/newlib newlib
> ln -s ../newlib-$NEWLIB_VER/libgloss libgloss
> cd ..

> echo build gcc ...
> mkdir gcc
> cd gcc
> ../gcc-$GCC_VER/configure --target=$TARGET --with-newlib
> --prefix=$PREFIX --with-gnu-as --with-gnu-ld --with-headers=$INCLUDE
> make all
> make install
> cd ..

> echo ===================================================
> echo BUILDING NEWLIB FOR $TARGET
> echo ===================================================
> # newlib
> mkdir newlib
> cd newlib
> ../newlib-$NEWLIB_VER/configure --target=$TARGET --prefix=$PREFIX --nfp
> make all
> make install
> cd ..

> -----------------------------------------------------------------------------

> 2.) build-glibc
> -----------------------------------------------------------------------------

> #!/bin/bash

> #-------------------------------------------------------------
> # This file builds glibc and recompiles gcc to link it to gcc
> #
> # This bash script creates a linux x866 gcc cross compiler
> # for powerpc. This file has been tested with the following
> # modules:
> #    1.) binutils-2.13.90.0.2.tar.gz
> #    2.) gcc-3.2.tar.gz
> #    3.) newlib-synSept12-2002.tar.gz
> #-------------------------------------------------------------

> # Defining target
> TARGET=powerpc-linux

> # Defining prefix - final toolchain location
> PREFIX=$HOME/ppcgcc

> # PATH must updated
> PATH=$PREFIX/bin:$PATH
> export PATH

> # My local includes
> INCLUDE=/usr/include/

> # Configuring packages versions
> GCC_VER=2.95.3
> BINUTILS_VER=2.13.90.0.2
> NEWLIB_VER=1.10.0

> #Define where kernel source is
> KERNEL_SOURCE=$HOME/ppclinux

> #These are the glibc files I am using ...
> #   glibc-linuxthreads-2.3.1.tar.gz
> #   glibc-2.3.1.tar.gz
> GLIBC_THREADS_VER=2.2.3
> GLIBC_VER=2.2.3

> #
> #Where we want to install compiled glibc
> #
> INSTALL_DIR=$HOME/powerpc-linux-gcc-glibc/

> echo ===================================================
> echo BUILDING GLIBC FOR $TARGET
> echo ===================================================
> ln -sf $KERNEL_SOURCE/include/asm $INSTALL_DIR/include/asm
> ln -sf $KERNEL_SOURCE/include/linux $INSTALL_DIR/include/linux
> tar zxfv glibc-$GLIBC_VER.tar.gz
> cd glibc-$GLIBC_VER
> tar zxfv ../glibc-linuxthreads-$GLIBC_THREADS_VER.tar.gz
> CC=powerpc-linux-gcc AR=powerpc-linux-ar RANLIB=powerpc-linux-ranlib
> ./configure --host=powerpc-linux --enable-add-ons
> --with-headers=$INSTALL_DIR/include --prefix=
> make
> make install_root=$INSTALL_DIR install

> -----------------------------------------------------------------------------

> 3.) build-gccWITH_GLBIC
> -----------------------------------------------------------------------------

> #!/bin/bash

> #-------------------------------------------------------------
> # This file builds glibc and recompiles gcc to link it to gcc
> #
> # This bash script creates a linux x866 gcc cross compiler
> # for powerpc. This file has been tested with the following
> # modules:
> #    1.) binutils-2.13.90.0.2.tar.gz
> #    2.) gcc-3.2.tar.gz
> #    3.) newlib-synSept12-2002.tar.gz
> #-------------------------------------------------------------

> # Defining target
> TARGET=powerpc-linux

> # Defining prefix - final toolchain location
> PREFIX=$HOME/ppcgcc

> # PATH must updated
> PATH=$PREFIX/bin:$PATH
> export PATH

> # My local includes
> #INCLUDE=/usr/include/

...

read more »

 
 
 

GCC cross compiler build troubles ...

Post by Thierry Morea » Mon, 13 Jan 2003 01:57:16



> Hi,

> I am current having problems building gcc with glibc ... it seems to die
> not being able to find a bunch of header files ... any tips?

> [...]
> I will don't need a full blown gcc until i write some C++ code ... but i
> will evetually need it ...

> Thanks,
> Jim
> Ottawa,Canada

> TARGET=powerpc-linux
> # Configuring packages versions
> GCC_VER=2.95.3
> BINUTILS_VER=2.13.90.0.2
> NEWLIB_VER=1.10.0

I suspect a potential incompatibility between old gcc-2.95 and newer
binutils-2.13, but anyway, look at this gcc-3.2.1 port for the powerpc
http://www.connotech.com/gcc_mpc8xx/powerpc_eabi_mpc850.htm

Enjoy!

--

- Thierry Moreau

CONNOTECH Experts-conseils inc.
9130 Place de Montgolfier
Montreal, Qc
H2M 2A1

Tel.: (514)385-5691
Fax:  (514)385-5900


 
 
 

GCC cross compiler build troubles ...

Post by Eric Dujardi » Thu, 16 Jan 2003 01:02:05


Hi Jim,

I'd suspect header incompatibilities between linux-x86 and linux-ppc. --with-headers
should probably point to ppc headers.

Eric

-----
first dot last at jaluna dot com
www.jaluna.com

 
 
 

GCC cross compiler build troubles ...

Post by Eric Dujardi » Thu, 16 Jan 2003 01:04:47


Hi Jim,

I'd suspect header incompatibilities between linux-x86 and linux-ppc. --with-headers
should probably point to ppc headers.

Eric

-----
first dot last at jaluna dot com
www.jaluna.com

 
 
 

1. gcc error while building a linux-x-djgpp cross compiler

This is the log file from running "make > make.log 2>&1" under gcc build

directory.
Can anyone explain to me the error that follows:

gcc -DCROSS_COMPILE -DIN_GCC     -g -O2  -DHAVE_CONFIG_H  -o collect2
collect2.o tlink.o hash.o intl.o underscore.o version.o
obstack.o        ../libiberty/libiberty.a
cp xgcc gcc-cross
/usr/src/djgpp/cross/gcc/gcc/xgcc -B/usr/src/djgpp/cross/gcc/gcc/
-B/usr/local/i586-pc-msdosdjgpp/bin/
-I/usr/local/i586-pc-msdosdjgpp/include -dumpspecs > tmp-specs
mv tmp-specs specs
echo "void __foo () {}" > dummy.c
/usr/src/djgpp/cross/gcc/gcc/xgcc -B/usr/src/djgpp/cross/gcc/gcc/
-B/usr/local/i586-pc-msdosdjgpp/bin/
-I/usr/local/i586-pc-msdosdjgpp/include -DCROSS_COMPILE -DIN_GCC     -g
-O2 -I./include  -c dummy.c
i586-pc-msdosdjgpp-ar rc libgcc1.null dummy.o
make[1]: i586-pc-msdosdjgpp-ar: Command not found
make[1]: *** [libgcc1.null] Error 127
make[1]: Leaving directory `/usr/src/djgpp/cross/gcc/gcc'
make: *** [all-gcc] Error 2

I have the file "i586-pc-msdosdjgpp-ar" sitting in my /usr/local/bin and

/usr/local/i586-pc-msdosdjgpp/bin directories. Can you tell me why it is

not finding it.

2. reading MS Exchange Mail in Linux

3. "invalid option" error while building gcc as a cross-compiler

4. rup hangs for some minutes at the end of list

5. how to build gcc 2.95.3 cross compiler

6. READING THIS COULD CHANGE YOUR LIFE! FOREVER!

7. gcc "make error" when building a linux-x-djgpp cross compiler

8. The Mythical Man Month

9. building a gcc cross compiler

10. Anyone have experience building gcc as cross compiler?

11. egcs Warning while building gcc-2.8.1 cross compiler

12. Anyone Built a GCC Cross-Compiler?

13. Building GCC as Solaris2.4 -> SunOS4.1.3 cross-compiler