Opened 12 years ago
Closed 12 years ago
#3104 closed task (fixed)
no perl-5.16.0-libc-1.patch and perl-5.16.0 can't be built in toolchain
Reported by: | xinglp | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.2 |
Component: | Book | Version: | SVN |
Severity: | normal | Keywords: | |
Cc: |
Description
I've tried to use perl-5.14.2-libc-1.patch and the log below:
Checking your choice of C compiler and flags for coherency... I've tried to compile and run the following simple program: #include <stdio.h> int main() { printf("Ok\n"); return(0); } I used the command: cc -o try -O2 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fstack-protector -L/usr/local/lib try.c -lnsl -lgdbm -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ./try and I got the following output: /xxxxxx/xxxxxxx/xxxxxxx/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lgdbm collect2: error: ld returned 1 exit status I can't compile the test program. You have a BIG problem. Shall I abort Configure [y] Ok. Stopping Configure.
Change History (15)
follow-up: 2 comment:1 by , 12 years ago
comment:2 by , 12 years ago
Replying to matthew@…:
I've committed the libc patch now. Alas, I can't reproduce your problem. Both chapter 5 and chapter 6 builds completed fine. I get
Let me guess what the preprocessor flags are... Any additional ld flags (NOT including libraries)? [ -fstack-protector] Checking your choice of C compiler and flags for coherency... Computing filename position in cpp output for #include directives... <stdlib.h> found.
I have tried to do it start over again, same error. But I can build it without use jhalfs, I think some environment affect this.
follow-up: 5 comment:4 by , 12 years ago
Replying to xinglp:
Finally, I install gdbm before perl to make it work.
Well, that's obviously not the right thing to do (I appreciate it got it to work for you, but it shouldn't be necessary). It looks like your Perl build is picking up GDBM headers/libs from your host but then when it tries to compile/link against them in the configure stage, it can't find them again (presumably because the perl libc patch changes have come into effect at that point).
comment:5 by , 12 years ago
Replying to matthew@…:
Replying to xinglp:
Finally, I install gdbm before perl to make it work.
Well, that's obviously not the right thing to do (I appreciate it got it to work for you, but it shouldn't be necessary). It looks like your Perl build is picking up GDBM headers/libs from your host but then when it tries to compile/link against them in the configure stage, it can't find them again (presumably because the perl libc patch changes have come into effect at that point).
My host is lfs SVN-20120524 with 3.4 kernel
follow-up: 7 comment:6 by , 12 years ago
After applying the libc patch im occuring exact the same error while compiling perl for the toolchain.
what libraries to use? [-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat]
I used the command:
cc -o try -O2 -fno-strict-aliasing -pipe -fstack-protector -fstack-protector try.c -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
./try
then it fails
It fails on -lgdbm -ldb -ldbm_compact( debian library ? )
So there is still a hardwired link in either hints/linux.sh or any other place.
comment:7 by , 12 years ago
After running Configure -Dprefix=/tools, you get the next option
Directories to use for library searches? /usr/lib/../lib /lib /usr/lib /tools/lib
type /tools/lib
then it builds ;)
comment:8 by , 12 years ago
It builds with:
patch ... chmod 0744 Configure sed -i -e '/Restore computed paths/i libswanted=""' Configure sh Configure -des -Dprefix=/tools make CLDFLAGS='-lm' ...
comment:9 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:10 by , 12 years ago
I think I found an easier fix:
sh Configure -des -Dprefix=/tools -Dlibpath=/tools/lib
Adapted from the post above by Sorina82.
follow-up: 12 comment:11 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
Bruce, feel free to take this. I can't reproduce the failure, and therefore can't test whether whatever fix I put in will work or not.
comment:12 by , 12 years ago
Replying to matthew@…:
Bruce, feel free to take this. I can't reproduce the failure, and therefore can't test whether whatever fix I put in will work or not.
My host is archlinux maybe that works :)?
the fix bdubbs does work to. The fix to install gdbm first, i do not recommend.
Ffter running : sh Configure -des -Dprefix=/tools i saw Perl was looking also in the library paths of my hostmachine. Thats what we dont want;).
So my work around worked till bdubss gave me the correct -Des option. Cheers :)
The sed option above I did not try yet. But looking at the Configure file, thats probably the problem that's occuring while running configure.
so 2 solutions. Pick a King ;)
comment:13 by , 12 years ago
My mistake i didn't delete the sources first.
The option :
sh Configure -des -Dprefix=/tools -Dlibpath=/tools/lib
Doesn't work.
sed -i -e '/Restore computed paths/i libswanted=""' Configure sh Configure -des -Dprefix=/tools make CLDFLAGS='-lm'
Works. dont forget the CLDFLAGS else the linker will error.
comment:14 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:15 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Confirmed that -Dlibpath=/tools/lib did not work properly, so added sed to fix Configure.
Fixed in revision 9871.
I've committed the libc patch now. Alas, I can't reproduce your problem. Both chapter 5 and chapter 6 builds completed fine. I get