having trouble with ld, and compiling gcc

first last bltchgrandma at hotmail.com
Wed Aug 4 09:31:09 PDT 2004


>Setting up host
  - Installed Fedora Core with little more than the neccesary packages.
    * Mounted / to /dev/hdb1.
    * Mounted swap to /dev/hdb2.
    * Free space is availible at /dev/hdb for /mnt/lfs/
  - Mounted a Hard Drive (/dev/hdc1) to /mnt/backup/.
  - Compiled mplayer to check the compiler, and so I can use it.
    * Works

>LFS book 5.1 - Chapter 1

>LFS book 5.1 - Chapter 2
  - Used fdisk to create /dev/hdb3
  - Rebooting
    * Rebooted
    * Re-mounting /dev/hdc1 /mnt/backup/
  - mke2fs /dev/hdb3
  - export LFS=/mnt/lfs (checked with printenv)
  - mount /dev/hdb3 $LFS

>LFS book 5.1 - Chapter 3
  - mkdir $LFS/sources
  - chmod a+wt $LFS/sources
  - I have packages and patches on /mnt/backup
    * using vim 6.3, grep 2.5 and less 381 because book v. is not availible.
    * I didn't think ^ packages were weird/important eneough to cause 
problems.

>LFS book 5.1 - Chapter 4
  - mkdir $LFS/tools
  - ln -s $LFS/tools /
  - useradd -s /bin/bash -m -k /dev/null lfs
  - passwd lfs
  - chown lfs $LFS/tools
  - chown lfs $LFS/sources
  - logged in as lfs
    * everthing from now on will be done as lfs unless otherwise specified.
  - ~/.bash_profile << "EOF"
    * exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
    * EOF
  - cat > ~/.bashrc << "EOF"
    * set +h
    * umask 022
    * LFS=/mnt/lfs
    * LC_ALL=POSIX
    * PATH=/tools/bin:/bin:/usr/bin
    * export LFS LC_ALL PATH
    * EOF
  - copied sources and patches from /mnt/backup to $LFS/sources
  - cd $LFS/sources/
  - tar jxf binutils-2.14.tar.bz2
  - cd binutils-2.14

>LFS book 5.1 - Chapter 5
  - mkdir ../binutils-build
  - cd ../binutils-build
  - time { ../binutils-2.14/configure --prefix=/tools --disable-nls && make 
configure-host && make LDFLAGS="-all-static" && make install; }
    * 1 SBU = 4m 17s
  - cd $LFS/sources
  - tar jxf gcc-core-3.3.3.tar.bz2
  - cd gcc-3.3.3
  - mkdir ../gcc-build
  - cd ../gcc-build
  - ../gcc-3.3.3/configure --prefix=/tools \
    * --with-local-prefix=/tools \
    * --disable-nls --enable-shared \
    * --enable-languages=c
  - Fails!
    * Here is the output:
        Configuring for a i686-pc-linux-gnu host.
        Created "Makefile" in /mnt/lfs/sources/gcc-build using "mt-frag"
        /tools/bin/ld: unrecognized option '--as-needed'
        /tools/bin/ld: use the --help option for usage information
        collect2: ld returned 1 exit status
        *** The command 'gcc -o conftest -g -O2   conftest.c' failed.
        *** You must set the environment variable CC to a working compiler.

I got rid of /tools symlink last time this happened and I didn't get this
problem, but I had more problems later. So I thought I should start over, 
and
make sure I was doing everything right before I asked questions.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the lfs-support mailing list