On 1/26/06, Jeremy Huntwork <[EMAIL PROTECTED]> wrote:
> taken care of by the startfile_prefix_spec.
>
> I intend to leave the static binutils and ld-new symlink in, so that we
> don't have to carry over the saved binutils dirs from chapter 5.

This won't work.  gcc does not respect PATH.  Unless you have
-B/usr/bin/ in there, it will not use ld-new.

Here's what it looks like with the *startfile_prefix_spec: stuff. 
Because I don't have the static ld-new in this build, I kept the
/tools adjusted ld to show that it won't work.  I made a stupic
symlink, too, to show that it will still compile, but with the old ld.

# ln -svf /bin/bash /usr/bin/ld
create symbolic link `/usr/bin/ld' to `/bin/bash'
# cc -print-prog-name=ld
/tools/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../i686-pc-linux-gnu/bin/ld

gcc doesn't care about PATH.

# cc dummy.c -Wl,--verbose &> dummy.log
# echo $?
0

Still successful despite
# ls -l `type -p ld`
lrwxrwxrwx 1 root root 9 Jan 26 08:23 /usr/bin/ld -> /bin/bash

Now the sanity checks:
# grep SEARCH_DIR dummy.log
SEARCH_DIR("/tools/i686-pc-linux-gnu/lib"); SEARCH_DIR("/tools/lib");

# readelf -l a.out | grep ld-linux
      [Requesting program interpreter: /lib/ld-linux.so.2]

# grep succ dummy.log
attempt to open /usr/lib/crt1.o succeeded
attempt to open /usr/lib/crti.o succeeded
attempt to open /tools/lib/gcc/i686-pc-linux-gnu/4.0.2/crtbegin.o succeeded
attempt to open /tmp/ccGraUSr.o succeeded
attempt to open /tools/lib/gcc/i686-pc-linux-gnu/4.0.2/libgcc.a succeeded
attempt to open /tools/lib/libgcc_s.so succeeded
attempt to open /tools/lib/libc.so succeeded
attempt to open /tools/lib/libc.so.6 succeeded
attempt to open /tools/lib/libc_nonshared.a succeeded
attempt to open /tools/lib/gcc/i686-pc-linux-gnu/4.0.2/libgcc.a succeeded
attempt to open /tools/lib/libgcc_s.so succeeded
attempt to open /tools/lib/gcc/i686-pc-linux-gnu/4.0.2/crtend.o succeeded
attempt to open /usr/lib/crtn.o succeeded

OK, this isn't a fair test since I don't actually have the adjusted ld
installed anywhere.


The way it is right now, we still need to keep the pass 2 binutils. 
If you want to make a symlink in /usr/bin/ld, then you need
-B/usr/bin/.

--
Dan
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to