On 14/12/2015 21:11, Read, James C wrote:
> Been working through the book meticulously and had no real problems until
> building Perl in chapter 5.
> [...]
> /mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/librt.so:
> undefined reference to `__pthread_barrier_wait@GLIBC_PRIVATE'
> /mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/librt.so:
> undefined reference to `__pthread_barrier_init@GLIBC_PRIVATE'
> /lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to
> `h_errno@GLIBC_PRIVATE'
> collect2: error: ld returned 1 exit status
> makefile:376: recipe for target 'perl' failed
> make: *** [perl] Error 1
> 
> 
> I can reproduce this error message in two words.
> 
> 
> 1) by copying verbatim the last compilation command:
> 
> 
> cc -o perl -fstack-protector-strong -L/usr/local/lib  perlmain.o
> lib/auto/B/B.a lib/auto/Compress/Raw/Bzip2/Bzip2.a
> lib/auto/Compress/Raw/Zlib/Zlib.a lib/auto/Cwd/Cwd.a
> lib/auto/Data/Dumper/Dumper.a lib/auto/Devel/PPPort/PPPort.a
> lib/auto/Devel/Peek/Peek.a lib/auto/Digest/MD5/MD5.a lib/auto/Digest/SHA/SHA.a
> lib/auto/Encode/Encode.a lib/auto/Fcntl/Fcntl.a
> lib/auto/File/DosGlob/DosGlob.a lib/auto/File/Glob/Glob.a
> lib/auto/Filter/Util/Call/Call.a lib/auto/Hash/Util/Util.a
> lib/auto/Hash/Util/FieldHash/FieldHash.a lib/auto/I18N/Langinfo/Langinfo.a
> lib/auto/IO/IO.a lib/auto/IPC/SysV/SysV.a lib/auto/List/Util/Util.a
> lib/auto/MIME/Base64/Base64.a lib/auto/Math/BigInt/FastCalc/FastCalc.a
> lib/auto/Opcode/Opcode.a lib/auto/POSIX/POSIX.a
> lib/auto/PerlIO/encoding/encoding.a lib/auto/PerlIO/mmap/mmap.a
> lib/auto/PerlIO/scalar/scalar.a lib/auto/PerlIO/via/via.a
> lib/auto/SDBM_File/SDBM_File.a lib/auto/Socket/Socket.a
> lib/auto/Storable/Storable.a lib/auto/Sys/Hostname/Hostname.a
> lib/auto/Sys/Syslog/Syslog.a lib/auto/Tie/Hash/NamedCapture/NamedCapture.a
> lib/auto/Time/HiRes/HiRes.a lib/auto/Time/Piece/Piece.a
> lib/auto/Unicode/Collate/Collate.a lib/auto/arybase/arybase.a
> lib/auto/attributes/attributes.a lib/auto/mro/mro.a lib/auto/re/re.a
> lib/auto/threads/threads.a lib/auto/threads/shared/shared.a
> lib/auto/Encode/Byte/Byte.a lib/auto/Encode/CN/CN.a
> lib/auto/Encode/EBCDIC/EBCDIC.a lib/auto/Encode/JP/JP.a
> lib/auto/Encode/KR/KR.a lib/auto/Encode/Symbol/Symbol.a
> lib/auto/Encode/TW/TW.a lib/auto/Encode/Unicode/Unicode.a libperl.a `cat
> ext.libs` -lm /tools/lib/libcrypt.a
> lib/auto/POSIX/POSIX.a(POSIX.o): In function `XS_POSIX_tmpnam':
> POSIX.c:(.text+0x3654): warning: the use of `tmpnam' is dangerous, better use
> `mkstemp'
> /mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/librt.so:
> undefined reference to `__pthread_barrier_wait@GLIBC_PRIVATE'
> /mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/librt.so:
> undefined reference to `__pthread_barrier_init@GLIBC_PRIVATE'
> /lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to
> `h_errno@GLIBC_PRIVATE'
> collect2: error: ld returned 1 exit status
> 
> 2) By entering the following command sequence
> 
> 
> echo 'main(){}' | gcc -xc -v -Wl,-verbose -lrt - 2>&1 | grep libpthread
> libpthread.so.0 needed by
> /mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/librt.so
> found libpthread.so.0 at /lib/x86_64-linux-gnu/libpthread.so.0
> /lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to
> `h_errno@GLIBC_PRIVATE'

Libpthread is found on the host instead of /mnt/lfs/tools. Since you tried
that command, I guess you read the message
http://lists.linuxfromscratch.org/pipermail/lfs-dev/2012-December/067457.html,
and maybe also the thread about check-0.9.9 in March 2013.

It looks like you used the right configure switches for binutils-pass2, so it
must come from something else. What bothers me is that it only occured in
perl. It seems that this should occur before whenever -lrt is passed to gcc.

Actually, in my log, I see "-lrt" in check, in coreutils, and in gettext
before perl. So maybe something happened before you tried to build perl (did
you log out and in, and then the PATH is not correctly set, or some other 
envar?)

Also, in the command above, there is no reference to -lrt. When I search for
-lrt in the log, I only find it once:
---------
Configuring Time::HiRes...
Using hints hints/linux.pl...
Extra libraries: -lrt...
---------
So maybe it is in `cat ext.libs`.

But I am almost sure that this error should have occured before in coreutils...

> 
> 
> The configure command I gave for making binutils was copied directly from the 
> book
> 
> 
> CC=$LFS_TGT-gcc                AR=$LFS_TGT-ar                
> RANLIB=$LFS_TGT-ranlib         ../binutils-2.25.1/configure        
> --prefix=/tools                --disable-nls                 
> --disable-werror               --with-lib-path=/tools/lib     --with-sysroot
> &> ../buildlogs/secondpass/binutils-2.25.1/configurelog
> 
> 
> What could the problem be? Anyone seen anything like this before?
> 
> 
> Daer Semaj
> 

Regards
Pierre

-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to