public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* problems when building gcc 3.2.3 as crosscompiler
@ 2003-05-21 13:51 t152
  2003-05-22 11:05 ` Nick Patavalis
  0 siblings, 1 reply; 2+ messages in thread
From: t152 @ 2003-05-21 13:51 UTC (permalink / raw)
  To: gcc-help

Hi,

I'm currently trying to build the gcc 3.2.3 as cross-compiler
for power pc on a i686-pc-linux-gnu host with this compiler:

---------8<-------------------8<---------
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
---------8<-------------------8<---------

first I have installed binutils 2.13.2.1 with the following
commands:

---------8<-------------------8<---------
mkdir build
cd build
../configure --prefix=/usr/local/gcc323-ppc --target=ppc-pc-linux-gnu
make
su
make install
---------8<-------------------8<---------

then I have tried to build the gcc
with the following commands:

---------8<-------------------8<---------
mkdir build
cd build
../configure --prefix=/usr/local/gcc323-ppc --target=ppc-pc-linux-gnu
make
---------8<-------------------8<---------

after a while "make" terminated with the following ...

---------8<-------------------8<---------
make[2]: Entering directory `/home/users/tl/gcc/gcc-3.2.3/build/gcc'
for d in libgcc nof libgcc/nof; do \
  if [ -d $d ]; then true; else /bin/sh ../../gcc/mkinstalldirs $d; fi; \
done
mkdir libgcc
mkdir nof
mkdir libgcc/nof
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
/home/users/tl/gcc/gcc-3.2.3/build/gcc/xgcc
-B/home/users/tl/gcc/gcc-3.2.3/build/gcc/
-B/usr/local/gcc323-ppc/ppc-pc-linux-gnu/bin/
-B/usr/local/gcc323-ppc/ppc-pc-linux-gnu/lib/ -isystem
/usr/local/gcc323-ppc/ppc-pc-linux-gnu/include -O2  -DIN_GCC
-DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc
-I../../gcc/. -I../../gcc/config -I../../gcc/../include  -fPIC
-mstrict-align -DL_muldi3 -c ../../gcc/libgcc2.c -o libgcc/./_muldi3.o
In file included from tconfig.h:21,
                 from ../../gcc/libgcc2.c:36:
../../gcc/config/rs6000/linux.h:81:20: signal.h: No such file or directory
../../gcc/config/rs6000/linux.h:82:26: sys/ucontext.h: No such file or
directory
make[2]: *** [libgcc/./_muldi3.o] Error 1
make[2]: Leaving directory `/home/users/tl/gcc/gcc-3.2.3/build/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory `/home/users/tl/gcc/gcc-3.2.3/build/gcc'
make: *** [all-gcc] Error 2
---------8<-------------------8<---------

... although the file "signal.h" is, e.g. on
/usr/src/linux/include/linux/signal.h

after commenting out line 21 (# include "rs6000/linux.h") in
build/gcc/tconfig.h make terminated some times later with
the following:

---------8<-------------------8<---------
make[2]: Entering directory `/home/users/tl/gcc/gcc-3.2.3/build/gcc'

[...]

/home/users/tl/gcc/gcc-3.2.3/build/gcc/xgcc
-B/home/users/tl/gcc/gcc-3.2.3/build/gcc/
-B/usr/local/gcc323-ppc/ppc-pc-linux-gnu/bin/
-B/usr/local/gcc323-ppc/ppc-pc-linux-gnu/lib/ -isystem
/usr/local/gcc323-ppc/ppc-pc-linux-gnu/include -O2  -DIN_GCC
-DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc
-I../../gcc/. -I../../gcc/config -I../../gcc/../include -fPIC
-mstrict-align -fexceptions -c ../../gcc/unwind-dw2.c -o
libgcc/./unwind-dw2.o
In file included from ../../gcc/unwind-dw2.c:26:
../../gcc/unwind-pe.h: In function `size_of_encoded_value':
../../gcc/unwind-pe.h:76: warning: implicit declaration of function
`abort'
In file included from gthr-default.h:1,
                 from ../../gcc/gthr.h:98,
                 from ../../gcc/unwind-dw2.c:28:
../../gcc/gthr-posix.h:37:21: pthread.h: No such file or directory
In file included from gthr-default.h:1,
                 from ../../gcc/gthr.h:98,
                 from ../../gcc/unwind-dw2.c:28:
../../gcc/gthr-posix.h: At top level:
../../gcc/gthr-posix.h:39: syntax error before "__gthread_key_t"
../../gcc/gthr-posix.h:39: warning: type defaults to `int' in declaration
of `__gthread_key_t'
../../gcc/gthr-posix.h:39: warning: data definition has no type or storage
class
../../gcc/gthr-posix.h:40: syntax error before "__gthread_once_t"
../../gcc/gthr-posix.h:40: warning: type defaults to `int' in declaration
of `__gthread_once_t'
../../gcc/gthr-posix.h:40: warning: data definition has no type or storage
class
../../gcc/gthr-posix.h:41: syntax error before "__gthread_mutex_t"
../../gcc/gthr-posix.h:41: warning: type defaults to `int' in declaration
of `__gthread_mutex_t'
../../gcc/gthr-posix.h:41: warning: data definition has no type or storage
class
../../gcc/gthr-posix.h: In function `__gthread_active_p':
../../gcc/gthr-posix.h:83: `pthread_create' undeclared (first use in this
function)
../../gcc/gthr-posix.h:83: (Each undeclared identifier is reported only
once
../../gcc/gthr-posix.h:83: for each function it appears in.)
../../gcc/gthr-posix.h: At top level:
../../gcc/gthr-posix.h:438: syntax error before '*' token
../../gcc/gthr-posix.h:438: syntax error before ')' token

[...]
---------8<-------------------8<---------

Maybe there is something completely wrong with my approach.

Any hint is appreciated.

Tom

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

* Re: problems when building gcc 3.2.3 as crosscompiler
  2003-05-21 13:51 problems when building gcc 3.2.3 as crosscompiler t152
@ 2003-05-22 11:05 ` Nick Patavalis
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Patavalis @ 2003-05-22 11:05 UTC (permalink / raw)
  To: t152; +Cc: gcc-help

On Wed, May 21, 2003 at 03:51:00PM +0200, t152@vmars.tuwien.ac.at wrote:
> Hi,
> 
> I'm currently trying to build the gcc 3.2.3 as cross-compiler
> for power pc on a i686-pc-linux-gnu host with this compiler:
>
> ...
> 
> Maybe there is something completely wrong with my approach.
> 

Not completely wrong, but not right either. Since you have no target
standard-library (glibc), I would suggest first building a mininal
(no-threads, and no-other-fancy-stuff) c-only cross-compiler, using
the "inhibit_libc" patch. Then you can use this compiler to
cross-build a glibc (or other standard library) for your target. Only
then, having the target library, you can build a "complete"
cross-compiler with front-ends for any language you might need, thread
support, etc.

I have posted a message with very detailed instructions on how to
build a cross-toolchain from scratch in the "gcc-help" newsgroup. The
examples are for the sparc-linux target, but the overall procedure is
very similar for other targets too. You can also get this document
from here:

http://www.inaccessnetworks.com/misc-downloads/xdvl/cross-toolchain-build.txt

/npat

-- 
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety.
  -- Benjamin Franklin, Historical Review of Pennsylvania, 1759.

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

end of thread, other threads:[~2003-05-22 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-21 13:51 problems when building gcc 3.2.3 as crosscompiler t152
2003-05-22 11:05 ` Nick Patavalis

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 read-only IMAP folder(s) and NNTP newsgroup(s).