gcc ch5 :-(

Declan Moriarty junk_mail at iol.ie
Thu Dec 15 08:38:32 PST 2005


Recently, Somebody Somewhere wrote these words
> You don't have ssp guard functions in libc. Either you're still
> linking to /lib because you didn't use the gcc x86_specs patch,
> or you disabled it in uclibc or didn't use the uclibc config
> patch. Check the test in the adjusting toolchain page and double
> check you're linking to /tools/lib. If you are then double check
> that you used all the uclibc patches.

Sorry to be a pain on this one...

I think I did those things all right, but the hardened-specs.sh
wasn't changing the specs,  and I did have issues. It's
small, so I wiped it.  After a couple of tries here I convinced
myself I have a problem, with an error repeating over 2 builds.
So I wiped, and went over this slowly, logging as I went.

Linux-libc-headers:     pseudo_random patch

uclibc headers:         config-1 patch

binutils cross:         uClibc_conf-1 patch, make etc, remake ld

gcc cross compiler      uClibc_conf-1, sed, specs_x86-1, echo &
			touch, etc.

uClibc		arc4random-2, config-1, libc_stack_end-1
		patches, install locales, 7 sed commands to 
		rules.mak & .config, make, rm includes, install

Adjusting the toolchain: Requesting program interpreter:
		/tools/lib/ld-uClibc.so.0

binutils (2)    uClibc_conf-1, pt_pax-1 patches, env..configure,
		etc., remake ld.

gcc (2)         uClibc_conf-1, uClibc_libstdc++-1, uClibc_locale-1 
		patches, sed, ssp-1 patch, another sed, specs_x86-1, 
  		no_fixincludes-1 patches, mkdir & cd, env..configure,
                make, install, link cc, install script, harden specs.
		write test.c. This fails to compile as follows:

hlfs:/mnt/hlfs/sources/gcc-build$ gcc -o test test.c
/mnt/hlfs/tools/bin/../lib/gcc/i686-tools-linux-uclibc/3.4.4/../../../../i686-tools-linux-uclibc/bin/ld:
unrecognized option '-p'
/mnt/hlfs/tools/bin/../lib/gcc/i686-tools-linux-uclibc/3.4.4/../../../../i686-tools-linux-uclibc/bin/ld:
use the --help option for usage information
collect2: ld returned 1 exit status

I also took a copy of $(gcc --print-file specs) before & after the
hardened-specs script was run, and
they are different (3917 and 4312 bytes resp.). I seem to be
linking against /tools

hlfs:/mnt/hlfs/sources/gcc-build$ ldd /tools/bin/cc
        libc.so.0 => /tools/lib/libc.so.0 (0xb7f04000)
        ld-uClibc.so.0 => /tools/lib/ld-uClibc.so.0 (0xb7f9c000)


ld doesn't have a -p option. No CFLAGS or LDFLAGS are set. I
initially suspected perl, but it runs spamassassin with no errors
here and did alter the specs. 

-- 

	With best Regards,


	Declan Moriarty.



More information about the hlfs-dev mailing list