[lfs-support] Cross compiler for powerpc (LFS 7.1)

Ratnaraj Mirgal raj.aprilfool at gmail.com
Wed Mar 28 04:29:57 PDT 2012


Hi All,

I'm trying to build a cross compiler for powerpc below are the version
details,
host=build=i686-pc-linux-gnu
target=powerpc-home-linux-gnu
binutils-2.22  gcc-4.6.2  glibc-2.14.1  gmp-5.0.4  linux-2.6.34  mpc-0.9
mpfr-3.1.0
(soft links created for gmp, mpc and mpfr in gcc)

1. binutils configure,
../binutils-2.22/configure --host=i686-pc-linux-gnu
--build=i686-pc-linux-gnu --target=powerpc-home-linux-gnu
--with-pkgversion=ratnaraj --prefix=/home/ratnaraj/cross/objdir/ppc_cross
--with-sysroot=/home/ratnaraj/cross/objdir/ppc_cross/powerpc-home-linux-gnu/sysroot
--disable-nls --disable-werror

2.gcc pass1 configure,
../gcc-4.6.2/configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu
--target=powerpc-home-linux-gnu --disable-libssp --disable-libgomp
--disable-libmudflap --disable-nls --without-headers  --with-newlib
--disable-shared --disable-threads --enable-languages=c
--with-pkgversion=ratnaraj --prefix=/home/ratnaraj/cross/objdir/ppc_cross
--disable-libquadmath --disable-decimal-float --disable-libffi
--with-sysroot=/home/ratnaraj/cross/objdir/ppc_cross/powerpc-home-linux-gnu/sysroot
--disable-multilib --without-ppl --without-cloog
--with-mpfr-include=$(pwd)/../gcc-4.6.2/mpfr/src
--with-mpfr-lib=$(pwd)/mpfr/src/.libs

3. a. installing kernel headers
    b. libgcc.a link (honestly i did this blindly)
        ln -vs libgcc.a `powerpc-home-linux-gnu-gcc -print-libgcc-file-name
| sed 's/libgcc/&_eh/'`
    c. export PATH

4. glibc configure,
../glibc-2.14.1/configure --build=i686-pc-linux-gnu
--host=powerpc-home-linux-gnu --with-pkgversion=ratnaraj
--prefix=/home/ratnaraj/cross/objdir/ppc_cross
--with-sysroot=/home/ratnaraj/cross/objdir/ppc_cross/powerpc-home-linux-gnu/sysroot
--disable-profile libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes
--enable-add-ons --enable-kernel=2.6.34

ERROR:
powerpc-home-linux-gnu-gcc   -shared -Wl,-O1 \
  -nostdlib -nostartfiles \
   -Wl,-dynamic-linker=/home/ratnaraj/cross/objdir/ppc_cross/lib/ld.so.1
-Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both \
  -Wl,--verbose 2>&1 | \
  sed > /home/ratnaraj/cross/objdir/shlib.ldsT \
      -e '/^=========/,/^=========/!d;/^=========/d' \
       -e 's/^.*\.gnu\.hash[    ]*:.*$/  .note.ABI-tag : { *(.note.ABI-tag)
} &/' -e '/^[       ]*\.hash[       ]*:.*$/{h;d;}' -e
'/DATA_SEGMENT_ALIGN/{H;g}'  \
      -e 's/^.*\*(\.dynbss).*$/& \
         PROVIDE(__start___libc_freeres_ptrs = .); \
         *(__libc_freeres_ptrs) \
         PROVIDE(__stop___libc_freeres_ptrs = .);/'\
      -e 's@^.*\*(\.jcr).*$@& \
         PROVIDE(__start___libc_subfreeres = .);\
         __libc_subfreeres : { *(__libc_subfreeres) }\
         PROVIDE(__stop___libc_subfreeres = .);\
         PROVIDE(__start___libc_atexit = .);\
         __libc_atexit : { *(__libc_atexit) }\
         PROVIDE(__stop___libc_atexit = .);\
         PROVIDE(__start___libc_thread_subfreeres = .);\
         __libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\
         PROVIDE(__stop___libc_thread_subfreeres = .);\
         /DISCARD/ : { *(.gnu.glibc-stub.*) }@'
mv -f /home/ratnaraj/cross/objdir/shlib.ldsT
/home/ratnaraj/cross/objdir/shlib.lds
powerpc-home-linux-gnu-gcc   -nostdlib -nostartfiles -r -o
/home/ratnaraj/cross/objdir/libc_pic.os \
 -Wl,-d -Wl,--whole-archive /home/ratnaraj/cross/objdir/libc_pic.a
