Anthony Drake | 3 Jul 2008 17:20
Picon

CLFS for ppc on LFS 6.3 host

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 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.
 
${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

GNU C Library stable release version 2.5.1,

grep (GNU grep) 2.5.1

gzip 1.3.12

GNU Make 3.81

patch 2.5.4

GNU sed version 4.1.5

tar (GNU tar) 1.18

 
So far, it's going pretty well, but I have run into some problems - unzipping .bz2 files in windows then copying to linux system does not work well, but is easily avoided by using bzcat piped to tar on LFS machine.  After learning to properly restore and patch packages, I was able to progress through chapter 5 to the point of building  glibc 2.4, which will not build:
 
make output fragment follows:
 

make[4]: Entering directory `/mnt/clfs/sources/glibc-2.4/time'

make[4]: Nothing to be done for `rtld-all'.

make[4]: Leaving directory `/mnt/clfs/sources/glibc-2.4/time'

make[3]: Leaving directory `/mnt/clfs/sources/glibc-2.4/elf'

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.

 

If anyone can see anything obvious, I'd be really glad, I'm open to any advice.   The management is really interested in being able to update these PPC embedded systems, and so am I.

 

Thanks,

Anthony Drake.

_______________________________________________
Clfs-support mailing list
Clfs-support <at> lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org
Ken Moffat | 3 Jul 2008 20:26

Re: CLFS for ppc on LFS 6.3 host

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
_______________________________________________
Clfs-support mailing list
Clfs-support <at> lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org
Joe Ciccone | 5 Jul 2008 20:49
Picon

CBLFS Changes

    Within the last hour I made some changes to CBLFS. This is mainly
just structure changes in the permissions and groups so its easier to
track changes and watch for bad changes. The first change prevented
unregistered users from making changes. The second changes prevented
people who didn't confirm their email from making changes as well. These
changes were put in place to keep people from making hit & runs mainly.
We've been lucky and have had very few bad changes to the wiki, most of
it is just in consistency. Eg, Editing the non-multilib sections and not
touching the multilib sections, or vice-versa. Updating a package
version blindly without considering that the build instructions might
need to change. Hopefully with these changes it will be easier to track.

    In the process I added something that I know people have been asking
for for a while. A way to bypass the captcha. Only sysadmins can make
the change for the specific users. There is now a usergroup to skip the
captcha. I added the users who frequently make changes, and who I know
are real users.

If there are any questions in regard to the changes, You know where to
find me.
Anthony Drake | 7 Jul 2008 21:23
Picon

Re: CLFS for ppc on LFS 6.3 host

After having difficulties with CLFS book 1.0.0-PowerPC, per Ken's suggestion I did try the current clfs book Version SVN-20080629-PowerPC, and I was able to build everything up to and including glibc OK, but the Cross Compiler Final step is failing with the linker not finding crti.o.
 
crti.o is found at /tools/lib/crti.o, of course /tools is a link to /mnt/clfs/tools, so the actual file is at /mnt/clfs/tools/lib/crti.o
 
I've been extremely careful when entering the command line to build clfs, so I'm not sure what's wrong here.
 
make output:

make[1]: Entering directory `/mnt/clfs/sources/gcc-build'

make[2]: Entering directory `/mnt/clfs/sources/gcc-build/libiberty'

make[3]: Entering directory `/mnt/clfs/sources/gcc-build/libiberty/testsuite'

make[3]: Nothing to be done for `all'.

make[3]: Leaving directory `/mnt/clfs/sources/gcc-build/libiberty/testsuite'

make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/libiberty'

make[2]: Entering directory `/mnt/clfs/sources/gcc-build/fixincludes'

make[2]: Nothing to be done for `all'.

make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/fixincludes'

make[2]: Entering directory `/mnt/clfs/sources/gcc-build/intl'

make[2]: Nothing to be done for `all'.

make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/intl'

make[2]: Entering directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty'

make[3]: Entering directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty/testsuite'

make[3]: Nothing to be done for `all'.

make[3]: Leaving directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty/testsuite'

make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty'

make[2]: Entering directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/fixincludes'

make[2]: Nothing to be done for `all'.

make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/fixincludes'

make[2]: Entering directory `/mnt/clfs/sources/gcc-build/libcpp'

make[2]: Nothing to be done for `all'.

make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/libcpp'

make[2]: Entering directory `/mnt/clfs/sources/gcc-build/libdecnumber'

make[2]: Nothing to be done for `all'.

make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/libdecnumber'

make[2]: Entering directory `/mnt/clfs/sources/gcc-build/gcc'

make \

CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute " \

CONFIG_H="config.h auto-host.h ../../gcc-4.2.4/gcc/../include/ansidecl.h" \

MAKEOVERRIDES= \

-f libgcc.mk all

make[3]: Entering directory `/mnt/clfs/sources/gcc-build/gcc'

make GCC_FOR_TARGET="/mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/cross-tools/powerpc-unknown-linux-gnu/bin/ -B/cross-tools/powerpc-unknown-linux-gnu/lib/ -isystem /cross-tools/powerpc-unknown-linux-gnu/include -isystem /cross-tools/powerpc-unknown-linux-gnu/sys-include" \

AR_FOR_TARGET="/cross-tools/powerpc-unknown-linux-gnu/bin/ar" \

AR_CREATE_FOR_TARGET="/cross-tools/powerpc-unknown-linux-gnu/bin/ar rc" \

AR_EXTRACT_FOR_TARGET="/cross-tools/powerpc-unknown-linux-gnu/bin/ar x" \

AR_FLAGS_FOR_TARGET="" \

CC="gcc" CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute " \

BUILD_PREFIX="" \

BUILD_PREFIX_1="" \

LANGUAGES="" \

LIBGCC2_CFLAGS="-O2 -O2 -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -mlong-double-128 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc " \

MULTILIB_CFLAGS="" T= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o crtsavres.o

make[4]: Entering directory `/mnt/clfs/sources/gcc-build/gcc'

make[4]: `crtbegin.o' is up to date.

make[4]: `crtend.o' is up to date.

make[4]: `crtbeginS.o' is up to date.

make[4]: `crtendS.o' is up to date.

make[4]: `crtbeginT.o' is up to date.

make[4]: `ecrti.o' is up to date.

make[4]: `ecrtn.o' is up to date.

make[4]: `ncrti.o' is up to date.

make[4]: `ncrtn.o' is up to date.

make[4]: `crtsavres.o' is up to date.

make[4]: Leaving directory `/mnt/clfs/sources/gcc-build/gcc'

/mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/cross-tools/powerpc-unknown-linux-gnu/bin/ -B/cross-tools/powerpc-unknown-linux-gnu/lib/ -isystem /cross-tools/powerpc-unknown-linux-gnu/include -isystem /cross-tools/powerpc-unknown-linux-gnu/sys-include -O2 -O2 -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -mlong-double-128 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc/./libgcc.map -o ./libgcc_s.so.1.tmp libgcc/./_muldi3_s.o libgcc/./_negdi2_s.o libgcc/./_lshrdi3_s.o libgcc/./_ashldi3_s.o libgcc/./_ashrdi3_s.o libgcc/./_cmpdi2_s.o libgcc/./_ucmpdi2_s.o libgcc/./_clear_cache_s.o libgcc/./_enable_execute_stack_s.o libgcc/./_trampoline_s.o libgcc/./__main_s.o libgcc/./_absvsi2_s.o libgcc/./_absvdi2_s.o libgcc/./_addvsi3_s.o libgcc/./_addvdi3_s.o libgcc/./_subvsi3_s.o libgcc/./_subvdi3_s.o libgcc/./_mulvsi3_s.o libgcc/./_mulvdi3_s.o libgcc/./_negvsi2_s.o libgcc/./_negvdi2_s.o libgcc/./_ctors_s.o libgcc/./_ffssi2_s.o libgcc/./_ffsdi2_s.o libgcc/./_clz_s.o libgcc/./_clzsi2_s.o libgcc/./_clzdi2_s.o libgcc/./_ctzsi2_s.o libgcc/./_ctzdi2_s.o libgcc/./_popcount_tab_s.o libgcc/./_popcountsi2_s.o libgcc/./_popcountdi2_s.o libgcc/./_paritysi2_s.o libgcc/./_paritydi2_s.o libgcc/./_powisf2_s.o libgcc/./_powidf2_s.o libgcc/./_powixf2_s.o libgcc/./_powitf2_s.o libgcc/./_mulsc3_s.o libgcc/./_muldc3_s.o libgcc/./_mulxc3_s.o libgcc/./_multc3_s.o libgcc/./_divsc3_s.o libgcc/./_divdc3_s.o libgcc/./_divxc3_s.o libgcc/./_divtc3_s.o libgcc/./_fixunssfsi_s.o libgcc/./_fixunsdfsi_s.o libgcc/./_fixunsxfsi_s.o l ibgcc/./_fixsfdi_s.o libgcc/./_fixunssfdi_s.o libgcc/./_floatdisf_s.o libgcc/./_floatundisf_s.o libgcc/./_fixdfdi_s.o libgcc/./_fixunsdfdi_s.o libgcc/./_floatdidf_s.o libgcc/./_floatundidf_s.o libgcc/./_fixxfdi_s.o libgcc/./_fixunsxfdi_s.o libgcc/./_floatdixf_s.o libgcc/./_floatundixf_s.o libgcc/./_fixtfdi_s.o libgcc/./_fixunstfdi_s.o libgcc/./_floatditf_s.o libgcc/./_floatunditf_s.o libgcc/./_divdi3_s.o libgcc/./_moddi3_s.o libgcc/./_udivdi3_s.o libgcc/./_umoddi3_s.o libgcc/./_udiv_w_sdiv_s.o libgcc/./_udivmoddi4_s.o libgcc/./addsf3_s.o libgcc/./divsf3_s.o libgcc/./eqsf2_s.o libgcc/./gesf2_s.o libgcc/./lesf2_s.o libgcc/./mulsf3_s.o libgcc/./negsf2_s.o libgcc/./subsf3_s.o libgcc/./unordsf2_s.o libgcc/./fixsfsi_s.o libgcc/./floatsisf_s.o libgcc/./floatunsisf_s.o libgcc/./adddf3_s.o libgcc/./divdf3_s.o libgcc/./eqdf2_s.o libgcc/./gedf2_s.o libgcc/./ledf2_s.o libgcc/./muldf3_s.o libgcc/./negdf2_s.o libgcc/./subdf3_s.o libgcc/./unorddf2_s.o libgcc/./fixdfs i_s.o libgcc/./floatsidf_s.o libgcc/./floatunsidf_s.o libgcc/./extendsfdf2_s.o libgcc/./truncdfsf2_s.o libgcc/./tramp_s.o libgcc/./darwin-ldouble_s.o libgcc/./unwind-dw2_s.o libgcc/./unwind-dw2-fde-glibc_s.o libgcc/./unwind-sjlj_s.o libgcc/./gthr-gnat_s.o libgcc/./unwind-c_s.o -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so

/cross-tools/bin/powerpc-unknown-linux-gnu-ld: crti.o: No such file: No such file or directory

collect2: ld returned 1 exit status

make[3]: *** [libgcc_s.so] Error 1

make[3]: Leaving directory `/mnt/clfs/sources/gcc-build/gcc'

make[2]: *** [stmp-multilib] Error 2

make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/gcc'

make[1]: *** [all-gcc] Error 2

make[1]: Leaving directory `/mnt/clfs/sources/gcc-build'

make: *** [all] Error 2

 

 

It looks like crti.o that is needed is in /tools, but the linker is looking in /cross-tools, so that's the area in which I'm searching.  I have not deviated from the book.

 

Thanks, Anthony Drake



_______________________________________________
Clfs-support mailing list
Clfs-support <at> lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org
Ken Moffat | 8 Jul 2008 20:53

Re: CLFS for ppc on LFS 6.3 host

On Mon, Jul 07, 2008 at 12:23:05PM -0700, Anthony Drake wrote:
> After having difficulties with CLFS book 1.0.0-PowerPC, per Ken's suggestion I did try the current
clfs book Version SVN-20080629-PowerPC, and I was able to build everything up to and including glibc
OK, but the Cross Compiler Final step is failing with the linker not finding crti.o.
> crti.o is found at /tools/lib/crti.o, of course /tools is a link to /mnt/clfs/tools,
so the actual file is at /mnt/clfs/tools/lib/crti.o
> I've been extremely careful when entering the command line to build clfs, so I'm not sure what's wrong here.

 I'm baffled.  I've just completed this from one of my x86 LFS-6.3
systems.  Mine was fine, as I expected.  What baffles me is that
I've got a lot more going on.

> make output:make[1]: Entering directory `/mnt/clfs/sources/gcc-build'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/libiberty'
> make[3]: Entering directory `/mnt/clfs/sources/gcc-build/libiberty/testsuite'
> make[3]: Nothing to be done for `all'.
> make[3]: Leaving directory `/mnt/clfs/sources/gcc-build/libiberty/testsuite'
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/libiberty'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/fixincludes'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/fixincludes'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/intl'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/intl'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty'
> make[3]: Entering directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty/testsuite'
> make[3]: Nothing to be done for `all'.
> make[3]: Leaving directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty/testsuite'
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/fixincludes'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/fixincludes'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/libcpp'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/libcpp'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/libdecnumber'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/libdecnumber'

 Mine has a _lot_ more after it leaves libdecnumber, and among other
things that includes creating crtbegin.o and such like.
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/gcc'
> make \
> CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -Wmissing-format-attribute " \
> CONFIG_H="config.h auto-host.h ../../gcc-4.2.4/gcc/../include/ansidecl.h" \
> MAKEOVERRIDES= \
> -f libgcc.mk all
> make[3]: Entering directory `/mnt/clfs/sources/gcc-build/gcc'
 mine then shows

for d in libgcc; do \
          if [ -d $d ]; then true; else /bin/sh
../../gcc-4.2.4/gcc/../mkinstalldirs $d; fi; \
        done
mkdir -p -- libgcc

> make GCC_FOR_TARGET="/mnt/clfs/sources/gcc-build/./gcc/xgcc
-B/mnt/clfs/sources/gcc-build/./gcc/ -B/cross-tools/powerpc-unknown-linux-gnu/bin/
-B/cross-tools/powerpc-unknown-linux-gnu/lib/ -isystem
/cross-tools/powerpc-unknown-linux-gnu/include -isystem
/cross-tools/powerpc-unknown-linux-gnu/sys-include" \
> AR_FOR_TARGET="/cross-tools/powerpc-unknown-linux-gnu/bin/ar" \
> AR_CREATE_FOR_TARGET="/cross-tools/powerpc-unknown-linux-gnu/bin/ar rc" \
> AR_EXTRACT_FOR_TARGET="/cross-tools/powerpc-unknown-linux-gnu/bin/ar x" \
> AR_FLAGS_FOR_TARGET="" \
> CC="gcc" CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -Wmissing-format-attribute " \
> BUILD_PREFIX="" \
> BUILD_PREFIX_1="" \
> LANGUAGES="" \
> LIBGCC2_CFLAGS="-O2 -O2 -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC
-mlong-double-128 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc " \
> MULTILIB_CFLAGS="" T= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o
ncrti.o ncrtn.o crtsavres.o
> make[4]: Entering directory `/mnt/clfs/sources/gcc-build/gcc'
> make[4]: `crtbegin.o' is up to date.
> make[4]: `crtend.o' is up to date.
> make[4]: `crtbeginS.o' is up to date.
> make[4]: `crtendS.o' is up to date.
> make[4]: `crtbeginT.o' is up to date.
> make[4]: `ecrti.o' is up to date.
> make[4]: `ecrtn.o' is up to date.
> make[4]: `ncrti.o' is up to date.
> make[4]: `ncrtn.o' is up to date.
> make[4]: `crtsavres.o' is up to date.
> make[4]: Leaving directory `/mnt/clfs/sources/gcc-build/gcc'

 At this point mine has
[...]MULTILIB_CFLAGS="" T= crtbegin.o crtend.o crtbeginS.o
crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o crtsavres.o
make[4]: Entering directory `/mnt/lfs/building/gcc-build/gcc'
make[4]: `crtend.o' is up to date.
make[4]: `crtbeginS.o' is up to date.
make[4]: `crtendS.o' is up to date.
make[4]: `crtbeginT.o' is up to date.
cat ../../gcc-4.2.4/gcc/config/rs6000/eabi-ci.asm >ecrti.S

 it then runs through ecrtn.S ncrti.S ncrtn.S crtsaveres.S and then
creates mcrtn.o and crtsaveres.o.

> /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/
-B/cross-tools/powerpc-unknown-linux-gnu/bin/
-B/cross-tools/powerpc-unknown-linux-gnu/lib/ -isystem
/cross-tools/powerpc-unknown-linux-gnu/include -isystem
/cross-tools/powerpc-unknown-linux-gnu/sys-include -O2 -O2 -g -O2 -DIN_GCC -DCROSS_COMPILE -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem
./include -fPIC -mlong-double-128 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
-Dinhibit_libc -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1
-Wl,--version-script=libgcc/./libgcc.map -o ./libgcc_s.so.1.tmp libgcc/./_muldi3_s.o
libgcc/./_negdi2_s.o libgcc/./_lshrdi3_s.o libgcc/./_ashldi3_s.o libgcc/./_ashrdi3_s.o
libgcc/./_cmpdi2_s.o libgcc/./_ucmpdi2_s.o libgcc/./_clear_cache_s.o
libgcc/./_enable_execute_stack_s.o libgcc/./_trampoline_s.o libgcc/./__main_s.o
libgcc/./_absvsi2_s.o libgcc/./_absvdi2_s.o libgcc/./_addvsi3_s.o
>  libgcc/./_addvdi3_s.o libgcc/./_subvsi3_s.o libgcc/./_subvdi3_s.o libgcc/./_mulvsi3_s.o
libgcc/./_mulvdi3_s.o libgcc/./_negvsi2_s.o libgcc/./_negvdi2_s.o libgcc/./_ctors_s.o
libgcc/./_ffssi2_s.o libgcc/./_ffsdi2_s.o libgcc/./_clz_s.o libgcc/./_clzsi2_s.o
libgcc/./_clzdi2_s.o libgcc/./_ctzsi2_s.o libgcc/./_ctzdi2_s.o libgcc/./_popcount_tab_s.o
libgcc/./_popcountsi2_s.o libgcc/./_popcountdi2_s.o libgcc/./_paritysi2_s.o
libgcc/./_paritydi2_s.o libgcc/./_powisf2_s.o libgcc/./_powidf2_s.o libgcc/./_powixf2_s.o
libgcc/./_powitf2_s.o libgcc/./_mulsc3_s.o libgcc/./_muldc3_s.o libgcc/./_mulxc3_s.o
libgcc/./_multc3_s.o libgcc/./_divsc3_s.o libgcc/./_divdc3_s.o libgcc/./_divxc3_s.o
libgcc/./_divtc3_s.o libgcc/./_fixunssfsi_s.o libgcc/./_fixunsdfsi_s.o
libgcc/./_fixunsxfsi_s.o libgcc/./_fixsfdi_s.o libgcc/./_fixunssfdi_s.o
libgcc/./_floatdisf_s.o libgcc/./_floatundisf_s.o libgcc/./_fixdfdi_s.o
libgcc/./_fixunsdfdi_s.o libgcc/./_floatdidf_s.o
>  libgcc/./_floatundidf_s.o libgcc/./_fixxfdi_s.o libgcc/./_fixunsxfdi_s.o
libgcc/./_floatdixf_s.o libgcc/./_floatundixf_s.o libgcc/./_fixtfdi_s.o
libgcc/./_fixunstfdi_s.o libgcc/./_floatditf_s.o libgcc/./_floatunditf_s.o
libgcc/./_divdi3_s.o libgcc/./_moddi3_s.o libgcc/./_udivdi3_s.o libgcc/./_umoddi3_s.o
libgcc/./_udiv_w_sdiv_s.o libgcc/./_udivmoddi4_s.o libgcc/./addsf3_s.o libgcc/./divsf3_s.o
libgcc/./eqsf2_s.o libgcc/./gesf2_s.o libgcc/./lesf2_s.o libgcc/./mulsf3_s.o
libgcc/./negsf2_s.o libgcc/./subsf3_s.o libgcc/./unordsf2_s.o libgcc/./fixsfsi_s.o
libgcc/./floatsisf_s.o libgcc/./floatunsisf_s.o libgcc/./adddf3_s.o libgcc/./divdf3_s.o
libgcc/./eqdf2_s.o libgcc/./gedf2_s.o libgcc/./ledf2_s.o libgcc/./muldf3_s.o
libgcc/./negdf2_s.o libgcc/./subdf3_s.o libgcc/./unorddf2_s.o libgcc/./fixdfsi_s.o
libgcc/./floatsidf_s.o libgcc/./floatunsidf_s.o libgcc/./extendsfdf2_s.o
libgcc/./truncdfsf2_s.o libgcc/./tramp_s.o libgcc/./darwin-ldouble_s.o
>  libgcc/./unwind-dw2_s.o libgcc/./unwind-dw2-fde-glibc_s.o libgcc/./unwind-sjlj_s.o
libgcc/./gthr-gnat_s.o libgcc/./unwind-c_s.o -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ];
then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp
./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
> /cross-tools/bin/powerpc-unknown-linux-gnu-ld: crti.o: No such file: No such file or directory
> collect2: ld returned 1 exit status
> make[3]: *** [libgcc_s.so] Error 1
> make[3]: Leaving directory `/mnt/clfs/sources/gcc-build/gcc'
> make[2]: *** [stmp-multilib] Error 2
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/gcc'
> make[1]: *** [all-gcc] Error 2
> make[1]: Leaving directory `/mnt/clfs/sources/gcc-build'
> make: *** [all] Error 2
> It looks like crti.o that is needed is in /tools, but the linker is looking in /cross-tools, so that's the
area in which I'm searching.  I have not deviated from the book.
> Thanks, Anthony Drake

 Like I say, I've really no idea why yours is so different.  But
