LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Compiling Binutils 2.20.1 (https://www.linuxquestions.org/questions/linux-from-scratch-13/compiling-binutils-2-20-1-a-912470/)

lfs_mm 11-08-2011 08:23 AM

Compiling Binutils 2.20.1
 
Hello everybody

I try to compile binutils 2.20.1 with the LFS Manual 6.7. I use a UBUNTU 11.10 as a host system. I use the following configure:

Code:

../binutils-2.20.1/configure --target=$LFS_TGT --prefix=/tools --disable-nls --disable-werror
I get the following error:

Code:

gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I../../binutils-2.20.1/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  ../../binutils-2.20.1/libiberty/regex.c -o regex.o
../../binutils-2.20.1/libiberty/regex.c:130:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
../../binutils-2.20.1/libiberty/regex.c:130:7: warning: conflicting types for built-in function 'malloc' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c:131:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
../../binutils-2.20.1/libiberty/regex.c:131:7: warning: conflicting types for built-in function 'realloc' [enabled by default]
In file included from /usr/include/i386-linux-gnu/bits/string2.h:1298:0,
                from /usr/include/string.h:637,
                from ../../binutils-2.20.1/libiberty/regex.c:149:
/usr/include/stdlib.h:471:14: error: conflicting types for 'malloc'
../../binutils-2.20.1/libiberty/regex.c:130:7: note: previous declaration of 'malloc' was here
In file included from ../../binutils-2.20.1/libiberty/regex.c:638:0:
../../binutils-2.20.1/libiberty/regex.c: In function 'byte_regex_compile':
../../binutils-2.20.1/libiberty/regex.c:2439:7: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]
../../binutils-2.20.1/libiberty/regex.c:2439:33: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c:2500:17: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c:2533:36: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c:2640:28: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c:3643:26: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c:4150:5: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c: In function 'byte_re_compile_fastmap':
../../binutils-2.20.1/libiberty/regex.c:4835:11: warning: implicit declaration of function 'abort' [-Wimplicit-function-declaration]
../../binutils-2.20.1/libiberty/regex.c:4835:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c: In function 'byte_re_match_2_internal':
../../binutils-2.20.1/libiberty/regex.c:7143:27: warning: variable 'sdummy' set but not used [-Wunused-but-set-variable]
../../binutils-2.20.1/libiberty/regex.c:7142:22: warning: variable 'pdummy' set but not used [-Wunused-but-set-variable]
../../binutils-2.20.1/libiberty/regex.c:7423:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c: In function 'xregcomp':
../../binutils-2.20.1/libiberty/regex.c:7977:4: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c: In function 'xregexec':
../../binutils-2.20.1/libiberty/regex.c:8052:7: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c: In function 'xregerror':
../../binutils-2.20.1/libiberty/regex.c:8080:5: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.20.1/libiberty/regex.c: In function 'xregfree':
../../binutils-2.20.1/libiberty/regex.c:8114:5: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
make[2]: *** [regex.o] Error 1
make[2]: Leaving directory `/media/lfs/sources/binutils-build/libiberty'
make[1]: *** [all-libiberty] Error 2
make[1]: Leaving directory `/media/lfs/sources/binutils-build'
make: *** [all] Error 2

First at all i search with help from google if anybody had a similar problem but i couldn't find anything.
Secondly, how can I solve such problems by myself? the config.log file has no further information about the error above. How can I narrow down the problem?
Can anybody give me some advice about the error above?

Greetings

spiky0011 11-08-2011 08:59 AM

Did you make sure the host system is compliant by running the version check script

lfs_mm 11-08-2011 09:36 AM

OUTPUT of the test:

Code:


