problem compiling gcc402 final

Ken Moffat ken at linuxfromscratch.org
Thu Jan 5 19:50:36 PST 2006


On Fri, 6 Jan 2006, Julie Bouillon wrote:

> LONG POST !
>
> Hi all,
>
> Feeling a little bit adventurous I tried to build a powerpc64 multilib
> environment. Here after is what is different from
> LFS-BOOK-CLFS-SVN-20060103-HTML:
>

  Hi Julie,

  I built a multilib ppc64 from a November version of the book, but it 
has certain issues (yaboot builds, but stage 2 - the linux loader- 
doesn't work) and I had a lot of problems in BLFS (got a 64-bit X, 
couldn't build it as 32-bit, and didn't get a lot further).  But, 
building as ppc on a G5 also has certain issues, so ...

> 3. Replaced 5.4 with:
>    ~/biarch.ksh ppc ppc64 ppc64 powerpc64 (quick and dirty ksh script to
> create biarch include dir)
>    install -d /tools/include
>    cp -R include/asm-ppc /tools/include
>    cp -R include/asm-ppc64 /tools/include
>    cp -R include/asm-ppc64-biarch /tools/include/asm
>    cp -R include/linux /tools/include

  I used JH's patch from lfs-patches, but I doubt that is the problem.

  After binutils, I followed Jeremy in building glibc headers, just like 
e.g. x86_64 multilib except that pthreadtypes.h comes from 
.../linux/powerpc/bits/  - I don't know if this is necessary, but it 
didn't hurt.

> 7. Added step 5.7 bis => glibc 64 bit
>    Compile in a new dir:
>        mkdir ../glibc-build64
>        cd ../glibc-build64
>    Prepare Glibc for compilation:
>        echo "libc_cv_forced_unwind=yes" > config.cache
>        echo "libc_cv_c_cleanup=yes" >> config.cache
>        echo "libc_cv_ppc_machine=yes" >> config.cache

  Ouch.  You really need
 	echo "slibdir=/tools/lib64" >>configparms
  otherwise you're likely to overwrite the 32-bit library.  I've done 
that on x86_64.

> 8. Modified 5.8
>    Startfile spec:
>        echo "
>        #undef STARTFILE_PREFIX_SPEC
>        #define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >>
> gcc/config/rs6000/linux.h
>        echo "
>        #undef STARTFILE_PREFIX_SPEC
>        #define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >>
> gcc/config/rs6000/linux64.h
>    Disable -B in configure:
>        cp configure{,.orig}
>        sed -e  '/FLAGS_FOR_TARGET.*\/lib\//s at -B[^ ]*/lib/@@g'
> configure.orig >configure

  I had a sed for CROSS_SYSTEM_HEADER_DIR here, I think we still need it 
(unless it just dropped out of your notes).

>    Prepare GCC for compilation:
>        ../gcc-4.0.2/configure --prefix=/cross-tools \
>            --target=${LFS_TARGET} --host=${LFS_HOST} \
>            --with-local-prefix=/tools --disable-nls --enable-shared \
>            --enable-languages=c,c++ --enable-__cxa_atexit \
>            --enable-c99 --enable-long-long --enable-threads=posix
>
>
> Trying to compile GCC with:
> make AS_FOR_TARGET="/cross-tools/bin/${LFS_TARGET}-as" \
> LD_FOR_TARGET="/cross-tools/bin/${LFS_TARGET}-ld"
>
> The error returned is:
> /arch/work/58gcc-final/gcc-build/gcc/xgcc
> -B/arch/work/58gcc-final/gcc-build/gcc/
> -B/cross-tools/powerpc64-unknown-linux-gnu/bin/
> ------8<------
> -f 32/libgcc_s.so.1 32/libgcc_s.so.1.backup; else true; fi && mv
> 32/libgcc_s.so.1.tmp 32/libgcc_s.so.1 && ln -s libgcc_s.so.1 32/libgcc_s.so
> /cross-tools/powerpc64-unknown-linux-gnu/bin/ld: skipping incompatible
> /tools/lib/libc.so.6 when searching f or /tools/lib/libc.so.6
> /cross-tools/powerpc64-unknown-linux-gnu/bin/ld: cannot find
> /tools/lib/libc.so.6
> collect2: ld returned 1 exit status

  I think this probably means you don't have a 32-bit libc, because of 
the missing slibdir. Ah, yes indeed, you show your libc is 64-bit.

Ken
-- 
  das eine Mal als Tragödie, das andere Mal als Farce


More information about the cross-lfs mailing list