[Clfs-support] CLFS for ppc on LFS 6.3 host

Ken Moffat zarniwhoop at ntlworld.com
Thu Jul 3 11:26:41 PDT 2008


On Thu, Jul 03, 2008 at 08:20:01AM -0700, Anthony Drake wrote:
> Good morning.
> I'm in the process of following CLFS book 1.0.0-PowerPC in an attempt to get a cross compiler for power pc running on my LFS 6.3 host running on an i686 processor.    My goal is to get the cross compiler working, to be able to build packages to install on an embedded linux ppc target, so I really do not need to build a CLFS, merely(!) the cross compiler environment, to be able to build and update passwd and PAM library modules on the ppc target.
 [ I have no idea whether that is correct, I've never tried anything
other than a full cross build.  Hope you are right. ]
> I have deviated from book in the respect that my LFS 6.3 host has newer than recommended gcc and GNU library, and that I am not using a separate partition for the cross compiler ie /mnt/clfs is an ordinary directory.
 Using a directory is not a problem.  I usually do cross-compiles in
a directory under /home/lfs (sic!) and bind it to /mnt/clfs.
> ${CLFS} is set to /mnt/clfs, CLFS_HOST=i686-cross-linux-gnu; CLFS_TARGET=powerpc-unknown-linux-gnu.
> /tools is a link to /mnt/clfs/tools
> /cross-tools is a link to /mnt/clfs/cross-tools
> Versions:
> bash, version 3.2.17(1)-release
> Binutils: version 2.17
> bzip2, Version 1.0.4, 20-Dec-2006.
> Coreutils: 6.9
> diff (GNU diffutils) 2.8.1
> GNU find version 4.2.31
> GNU Awk 3.1.5
> gcc (GCC) 4.1.2
 Should not be a problem, a newer release in the same stable series
is supposed to reduce the problems.
> GNU C Library stable release version 2.5.1,
 Building an older glibc from a newer is not so common, but they are
probably close enough.
[...]
> powerpc-unknown-linux-gnu-gcc tst-tlsmod1.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -g -mabi=ibmlongdouble -mnew-mnemonics -Wstrict-prototypes -mlong-double-128 -fpic -I../include -I/mnt/clfs/sources/glibc-build/elf -I/mnt/clfs/sources/glibc-build -I../sysdeps/powerpc/powerpc32/elf -I../sysdeps/powerpc/elf -I../sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu -I../sysdeps/powerpc/powerpc32/fpu -I../nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32 -I../sysdeps/unix/sysv/linux/powerpc/powerpc32 -I../nptl/sysdeps/unix/sysv/linux/powerpc -I../sysdeps/unix/sysv/linux/powerpc -I../sysdeps/ieee754/ldbl-128ibm -I../sysdeps/ieee754/ldbl-opt -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/powerpc -I../nptl/sysdeps/unix
>  -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/powerpc/powerpc32 -I../sysdeps/wordsize-32 -I../sysdeps/powerpc/fpu -I../nptl/sysdeps/powerpc -I../sysdeps/powerpc -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I.. -I../libio -I. -nostdinc -isystem /mnt/clfs/cross-tools/bin/../lib/gcc/powerpc-unknown-linux-gnu/4.1.1/include -isystem /tools/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -DSHARED -DNOT_IN_libc=1 -DNOT_IN_libc -o /mnt/clfs/sources/glibc-build/elf/tst-tlsmod1.os -MD -MP -MF /mnt/clfs/sources/glibc-build/elf/tst-tlsmod1.os.dt -MT /mnt/clfs/sources/glibc-build/elf/tst-tlsmod1.os
> cc1: warning: Using IBM extended precision long double
> In file included from tst-tlsmod1.c:6:
> tls-macros.h:850:3: error: #error "No support for this architecture so far."
> tst-tlsmod1.c: In function 'in_dso':
> tst-tlsmod1.c:27: warning: implicit declaration of function 'TLS_IE'
> tst-tlsmod1.c:27: error: 'foo' undeclared (first use in this function)
> tst-tlsmod1.c:27: error: (Each undeclared identifier is reported only once
> tst-tlsmod1.c:27: error: for each function it appears in.)
> tst-tlsmod1.c:27: warning: assignment makes pointer from integer without a cast
> tst-tlsmod1.c:28: error: 'bar' undeclared (first use in this function)
> tst-tlsmod1.c:28: warning: assignment makes pointer from integer without a cast
> tst-tlsmod1.c:45: warning: implicit declaration of function 'TLS_GD'
> tst-tlsmod1.c:45: warning: assignment makes pointer from integer without a cast
> tst-tlsmod1.c:46: warning: assignment makes pointer from integer without a cast
> tst-tlsmod1.c:47: error: 'baz' undeclared (first use in this function)
> tst-tlsmod1.c:47: warning: assignment makes pointer from integer without a cast
> make[2]: *** [/mnt/clfs/sources/glibc-build/elf/tst-tlsmod1.os] Error 1
> make[2]: Leaving directory `/mnt/clfs/sources/glibc-2.4/elf'
> make[1]: *** [elf/subdir_lib] Error 2
> make[1]: Leaving directory `/mnt/clfs/sources/glibc-2.4'
> make: *** [all] Error 2
> end make output fragment
> Whew!  I know it's long winded - my current plan is to install gcc v4.1.1, and glibc 2.4 on my LFS 6.3 host machine, then start over on chapter 5, then see what the news is going to be.    The only catch is I'm not completely sure how to avoid calling gcc v4.1.2 on the host machine.  I built gcc v4.1.1 in a directory call /tools41, and the thought is to modify $PATH to insert /tools41 first in the path, but I am also not sure how to install glibc 2.4 on my host system, and have it used instead of the resident glibc2.5.

 The test for thread-local-storage is failing.  At one time, a long
while ago, we had to sometimes do odd things to get tls to work, but
that was well before 1.0.0.  Looking at my own buildscripts from
1.0.0, the only thing I notice is that I passed --with-tls and
--with-__thread to the glibc configure.  If you have both of those,
then I guess that the cross-toolchain has somehow built without tls
but I've no idea where to look.

 My own logs were for building from ppc64 or from ppc, I assume I
also built from x86 or x86_64 but I have no proof.

 I do remember that on occasion I've been surprised by the output
when cross-compiling gcc, it often spits out a lot of the options
for the target architecture without apparently causing any problems.

 The one thing I'm sure about is that downgrading glibc on the host
machine is not a good idea - you're very likely to make it unusable.
Running two instances of glibc is not an option.

 I can't point you at the sysroot book, although it sounds like what
you want to do, because ppc isn't in it.  1.0.0 is now very old, if
this is a real problem (rather than an error in your commands
somewhere), perhaps the current development book will work better.

ĸen
-- 
das eine Mal als Tragödie, das andere Mal als Farce



More information about the Clfs-support mailing list