powerpc-home-linux-gnu-gcc   -shared -static-libgcc -Wl,-O1  -Wl,-z,defs
-Wl,-dynamic-linker=/home/ratnaraj/cross/objdir/ppc_cross/lib/ld.so.1
-B/home/ratnaraj/cross/objdir/csu/
-Wl,--version-script=/home/ratnaraj/cross/objdir/libc.map
-Wl,-soname=libc.so.6 -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both
-nostdlib -nostartfiles -e __libc_main -L/home/ratnaraj/cross/objdir
-L/home/ratnaraj/cross/objdir/math -L/home/ratnaraj/cross/objdir/elf
-L/home/ratnaraj/cross/objdir/dlfcn -L/home/ratnaraj/cross/objdir/nss
-L/home/ratnaraj/cross/objdir/nis -L/home/ratnaraj/cross/objdir/rt
-L/home/ratnaraj/cross/objdir/resolv -L/home/ratnaraj/cross/objdir/crypt
-L/home/ratnaraj/cross/objdir/nptl
-Wl,-rpath-link=/home/ratnaraj/cross/objdir:/home/ratnaraj/cross/objdir/math:/home/ratnaraj/cross/objdir/elf:/home/ratnaraj/cross/objdir/dlfcn:/home/ratnaraj/cross/objdir/nss:/home/ratnaraj/cross/objdir/nis:/home/ratnaraj/cross/objdir/rt:/home/ratnaraj/cross/objdir/resolv:/home/ratnaraj/cross/objdir/crypt:/home/ratnaraj/cross/objdir/nptl
-o /home/ratnaraj/cross/objdir/libc.so -T
/home/ratnaraj/cross/objdir/shlib.lds
/home/ratnaraj/cross/objdir/csu/abi-note.o
/home/ratnaraj/cross/objdir/elf/soinit.os
/home/ratnaraj/cross/objdir/libc_pic.os
/home/ratnaraj/cross/objdir/elf/sofini.os
/home/ratnaraj/cross/objdir/elf/interp.os
/home/ratnaraj/cross/objdir/elf/ld.so -lgcc
/home/ratnaraj/cross/objdir/libc_pic.os: In function `__GI___assert_fail':
/home/ratnaraj/cross/glibc-2.14.1/assert/assert.c:105: undefined reference
to `__GI___dcgettext'
/home/ratnaraj/cross/objdir/libc_pic.os: In function
`__GI___assert_perror_fail':
/home/ratnaraj/cross/glibc-2.14.1/assert/assert-perr.c:37: undefined
reference to `__GI___dcgettext'
/home/ratnaraj/cross/objdir/libc_pic.os: In function `get_output_charset':
/home/ratnaraj/cross/glibc-2.14.1/intl/dcigettext.c:1402: undefined
reference to `__libc_tsd_LOCALE_data'
/home/ratnaraj/cross/objdir/libc_pic.os: In function `read_alias_file':
/home/ratnaraj/cross/glibc-2.14.1/intl/localealias.c:255: undefined
reference to `__libc_tsd_CTYPE_B_data'
/home/ratnaraj/cross/objdir/libc_pic.os: In function `__ctype_b_loc':
/home/ratnaraj/cross/glibc-2.14.1/intl/../include/ctype.h:30: undefined
reference to `__libc_tsd_LOCALE_data'
/home/ratnaraj/cross/objdir/libc_pic.os: In function
`__gettext_extract_plural':
/home/ratnaraj/cross/glibc-2.14.1/intl/plural-exp.c:122: undefined
reference to `__libc_tsd_CTYPE_B_data'
/home/ratnaraj/cross/objdir/libc_pic.os: In function `__ctype_b_loc':
/home/ratnaraj/cross/glibc-2.14.1/intl/../include/ctype.h:30: undefined
reference to `__libc_tsd_LOCALE_data'
/home/ratnaraj/cross/objdir/libc_pic.os: In function `psignal':
/home/ratnaraj/cross/glibc-2.14.1/stdio-common/psignal.c:52: undefined
reference to `__GI___dcgettext'
/home/ratnaraj/cross/glibc-2.14.1/stdio-common/psignal.c:51: undefined
reference to `__GI___dcgettext'
/home/ratnaraj/cross/objdir/libc_pic.os: In function `psiginfo':
/home/ratnaraj/cross/glibc-2.14.1/stdio-common/psiginfo.c:114: undefined
reference to `__GI___dcgettext'
/home/ratnaraj/cross/glibc-2.14.1/stdio-common/psiginfo.c:204: undefined
reference to `__GI___dcgettext'
/home/ratnaraj/cross/glibc-2.14.1/stdio-common/psiginfo.c:186: undefined
reference to `__GI___dcgettext'
/home/ratnaraj/cross/objdir/libc_pic.os:/home/ratnaraj/cross/glibc-2.14.1/malloc/mcheck.c:362:
more undefined references to `__GI___dcgettext' follow
/home/ratnaraj/cross/objdir/libc_pic.os:(.stab+0x14): undefined reference
to `_free_mem'
collect2: ld returned 1 exit status
make[2]: *** [/home/ratnaraj/cross/objdir/libc.so] Error 1
make[2]: Leaving directory `/home/ratnaraj/cross/glibc-2.14.1/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/home/ratnaraj/cross/glibc-2.14.1'
make: *** [all] Error 2
I've even tried glibc2.13 and glibc2.15, however ended with same error.
In glibc source, for example, in stdio-common/psiginfo.c I tried to check
macro expansion for _(), with no leads towards success.

Any help appriciated. :)

-- 
Warm Regards,
Ratnaraj Mirgal
http://www.google.co.in/search?q=ratnaraj+mirgal
:-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-support/attachments/20120328/ae18900c/attachment.html>


More information about the lfs-support mailing list