then, I try not to get too involved in the mechanics of the
toolchain.  It seems to think that a lot of the basic object files
(those which get linked into the executables gcc builds) don't need
to be made or re-made, which implies it might be confused about what
architecture it is building for, or where it should be building.

First question: for each of the two gcc builds, did you apply all of
the patches listed for that build, and only those patches, and did
you successfully add the STARTFILE_PREFIX_SPEC to the end of what
was in gcc/config/rs6000/linux.h ?

Second question: what do you have for CLFS_HOST and CLFS_TARGET ?  I
hope you're going to tell me i686-pc-linux-gnu and
powerpc-unknown-linux-gnu.

Third question: did you pass all the correct options to the binutils
configure ?

ĸen
--

-- 
das eine Mal als Tragödie, das andere Mal als Farce
_______________________________________________
Clfs-support mailing list
Clfs-support <at> lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org
Anthony Drake | 8 Jul 2008 22:26
Picon

Re: CLFS for ppc on LFS 6.3 host

Ken,

 

First, thank you for going to the trouble of helping me.

 

In answer to your question 1 below, I did apply all patches stated in chapter 5 of the book, and I did set STARTFILE_PREFIX_SPEC to "/tools/lib/" in gcc/config/rs6000/linux.h.  As I follow the steps I double check that sed operations and the like actually provide expected results, using diff or otherwise.

 

