problem compiling gcc402 final

Julie Bouillon julie.bouillon at gmail.com
Thu Jan 5 15:56:51 PST 2006


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:

1. Followed CLFS PPC up to 5.3 and started forking from there
    Setting host and target:
        export LFS_TARGET="powerpc64-unknown-linux-gnu"
        export LFS_TARGET32="powerpc-unknown-linux-gnu"
    Copy settings to environment:
        echo export LFS_TARGET32=\""${LFS_TARGET32}\"" >> ~/.bashrc
2. Added 5.3bis -> Build flags
    Setting build:
        export BUILD32="-m32"
        export BUILD64="-m64"
    Copy to environment:
        echo export BUILD32=\""${BUILD32}\"" >> ~/.bashrc
        echo export BUILD64=\""${BUILD64}\"" >> ~/.bashrc
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
4. Modified 5.5
    Prepare binutils for compilation:
        ../binutils-2.16.1/configure --prefix=/cross-tools \
            --host=${LFS_HOST} --target=${LFS_TARGET}
--with-lib-path=/tools/lib \
            --disable-nls --enable-shared --enable-64-bit-bfd
5. Modified 5.6
    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
    Prepare GCC for compilation:
        ../gcc-4.0.2/configure --prefix=/cross-tools \
            --host=${LFS_HOST} --target=${LFS_TARGET} \
            --with-local-prefix=/tools --disable-nls --disable-shared \
            --disable-threads --enable-languages=c
6. Modified 5.7 => glibc 32 bit
    Prepare GLIBC for compilation with:
        BUILD_CC="gcc" CC="${LFS_TARGET}-gcc ${BUILD32}" \
            AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \
            ../glibc-20051107/configure --prefix=/tools \
            --host=${LFS_TARGET32} --build=${LFS_HOST} \
            --disable-profile --enable-add-ons \
            --with-tls --enable-kernel=2.6.0 --with-__thread \
            --with-binutils=/cross-tools/bin --with-headers=/tools/include \
            --cache-file=config.cache
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
        BUILD_CC="gcc" CC="${LFS_TARGET}-gcc ${BUILD64}" \
            AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \
            ../glibc-20051107/configure --prefix=/tools \
            --host=${LFS_TARGET} --build=${LFS_HOST} --libdir=/tools/lib64 \
            --disable-profile --enable-add-ons \
            --with-tls --enable-kernel=2.6.0 --with-__thread \
            --with-binutils=/cross-tools/bin --with-headers=/tools/include \
            --cache-file=config.cache
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
    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
make[2]: *** [32/libgcc_s.so] Error 1
make[2]: Leaving directory `/arch/work/58gcc-final/gcc-build/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory `/arch/work/58gcc-final/gcc-build/gcc'
make: *** [all-gcc] Error 2

The file /tools/lib/libc.so.6 exists. It's output is:
GNU C Library development release version 2.3.90, by Roland McGrath et al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.0.2.
Compiled on a Linux 2.6.12 system on 2006-01-05.
Available extensions:
        GNU libio by Per Bothner
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

It's file type is:
/tools/lib/libc.so.6: symbolic link to `libc-2.3.90.so' which really is "ELF
64-bit MSB shared object, cisco 7500, version 1 (SYSV), not stripped"

The file type of xgcc is: "ELF 32-bit MSB executable, PowerPC or cisco 4500,
version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared
libs), not stripped"

Content of ~/.bashrc is:set +h
umask 022
LFS=/arch
LC_ALL=POSIX
PATH=/cross-tools/bin:/bin:/usr/bin
export LFS LC_ALL PATH
unset CFLAGS
unset CXXFLAGS
export LFS_HOST="powerpc-cross-linux-gnu"
export LFS_TARGET="powerpc64-unknown-linux-gnu"
export LFS_TARGET32="powerpc-unknown-linux-gnu"
export BUILD32="-m32"
export BUILD64="-m64"

I'm building this system on a Powermac G5 1.8Ghz mono:
OS -> Ubuntu breezy-badger for PPC
Kernel -> Linux avalon 2.6.12-10-powerpc64-smp #1 SMP Thu Dec 22 12:05:49
UTC 2005 ppc64 GNU/Linux
GCC -> gcc version 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
Glibc -> 2.3.5


I know this type of installation is not (yet?) supported but if you have any
idea I will really appreciate it.

Many thanks in advance


Julie Bouillon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/cross-lfs/attachments/20060106/7905d867/attachment.html>


More information about the cross-lfs mailing list