bash, version 4.2.10(1)-release
/bin/sh -> /bin/dash
Binutils: (GNU Binutils for Ubuntu) 2.21.53.20110810
version-check.sh: line 7: bison: command not found
yacc not found
bzip2,  Version 1.0.5, 10-Dec-2007.
Coreutils:  8.5
diff (GNU diffutils) 3.0
find (GNU findutils) 4.4.2
version-check.sh: line 15: gawk: command not found
/usr/bin/awk -> /usr/bin/mawk
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
version-check.sh: line 20: /lib/libc.so.6: No such file or directory
grep (GNU grep) 2.9
gzip 1.3.12
Linux version 3.0.0-12-generic (buildd@vernadsky) (gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011
version-check.sh: line 24: m4: command not found
GNU Make 3.81
version-check.sh: line 26: patch: command not found
Perl version='5.12.4';
GNU sed version 4.2.1
tar (GNU tar) 1.25
version-check.sh: line 30: makeinfo: command not found
Texinfo:
Compilation OK


I am using the LFS Manual more as a guideline to prepare my own toolchain.

Greetings

spiky0011 11-08-2011 09:49 AM

So there are a few problems there these need to be fixed 1st. Apt get can get the packages you require then check version check again restart build fromscratch

lfs_mm 11-08-2011 03:26 PM

Ok i try to fix it.

spiky0011 11-08-2011 03:31 PM

you still have some errors in the output.
version-check.sh: line 20: /lib/libc.so.6: No such file or directory
version-check.sh: line 26: patch: command not found
version-check.sh: line 30: makeinfo: command not found
These need to be fixed

lfs_mm 11-08-2011 03:56 PM

sorry i post the last one too early... i saw that too... at the moment the output looks like this:

Code:

bash, version 4.2.10(1)-release
/bin/sh -> /bin/dash
Binutils: (GNU Binutils for Ubuntu) 2.21.53.20110810
bison (GNU Bison) 2.4.1
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2,  Version 1.0.5, 10-Dec-2007.
Coreutils:  8.5
diff (GNU diffutils) 3.0
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
version-check.sh: line 20: /lib/libc.so.6: No such file or directory
grep (GNU grep) 2.9
gzip 1.3.12
Linux version 3.0.0-12-generic (buildd@vernadsky) (gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.12.4';
GNU sed version 4.2.1
tar (GNU tar) 1.25
Texinfo: makeinfo (GNU texinfo) 4.13
Compilation OK

The following error "/lib/libc.so.6: No such file or directory" is due to the fact, that the library is under /lib/i386-linux-gnu/libc.so.6. What should I do about that?

spiky0011 11-08-2011 04:10 PM

I had to make a symlink for it to work on mine
Code:

sudo ln -s /lib/i386-linux-gnu/libc-2.13.so /lib/libc.so.6

lfs_mm 11-08-2011 04:21 PM

Ok now everything is fine with the symlink. But i'm stuck again until I compile the binutils 2.20.1. It is the same error as above. Any further suggestions? The error is mentioning something about that two declarations of malloc are found isn't it? Do I have to exclude a specific path for the make command for further progress?

spiky0011 11-08-2011 04:29 PM

what is the output of echo $LFS

lfs_mm 11-08-2011 04:33 PM

echo $LFS => /media/lfs

this is another harddrive. The lfs has the /tools & /sources folders.
Just 2 minutes before i tried to compile binutils with the root rights and i did work... something with my lfs user is quite not right... ???

spiky0011 11-08-2011 04:40 PM

What isz the output of
Code:

ls -l /lib/libc.*
on host system mine is
lrwxrwxrwx 1 root root 32 2011-10-10 19:16 /lib/libc.so.6 -> /lib/i386-linux-gnu/libc-2.13.so

lfs_mm 11-08-2011 04:43 PM

lfs@marius-HP-Pavilion-dv9500-Notebook-PC:~$ ls -l /lib/libc.*
lrwxrwxrwx 1 root root 29 Nov 8 23:15 /lib/libc.so.6 -> /lib/i386-linux-gnu/libc.so.6

The same output as yours.

spiky0011 11-08-2011 04:46 PM

No yours is different mine points to i386-linux-gnu/libc-2.13.so yours is /libc.so.6. did you pass the version check

lfs_mm 11-08-2011 04:53 PM

yes, i thought that i take the same static library as from the test output:

Code:

lfs@marius-HP-Pavilion-dv9500-Notebook-PC:~$ bash version-check.sh
bash, version 4.2.10(1)-release
/bin/sh -> /bin/dash
Binutils: (GNU Binutils) 2.19.1
bison (GNU Bison) 2.4.1
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2,  Version 1.0.5, 10-Dec-2007.
Coreutils:  8.5
diff (GNU diffutils) 3.0
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
GNU C Library (Ubuntu EGLIBC 2.13-20ubuntu5) stable release version 2.13
grep (GNU grep) 2.9
gzip 1.3.12
Linux version 3.0.0-12-generic (buildd@vernadsky) (gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.12.4';
GNU sed version 4.2.1
tar (GNU tar) 1.25
Texinfo: makeinfo (GNU texinfo) 4.13
Compilation OK



All times are GMT -5. The time now is 12:27 AM.