As regards question 2: CLFS_HOST="i686-cross-linux-gnu"; CLFS_TARGET="powerpc-unknown-linux-gnu".

 

For question 3, my command history is gone for all but the last attempt which does indeed compare correctly with the book, which incidentally built to completion with success.   Unfortunately the target for which I need to build ppc binaries is running a kernel version 2.4.21, which will not load and run a binary (hello world) built using my clfs cross compiler.

 

When I compiled and linked a hello world program with my clfs cross compiler without -static switch, the binary would report "file not found" when it was run on the target.  It was necessary to compile and link with -static switch to get the binary to run and report: FATAL: kernel too old, followed by Segmentation fault.  I suppose that the file not found indication was that the binary could not load a necessary library module.

 

The system integrator that supplied the target systems also has provided rpms for gcc, binutils, glib of the same vintage as their kernel, so I am now going to attempt to build the cross compiler using the package versions supplied by the integrator, although no patches are provided.

 

My goal is to be able to build a PAM aware passwd package, to be able to strengthen up the passwords on the target systems. 

 

Again, thank you sincerely for helping.  Please let me know if you have any other suggestions.  Regards,  Anthony Drake.



----- Original Message ----
From: Ken Moffat <zarniwhoop <at> ntlworld.com>
To: CLFS Support <clfs-support <at> lists.cross-lfs.org>
Sent: Tuesday, July 8, 2008 1:53:21 PM
Subject: Re: [Clfs-support] CLFS for ppc on LFS 6.3 host

