This is the mail archive of the crossgcc@sourceware.org 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]

Building cross compiler for existing target file system


Hi,

I would like to build a cross compiler for an existing target file
system on a new host. I have at my disposal all the source matching
the versions used to build the file system in the first place. The new
host is latest CentOS 5 i686 the target is a fairly old i586 system.

I believe for this scenario I should just have to do a single pass
build of binutils (desired version is 2.15.94) and then gcc (desired
version 3.4.3). After many attempts and lots of googling my current
process has evolved to the steps below. Points of note for the target
fs:
 -   crt{1,i,n}.o are in /target/usr/lib
-    dynamic linker ld-linux.so.2 is in /target/lib

Process:

= binutils =

AR=ar AS=as ../binutils-2.15.94/configure --prefix=/cross-tools \
    --host=${HOST} --target=${TARGET}
--with-lib-path=/usr/local/lib:/lib:/usr/lib \
    --disable-nls --enable-shared --disable-multilib \
    --program-prefix=new- --with-sysroot=/target

make configure-host
make
make install

= gcc =

../gcc-3.4.3/configure --prefix=/cross-tools \
    --target=${TARGET} --host=${HOST} --disable-multilib \
    --disable-nls --enable-shared \
    --enable-languages=c,c++ --enable-__cxa_atexit \
    --enable-cross --with-numa-policy=no --with-cpu=i586
--enable-threads=posix \
    --program-prefix=new- --with-sysroot=/target \
    --with-gxx-include-dir=/target/usr/include/c++/3.4.3

make AS_FOR_TARGET="new-as" LD_FOR_TARGET="new-ld"
AR_FOR_TARGET="new-ar" RANLIB_FOR_TARGET="new-ranlib"
NM_FOR_TARGET="new-nm"

(the make fails when building libstdc++ - the config.log indicates
"/target/lib/libc.so.6: undefined reference to
`_rtld_global_ro@GLIBC_PRIVATE' " when xgcc is attempting a conftest )

make install-gcc AS_FOR_TARGET="new-as" LD_FOR_TARGET="new-ld"
AR_FOR_TARGET="new-ar" RANLIB_FOR_TARGET="new-ranlib"
NM_FOR_TARGET="new-nm"

new-gcc and new-g++ are installed but any attempt to build a minimal
program using them results in the same undefined reference as above.


Any guidance is most welcome.

Thanks,
Jonathan

--
For unsubscribe information see http://sourceware.org/lists.html#faq


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