cross-compilation documentation
Peter Barada
peter@baradas.org
Mon Jun 23 09:10:00 GMT 2003
>> What am I missing here?
>
>Unless the code ends up _included_ in glibc.
>
>Or in any of the dozens of little applications built at the same time
>as glibc, for instance.
what 'dozens of little applications' are built by glibc, and are they
installed and used by glibc?
I've had ssucess building a toolchain vor ppc-linux by building *two*
bootstrap compilers and *two* glibcs:
1) first bootstrap compiler that has *no* libgcc which is used for the:
2) first glibc configurd/built only to install-headers
3) second bootstrap compiler can now be built(and build ligbcc) since the
headers are in place
4) second glibc that is fully built using the second bootstrap
compiler
5) full gcc with c++ using the second bootstrap compiler.
Is there a more efficient method that *doesn't* require building two
bootstrap compilers or effectively building glibc twice?
BTW, the patch suggested by Andrew Pinkski:
> Index: linux.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config/rs6000/linux.h,v
> retrieving revision 1.41
> diff -u -r1.41 linux.h
> --- linux.h 17 Jun 2003 15:53:33 -0000 1.41
> +++ linux.h 22 Jun 2003 17:17:41 -0000
> @@ -91,7 +91,7 @@
> /* Do code reading to identify a signal frame, and set the frame
> state data appropriately. See unwind-dw2.c for the structs. */
>
> -#ifdef IN_LIBGCC2
> +#if defined (IN_LIBGCC2) && !defined (inhibit_libc)
> #include <signal.h>
>
> /* During the 2.5 kernel series the kernel ucontext was changed, but
>
fails to build a bootstrap compiler when configure for --target=ppc-linux with:
${GCC_SOURCE_PATH}/configure --target=${TARGET} \
--prefix=${INSTALL_DIR} \
--with-local-prefix=${INSTALL_DIR}/${TARGET} \
--without-headers \
--disable-shared --enable-languages=c \
--disable-threads
It barfs with:
/home/peter/work/cvs-local/xgcc/obj/ppc-linux/ppc-linux-bootstrap2/gcc/xgcc -B/home/peter/work/cvs-local/xgcc/obj/ppc-linux/ppc-linux-bootstrap2/gcc/ -B/home/mylocal/xcomp/target/ppc-linux/bin/ -B/home/mylocal/xcomp/target/ppc-linux/lib/ -isystem /home/mylocal/xcomp/target/ppc-linux/include -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -fPIC -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc -I/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/. -I/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/config -I/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/../include -fPIC -mstrict-align -fexceptions -c /home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
In file included from /home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/unwind-dw2.c:26:
/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/unwind-pe.h: In function `size_of_encoded_value':
/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/unwind-pe.h:76: warning: implicit declaration of function `abort'
/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/unwind-dw2.c: In function `extract_cie_info':
/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/unwind-dw2.c:247: warning: implicit declaration of function `strlen'
/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/unwind-dw2.c: In function `uw_frame_state_for':
/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/unwind-dw2.c:928: warning: implicit declaration of function `memset'
/home/peter/work/cvs-local/xgcc/gcc-3.3/gcc/unwind-dw2.c:939: error: `SIGNAL_FRAMESIZE' undeclared (first use in this function)
...
So not including the headers won't cut it. The code that refers to
any defintions(such as the size of the SIGNALE_FRAMESIZE) has to be
disabled under #if !defined(inhibit_libc), and that doesn't sound like
a very elegant solution...
Any other suggestions?
--
Peter Barada
peter@baradas.org
More information about the Gcc
mailing list