On Mon, Jul 07, 2008 at 12:23:05PM -0700, Anthony Drake wrote:
> After having difficulties with CLFS book 1.0.0-PowerPC, per Ken's suggestion I did try the current clfs book Version SVN-20080629-PowerPC, and I was able to build everything up to and including glibc OK, but the Cross Compiler Final step is failing with the linker not finding crti.o.
> crti.o is found at /tools/lib/crti.o, of course /tools is a link to /mnt/clfs/tools, so the actual file is at /mnt/clfs/tools/lib/crti.o
> I've been extremely careful when entering the command line to build clfs, so I'm not sure what's wrong here.

I'm baffled.  I've just completed this from one of my x86 LFS-6.3
systems.  Mine was fine, as I expected.  What baffles me is that
I've got a lot more going on.

> make output:make[1]: Entering directory `/mnt/clfs/sources/gcc-build'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/libiberty'
> make[3]: Entering directory `/mnt/clfs/sources/gcc-build/libiberty/testsuite'
> make[3]: Nothing to be done for `all'.
> make[3]: Leaving directory `/mnt/clfs/sources/gcc-build/libiberty/testsuite'
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/libiberty'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/fixincludes'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/fixincludes'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/intl'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/intl'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty'
> make[3]: Entering directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty/testsuite'
> make[3]: Nothing to be done for `all'.
> make[3]: Leaving directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty/testsuite'
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/libiberty'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/fixincludes'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/build-i686-cross-linux-gnu/fixincludes'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/libcpp'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/libcpp'
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/libdecnumber'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/libdecnumber'

Mine has a _lot_ more after it leaves libdecnumber, and among other
things that includes creating crtbegin.o and such like.
> make[2]: Entering directory `/mnt/clfs/sources/gcc-build/gcc'
> make \
> CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute " \
> CONFIG_H="config.h auto-host.h ../../gcc-4.2.4/gcc/../include/ansidecl.h" \
> MAKEOVERRIDES= \
> -f libgcc.mk all
> make[3]: Entering directory `/mnt/clfs/sources/gcc-build/gcc'
mine then shows

for d in libgcc; do \
          if [ -d $d ]; then true; else /bin/sh
../../gcc-4.2.4/gcc/../mkinstalldirs $d; fi; \
        done
mkdir -p -- libgcc

> make GCC_FOR_TARGET="/mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/cross-tools/powerpc-unknown-linux-gnu/bin/ -B/cross-tools/powerpc-unknown-linux-gnu/lib/ -isystem /cross-tools/powerpc-unknown-linux-gnu/include -isystem /cross-tools/powerpc-unknown-linux-gnu/sys-include" \
> AR_FOR_TARGET="/cross-tools/powerpc-unknown-linux-gnu/bin/ar" \
> AR_CREATE_FOR_TARGET="/cross-tools/powerpc-unknown-linux-gnu/bin/ar rc" \
> AR_EXTRACT_FOR_TARGET="/cross-tools/powerpc-unknown-linux-gnu/bin/ar x" \
> AR_FLAGS_FOR_TARGET="" \
> CC="gcc" CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute " \
> BUILD_PREFIX="" \
> BUILD_PREFIX_1="" \
> LANGUAGES="" \
> LIBGCC2_CFLAGS="-O2 -O2 -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -mlong-double-128 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc " \
> MULTILIB_CFLAGS="" T= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o crtsavres.o
> make[4]: Entering directory `/mnt/clfs/sources/gcc-build/gcc'
> make[4]: `crtbegin.o' is up to date.
> make[4]: `crtend.o' is up to date.
> make[4]: `crtbeginS.o' is up to date.
> make[4]: `crtendS.o' is up to date.
> make[4]: `crtbeginT.o' is up to date.
> make[4]: `ecrti.o' is up to date.
> make[4]: `ecrtn.o' is up to date.
> make[4]: `ncrti.o' is up to date.
> make[4]: `ncrtn.o' is up to date.
> make[4]: `crtsavres.o' is up to date.
> make[4]: Leaving directory `/mnt/clfs/sources/gcc-build/gcc'

At this point mine has
[...]MULTILIB_CFLAGS="" T= crtbegin.o crtend.o crtbeginS.o
crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o crtsavres.o
make[4]: Entering directory `/mnt/lfs/building/gcc-build/gcc'
make[4]: `crtend.o' is up to date.
make[4]: `crtbeginS.o' is up to date.
make[4]: `crtendS.o' is up to date.
make[4]: `crtbeginT.o' is up to date.
cat ../../gcc-4.2.4/gcc/config/rs6000/eabi-ci.asm >ecrti.S

