This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to get a prebuilt glibc


As Kai recommended in many messages in this list, a prebuilt glibc is
necessary to build a bootstrap gcc before building a complete cross
compiler. My target is powerpc-linux. Actually prebuilt glibc can be
obtained from various sources, such as SuSE, YellowDog. But the problem
is that these binary RPMs cannot be relocated. And I only have
i686/RedHat hosts.
Well, after searching messages in the list one by one, I got part of the
answer from this thread by Kai: http://sources.redhat.com/ml/crossgcc/2002-04/msg00042.html.
I decided to follow these steps to build the bootstrap gcc. Unfortunately I still got some errors that I don't know how to solve.

--------------------clip---------------------------------
With gcc-2.95.3 one could simply copy the native Linux-headers from
the '/usr/include' and copy the CPU-dependent headers from the
'sysdeps/*/powerpc/bits' and the 'sysdeps/*/powerpc/sys' in the glibc-
sources into the '$prefix/$target/include/bits' and
'$prefix/$target/include/sys' for the target and then get a working
'libgcc.a' at the first try and 'make all-gcc' to succeed...
--------------------clip---------------------------------

First, I copied those native headers just from '/usr/include' not from any subdirectories. Cause I thought some of them may conflict with those from 'sysdefps/*/powerpc/...'. Am I right here?

Second, the cpu-dependent headers are copied as Kai said. But I'm not quite sure about the meanings of '*'. Does it mean all of directories that are under 'sysdeps/' and have subdirectory 'powerpc/'? In other words, all headers from 'sysdeps/powperpc', 'sysdeps/unix/powerpc', 'sysdeps/unix/sysv/linux/powerpc' are needed? I only copied headers from 'sysdeps/unix/sysv/linux/powerpc'.

Third, I went to $build/gcc to 'make libgcc.a' and got complaint of no libiberty.a found. Well, I jumped to $build/libiberty to 'make libiberty.a' and succeeded. Frankly I don't know what function libiberty is. Then went back to continue make process. Finally it complained this error:
-------------------------strip------------------------------------------
In file included from /opt/xdev/ppc/8xx2/powerpc-linux/include/stdlib.h:25,
from ../../gcc-2.95.3/gcc/libgcc2.c:41:
/opt/xdev/ppc/8xx2/powerpc-linux/include/features.h:283: sys/cdefs.h: No such file or directory
/opt/xdev/ppc/8xx2/powerpc-linux/include/features.h:312: gnu/stubs.h: No such file or directory
In file included from ../../gcc-2.95.3/gcc/libgcc2.c:41:
/opt/xdev/ppc/8xx2/powerpc-linux/include/stdlib.h:390: sys/types.h: No such file or directory
In file included from ../../gcc-2.95.3/gcc/libgcc2.c:42:
/opt/xdev/ppc/8xx2/powerpc-linux/include/unistd.h:175: bits/posix_opt.h: No such file or directory
/opt/xdev/ppc/8xx2/powerpc-linux/include/unistd.h:190: bits/types.h: No such file or directory
In file included from ../../gcc-2.95.3/gcc/libgcc2.c:42:
/opt/xdev/ppc/8xx2/powerpc-linux/include/unistd.h:500: bits/confname.h: No such file or directory
make: *** [libgcc2.a] Error 1
-------------------------strip------------------------------------------

As Kai said, 'libgcc.a' should be compiled using the target headers. But I cound't find these files in 'sysdeps/*': gnu/stubs.h, bits/confname.h, sys/types.h. For bits/posix_opt.h in 'sysdeps/unix/sysv/linux/bits' and 'sysdeps/generic/bits', bits/types.h in 'sysdeps/unix/sysv/linux/' and in 'sysdeps/generic/bits', which one is the right choice?

---------------------------clip------------------------------------
Ok, producing GCC uses only the build/host headers, but producing 'libgcc.a', 'libiberty.a', 'libstdc++.a' etc. uses the target headers. One cannot use mostly wrong headers for these...
---------------------------clip------------------------------------

Thank you.

- Shawn


------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]