one more try with binutils ... anybody ?

Olaf Gruettner olaf.gruettner at web.de
Sat Dec 25 18:46:29 PST 2004


Hi,
still having problems compiling binutils-first pass, but getting closer:

Preparation:
1: 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
lfs:~$ source ~/.bash_profile
lfs:~$ echo $LFS
/mnt/lfs

2: lfs:~$ cat /proc/version
Linux version 2.4.20 (root at compi1) (gcc version 3.2) #2 SMP Son Mai 2
11:48:43 CEST 2004
I know this is a 2.4 kernel, but this shouldn´t be a problem until ...?!

3:ld --verbose | grep SEARCH
SEARCH_DIR("/usr/i686-pc-linux-gnu/lib"); SEARCH_DIR("/usr/lib");
SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib");

4: ../binutils-2.15.91.0.2/configure --prefix=/tools --disable-nls
creating cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... yes
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for gnatbind... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16
$$f1 $$f2
checking for correct version of gmp.h... yes
checking for mpf_init in -lgmp... yes
checking for bison... bison
checking for bison... bison -y
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for i686-pc-linux-gnu-ar... no
checking for ar... ar
checking for i686-pc-linux-gnu-as... no
checking for as... as
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... dlltool
checking for i686-pc-linux-gnu-ld... no
checking for ld... ld
checking for i686-pc-linux-gnu-nm... no
checking for nm... nm
checking for i686-pc-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking for i686-pc-linux-gnu-windres... no
checking for windres... windres
checking for i686-pc-linux-gnu-objcopy... no
checking for objcopy... objcopy
checking for i686-pc-linux-gnu-objdump... no
checking for objdump... objdump
checking for i686-pc-linux-gnu-ar... no
checking for ar... ar
checking for i686-pc-linux-gnu-as... no
checking for as... as
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... dlltool
checking for i686-pc-linux-gnu-ld... no
checking for ld... ld
checking for i686-pc-linux-gnu-nm... no
checking for nm... nm
checking for i686-pc-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking for i686-pc-linux-gnu-windres... no
checking for windres... windres
checking whether to enable maintainer-specific portions of Makefiles...
no
checking if symbolic links between directories work... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
lfs:/mnt/lfs/sources/binutils-build$ make configure-host
Configuring in libiberty
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles...
no
checking for makeinfo... makeinfo
checking for perl... perl
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for i686-pc-linux-gnu-ar... ar
checking for i686-pc-linux-gnu-ranlib... ranlib
checking for i686-pc-linux-gnu-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C
compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make: *** [configure-libiberty] Error 1



5: checking for errors !

touch test
lfs:/mnt/lfs/sources/binutils-build$ rm test
lfs:/mnt/lfs/sources/binutils-build$ vi test.c
lfs:/mnt/lfs/sources/binutils-build$ gcc test.c
lfs:/mnt/lfs/sources/binutils-build$ a.out
bash: a.out: command not found
lfs:/mnt/lfs/sources/binutils-build$ ./a.out
bash: ./a.out: No such file or directory
lfs:/mnt/lfs/sources/binutils-build$ ls
Makefile  a.out  config.cache  config.log  config.status  libiberty 
serdep.tmp  test.c
lfs:/mnt/lfs/sources/binutils-build$ ./a.out
bash: ./a.out: No such file or directory
lfs:/mnt/lfs/sources/binutils-build$ ls -l
total 268
-rw-r--r--    1 lfs      lfs        222144 Dec 26 03:21 Makefile
-rwxr-xr-x    1 lfs      lfs         10947 Dec 26 03:22 a.out
-rw-r--r--    1 lfs      lfs          3714 Dec 26 03:21 config.cache
-rw-r--r--    1 lfs      lfs          2943 Dec 26 03:21 config.log
-rwxr-xr-x    1 lfs      lfs         10428 Dec 26 03:21 config.status
drwxr-xr-x    2 lfs      lfs          4096 Dec 26 03:21 libiberty
-rw-r--r--    1 lfs      lfs            13 Dec 26 03:21 serdep.tmp
-rw-r--r--    1 lfs      lfs            11 Dec 26 03:22 test.c
lfs:/mnt/lfs/sources/binutils-build$ readelf -l a.out
 
Elf file type is EXEC (Executable file)
Entry point 0x8048250
There are 6 program headers, starting at offset 52
 
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg
Align
  PHDR           0x000034 0x08048034 0x08048034 0x000c0 0x000c0 R E 0x4
  INTERP         0x0000f4 0x080480f4 0x080480f4 0x00019 0x00019 R   0x1
      [Requesting program interpreter: /tools/lib/ld-linux.so.2]
  LOAD           0x000000 0x08048000 0x08048000 0x00374 0x00374 R E
0x1000
  LOAD           0x000374 0x08049374 0x08049374 0x00100 0x00104 RW 
0x1000
  DYNAMIC        0x000384 0x08049384 0x08049384 0x000c8 0x000c8 RW  0x4
  NOTE           0x000110 0x08048110 0x08048110 0x00020 0x00020 R   0x4
                                                                                                            
 Section to Segment mapping:
  Segment Sections...
   00
   01     .interp
   02     .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version
.gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata
   03     .data .eh_frame .dynamic .ctors .dtors .jcr .got .bss
   04     .dynamic
   05     .note.ABI-tag

lfs:/mnt/lfs/sources/binutils-build$ echo $PATH
/tools/bin:/bin:/usr/bin

lfs:/mnt/lfs/sources/binutils-build$ more /etc/ld.so.conf
# Begin /etc/ld.so.conf
 
/usr/local/lib
/opt/lib
/usr/X11R6/lib
 
/usr/lib
/usr/lib/mozilla-1.4
lfs:/mnt/lfs/sources/binutils-build$



needless to say, that there is no program interpreter in /tools/lib/...
[Requesting program interpreter: /tools/lib/ld-linux.so.2]

no wonder, testprograms like a.out wont execute. but why is gcc from the
host system trying to link to a program interpreter in /tools/lib/... ,
a directory which is not even existent?

the book explicitly says to have a PATH which starts with 
/tools/bin/ 
this strikes me,
but how can I solve my problem?

any ideas?
Olaf





More information about the lfs-support mailing list