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

Anthony Drake agmotorsvc at verizon.net
Tue Jul 8 13:26:33 PDT 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clfs.org/pipermail/clfs-support-clfs.org/attachments/20080708/e7957fb1/attachment-0001.htm>


More information about the Clfs-support mailing list