it then runs through ecrtn.S ncrti.S ncrtn.S crtsaveres.S and then
creates mcrtn.o and crtsaveres.o.

> /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/cross-tools/powerpc-unknown-linux-gnu/bin/ -B/cross-tools/powerpc-unknown-linux-gnu/lib/ -isystem /cross-tools/powerpc-unknown-linux-gnu/include -isystem /cross-tools/powerpc-unknown-linux-gnu/sys-include -O2 -O2 -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -mlong-double-128 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc/./libgcc.map -o ./libgcc_s.so.1.tmp libgcc/./_muldi3_s.o libgcc/./_negdi2_s.o libgcc/./_lshrdi3_s.o libgcc/./_ashldi3_s.o libgcc/./_ashrdi3_s.o libgcc/./_cmpdi2_s.o libgcc/./_ucmpdi2_s.o libgcc/./_clear_cache_s.o libgcc/./_enable_execute_stack_s.o libgcc/./_trampoline_s.o libgcc/./__main_s.o libgcc/./_absvsi2_s.o libgcc/./_absvdi2_s.o libgcc/./_addvsi3_s.o
>  libgcc/./_addvdi3_s.o libgcc/./_subvsi3_s.o libgcc/./_subvdi3_s.o libgcc/./_mulvsi3_s.o libgcc/./_mulvdi3_s.o libgcc/./_negvsi2_s.o libgcc/./_negvdi2_s.o libgcc/./_ctors_s.o libgcc/./_ffssi2_s.o libgcc/./_ffsdi2_s.o libgcc/./_clz_s.o libgcc/./_clzsi2_s.o libgcc/./_clzdi2_s.o libgcc/./_ctzsi2_s.o libgcc/./_ctzdi2_s.o libgcc/./_popcount_tab_s.o libgcc/./_popcountsi2_s.o libgcc/./_popcountdi2_s.o libgcc/./_paritysi2_s.o libgcc/./_paritydi2_s.o libgcc/./_powisf2_s.o libgcc/./_powidf2_s.o libgcc/./_powixf2_s.o libgcc/./_powitf2_s.o libgcc/./_mulsc3_s.o libgcc/./_muldc3_s.o libgcc/./_mulxc3_s.o libgcc/./_multc3_s.o libgcc/./_divsc3_s.o libgcc/./_divdc3_s.o libgcc/./_divxc3_s.o libgcc/./_divtc3_s.o libgcc/./_fixunssfsi_s.o libgcc/./_fixunsdfsi_s.o libgcc/./_fixunsxfsi_s.o libgcc/./_fixsfdi_s.o libgcc/./_fixunssfdi_s.o libgcc/./_floatdisf_s.o libgcc/./_floatundisf_s.o libgcc/./_fixdfdi_s.o libgcc/./_fixunsdfdi_s.o libgcc/./_floatdidf_s.o
>  libgcc/./_floatundidf_s.o libgcc/./_fixxfdi_s.o libgcc/./_fixunsxfdi_s.o libgcc/./_floatdixf_s.o libgcc/./_floatundixf_s.o libgcc/./_fixtfdi_s.o libgcc/./_fixunstfdi_s.o libgcc/./_floatditf_s.o libgcc/./_floatunditf_s.o libgcc/./_divdi3_s.o libgcc/./_moddi3_s.o libgcc/./_udivdi3_s.o libgcc/./_umoddi3_s.o libgcc/./_udiv_w_sdiv_s.o libgcc/./_udivmoddi4_s.o libgcc/./addsf3_s.o libgcc/./divsf3_s.o libgcc/./eqsf2_s.o libgcc/./gesf2_s.o libgcc/./lesf2_s.o libgcc/./mulsf3_s.o libgcc/./negsf2_s.o libgcc/./subsf3_s.o libgcc/./unordsf2_s.o libgcc/./fixsfsi_s.o libgcc/./floatsisf_s.o libgcc/./floatunsisf_s.o libgcc/./adddf3_s.o libgcc/./divdf3_s.o libgcc/./eqdf2_s.o libgcc/./gedf2_s.o libgcc/./ledf2_s.o libgcc/./muldf3_s.o libgcc/./negdf2_s.o libgcc/./subdf3_s.o libgcc/./unorddf2_s.o libgcc/./fixdfsi_s.o libgcc/./floatsidf_s.o libgcc/./floatunsidf_s.o libgcc/./extendsfdf2_s.o libgcc/./truncdfsf2_s.o libgcc/./tramp_s.o libgcc/./darwin-ldouble_s.o
>  libgcc/./unwind-dw2_s.o libgcc/./unwind-dw2-fde-glibc_s.o libgcc/./unwind-sjlj_s.o libgcc/./gthr-gnat_s.o libgcc/./unwind-c_s.o -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
> /cross-tools/bin/powerpc-unknown-linux-gnu-ld: crti.o: No such file: No such file or directory
> collect2: ld returned 1 exit status
> make[3]: *** [libgcc_s.so] Error 1
> make[3]: Leaving directory `/mnt/clfs/sources/gcc-build/gcc'
> make[2]: *** [stmp-multilib] Error 2
> make[2]: Leaving directory `/mnt/clfs/sources/gcc-build/gcc'
> make[1]: *** [all-gcc] Error 2
> make[1]: Leaving directory `/mnt/clfs/sources/gcc-build'
> make: *** [all] Error 2
> It looks like crti.o that is needed is in /tools, but the linker is looking in /cross-tools, so that's the area in which I'm searching.  I have not deviated from the book.
> Thanks, Anthony Drake

Like I say, I've really no idea why yours is so different.  But
then, I try not to get too involved in the mechanics of the
toolchain.  It seems to think that a lot of the basic object files
(those which get linked into the executables gcc builds) don't need
to be made or re-made, which implies it might be confused about what
architecture it is building for, or where it should be building.

First question: for each of the two gcc builds, did you apply all of
the patches listed for that build, and only those patches, and did
you successfully add the STARTFILE_PREFIX_SPEC to the end of what
was in gcc/config/rs6000/linux.h ?

Second question: what do you have for CLFS_HOST and CLFS_TARGET ?  I
hope you're going to tell me i686-pc-linux-gnu and
powerpc-unknown-linux-gnu.

Third question: did you pass all the correct options to the binutils
configure ?

ĸen
--
das eine Mal als Tragödie, das andere Mal als Farce
_______________________________________________
Clfs-support mailing list
Clfs-support <at> lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org
_______________________________________________
Clfs-support mailing list
Clfs-support <at> lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org
Ken Moffat | 8 Jul 2008 23:33

Re: CLFS for ppc on LFS 6.3 host

On Tue, Jul 08, 2008 at 01:26:33PM -0700, Anthony Drake wrote:
> Ken,
> First, thank you for going to the trouble of helping me.
> In answer to your question 1 below, I did apply all patches stated in chapter 5 of the book, and I did set
STARTFILE_PREFIX_SPEC to "/tools/lib/" in gcc/config/rs6000/linux.h.  As I follow the steps I
double check that sed operations and the like actually provide expected results, using diff or otherwise.
> As regards question 2: CLFS_HOST="i686-cross-linux-gnu"; CLFS_TARGET="powerpc-unknown-linux-gnu".
> For question 3, my command history is gone for all but the last attempt which does indeed compare correctly
with the book, which incidentally built to completion with success.

 So, that problem is gone.

>   Unfortunately the target for which I need to build ppc binaries is running a kernel version 2.4.21,
which will not load and run a binary (hello world) built using my clfs cross compiler.

 Yeah, this is the --enable-kernel=2.6.0 in the book.  One reason
for using that is that we moved to nptl instead of linux-threads.
You cannot run any current clfs under a 2.4 kernel.

 As to what version of glibc can run under a 2.4 kernel, I've no
idea.  Sorry I didn't spot that showstopper earlier.

ĸen
--

-- 
das eine Mal als Tragödie, das andere Mal als Farce
_______________________________________________
Clfs-support mailing list
Clfs-support <at> lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org
Joe Ciccone | 9 Jul 2008 01:04
Picon

Re: CLFS for ppc on LFS 6.3 host

Anthony Drake wrote:
>
>  
>
> It looks like crti.o that is needed is in /tools, but the linker is
> looking in /cross-tools, so that's the area in which I'm searching.  I
> have not deviated from the book.
>
>
Two things to check. When you built binutils are you sure that you
remembered --with-lib-path=/tools/lib ?
strings /cross-tools/bin/*-ld | grep /tools/lib

And are the crt.o objects compiled for the correct architecture? One
that your binutils understands and can read. Can confirm this with file.
Anthony Drake | 9 Jul 2008 15:37
Picon

Re: CLFS for ppc on LFS 6.3 host

Ken, Joe,
 
glibc on the target system is 2.1.3.  It's (libc's) version herald states linuxthreads-0.8.   I do have rpm packages for binutils, glib, and gcc of the versions used to build the target system, so my next effort is to attempt to build a cross compiler environment of those packages.   I will use either RH 7.2 or a slightly later version of RH to try to build, and I will use as much of the clfs procedure as possible.
 
Thanks again, Anthony Drake


----- Original Message ----
From: Ken Moffat <zarniwhoop <at> ntlworld.com>
To: CLFS Support <clfs-support <at> lists.cross-lfs.org>
Sent: Tuesday, July 8, 2008 4:33:51 PM
Subject: Re: [Clfs-support] CLFS for ppc on LFS 6.3 host

On Tue, Jul 08, 2008 at 01:26:33PM -0700, Anthony Drake wrote:
> Ken,
> First, thank you for going to the trouble of helping me.
> In answer to your question 1 below, I did apply all patches stated in chapter 5 of the book, and I did set STARTFILE_PREFIX_SPEC to "/tools/lib/" in gcc/config/rs6000/linux.h.  As I follow the steps I double check that sed operations and the like actually provide expected results, using diff or otherwise.
> As regards question 2: CLFS_HOST="i686-cross-linux-gnu"; CLFS_TARGET="powerpc-unknown-linux-gnu".
> For question 3, my command history is gone for all but the last attempt which does indeed compare correctly with the book, which incidentally built to completion with success.

So, that problem is gone.

>   Unfortunately the target for which I need to build ppc binaries is running a kernel version 2.4.21, which will not load and run a binary (hello world) built using my clfs cross compiler.

Yeah, this is the --enable-kernel=2.6.0 in the book.  One reason
for using that is that we moved to nptl instead of linux-threads.
You cannot run any current clfs under a 2.4 kernel.

As to what version of glibc can run under a 2.4 kernel, I've no
idea.  Sorry I didn't spot that showstopper earlier.

ĸen
--
das eine Mal als Tragödie, das andere Mal als Farce
_______________________________________________
Clfs-support mailing list
Clfs-support <at> lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org
_______________________________________________
Clfs-support mailing list
Clfs-support <at> lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org
Anthony Drake | 9 Jul 2008 17:29
Picon

Re: CLFS for ppc on LFS 6.3 host

Ken, Joe,
 
Good news: hello world program compiled with CLFS cross compiler runs on one of the targets that has a 2.6 kernel installed.
 
It will only run when compiled with the -static switch to gcc, and it's 2.5M in size:
 
 v4 <at> v4-130: [~]#ls -al
drwx------    2 v4       users        1024 Jul  9 14:33 .
drwxr-xr-x    3 root     root         1024 May 22 16:55 ..
-rw-------    1 v4       users          88 Jul  9 14:26 .bash_history
-rwxr-xr-x    1 v4       users     2600205 Jul 10  2008 hello
-rwxr-xr-x    1 v4       users        30 22 Jul 10  2008 helloworld
-rwxr-xr-x    1 v4       users       12143 Jul 10  2008 hw
 
hello is linked with -static:
v4 <at> v4-130 [~]# ./hello
Hello world
 
hw is linked without -static:
v4 <at> v4-130 [~]# ./hw
-bash: ./hw: No such file or directory
 
libc.so.6 is a link:
v4 <at> v4-130 [v4]# ls -l /opt/ppc/powerpc-linux/lib/libc.so.6
lrwxrwxrwx    1 root     root           13 May 22 16:55 /opt/ppc/powerpc-linux/lib/libc.so.6 -> libc-2.2.5.so
libc-2.2.5.so will not run (I was trying to see it's version at cmd line):
v4 <at> v4-130 [v4]# /opt/ppc/powerpc-linux/lib/libc-2.2.5.so
bash: /opt/ppc/powerpc-linux/lib/libc-2.2.5.so: No such file or directory
This behavior of library functions emitting this "No such file or directory" print statement is so wierd.  I'm just a little over my head when delving into glibc: I've written applications on linux/unix/xenix systems since the mid 80's, and embedded systems since the late 80's, but never learned the nuances of linux/glibc/gcc, but I'm learning, no small thanks to CLFS.
 
My next step is to try to compile passwd.  Anyway, thanks for your help.   I'm certainly encouraged that the cross compiler built executable will run on the target.   If there's anything obvious here please let me know.
 
Regards, Anthony.

 
_______________________________________________
Clfs-support mailing list
Clfs-support <at> lists.cross-lfs.org
http://lists.cross-lfs.org/listinfo.cgi/clfs-support-cross-lfs.org

Gmane