You are right. Libc.a and libpthread.a are missing for some reason. One quick and dirty trick is to just copy them from /tools/lib to /lib and now I can compile libcap without problem but is this an ideal solution? Why libcap relies on static libraries in their test? Should I inform the developer?
On Tue, 7 Jan 2020 at 06:33 Ken Moffat via lfs-dev < lfs-dev@lists.linuxfromscratch.org> wrote: > On Tue, Jan 07, 2020 at 01:35:06AM +0700, Saul Tigh via lfs-dev wrote: > > Dear LFS dev, > > First time poster here so please be gentle. I've compiled LFS dev several > > times before but this time libcap (section 6.28) is giving me a headache. > > I'm following the latest version of LFS-systemd SVN-20200106 with ubuntu > > 19.10 as host system running in virutalbox. I even installed libcap-dev > on > > the host system as part of new dependencies mentioned in LFS book. Also > > the "Host system requirement" script reports that the host system has > the > > prerequisites installed properly. But no matter what I do libcap > complains > > that pthread and libc cannot be found: > > > [...] > > make -C tests all > > make[1]: Entering directory '/build_scripts/libcap/src/libcap-2.30/tests' > > gcc -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Dlinux -Wall > > -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align > > -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline > -Wshadow > > -g -fPIC -I/usr/include > > -I/build_scripts/libcap/src/libcap-2.30/tests/../libcap/include -DNOWRAP > > psx_test.c -o psx_test > > -L/build_scripts/libcap/src/libcap-2.30/tests/../libcap -lpsx -lpthread > > gcc -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Dlinux -Wall > > -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align > > -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline > -Wshadow > > -g -fPIC -I/usr/include > > -I/build_scripts/libcap/src/libcap-2.30/tests/../libcap/include > psx_test.c > > -o psx_test_wrap -L/build_scripts/libcap/src/libcap-2.30/tests/../libcap > > -lpsx -lpthread -Wl,-wrap,pthread_create > > gcc -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Dlinux -Wall > > -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align > > -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline > -Wshadow > > -g -fPIC -I/usr/include > > -I/build_scripts/libcap/src/libcap-2.30/tests/../libcap/include > > libcap_psx_test.c -o libcap_psx_test > > -L/build_scripts/libcap/src/libcap-2.30/tests/../libcap -lcap > > -L/build_scripts/libcap/src/libcap-2.30/tests/../libcap -lpsx -lpthread > > -Wl,-wrap,pthread_create --static > > /usr/bin/ld: cannot find -lpthread > > /usr/bin/ld: cannot find -lc > > collect2: error: ld returned 1 exit status > > make[1]: *** [Makefile:35: libcap_psx_test] Error 1 > > make[1]: Leaving directory '/build_scripts/libcap/src/libcap-2.30/tests' > > make: *** [Makefile:13: all] Error 2 > > make: Leaving directory '/build_scripts/libcap/src/libcap-2.30' > > > > The other packages compile without problem so far. I would like to > mention > > I deviated a bit from the book by running everything inside bash scripts > > (they used to work until now). I've been following the latest development > > regarding libcap in LFS book including #4569 which was addressed today > > 2020/01/06. I tried recompiliing everything from scratch several times > and > > it always gthrows me error at this stage. I'm confused, any help would be > > appreciated. > > I haven't tried to build the current version, but I see it is in a > tests subdirectory. People will know that I loathe static libs > (specifically, I want to know which packages use a static lib from > another package in case that other package ever has a known > vulnerability). So I'm going to suggest that libpthread.a and > libc.a might not be present ? > > In my own builds I keep libc.a available because it can be used all > over the place in configure scripts and anyway if glibc has > vulnerabilities it is time for a new system. > > For other static libs, like pthread, my post-install scripts rename > them so that I can make them available if needed (tests are > particularly likely to use static libs, for example the binutils > gold tests need static libpthread.a). > > ĸen > -- > The right of the people to keep and arm Bears, shall not be infringed. > -- > http://lists.linuxfromscratch.org/listinfo/lfs-dev > FAQ: http://www.linuxfromscratch.org/faq/ > Unsubscribe: See the above information page
-- http://lists.linuxfromscratch.org/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page