Bug 13296

Summary: host-libcap failed to build
Product: buildroot Reporter: Dr I J Ormshaw <ian_ormshaw>
Component: OtherAssignee: Heiko Thiery <heiko.thiery>
Status: RESOLVED FIXED    
Severity: major CC: buildroot, heiko.thiery
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: fixes the make argument from DYNAMIC to SHARED
second iteration of the patch
Config file
Full log of pcap build
third iteration of the patch
patch from kernel bug 210135

Description Dr I J Ormshaw 2020-11-05 09:10:15 UTC
On Fedora 33 2020.11-rc1 host-libcap 2.45 Building fails with error:

make -C ../progs tcapsh-static
gcc -fPIC -I/home/ian/build/hiwire-linux-19e60402-x86_64/buildroot/build/host-libcap-2.45/progs/../libcap/include/uapi -I/home/ian/build/hiwire-linux-19e60402-x86_64/buildroot/build/host-libcap-2.45/progs/../libcap/include  -O2 -I/home/ian/build/hiwire-linux-19e60402-x86_64/buildroot/host/include -Dlinux -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -g  -Dlinux -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -g  -Dlinux -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -g  -Dlinux -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -g  -o tcapsh-static capsh.c -L/home/ian/build/hiwire-linux-19e60402-x86_64/buildroot/build/host-libcap-2.45/progs/../libcap -lcap -L/home/ian/build/hiwire-linux-19e60402-x86_64/buildroot/host/lib -Wl,-rpath,/home/ian/build/hiwire-linux-19e60402-x86_64/buildroot/host/lib -L/home/ian/build/hiwire-linux-19e60402-x86_64/buildroot/build/host-libcap-2.45/libcap -L/home/ian/build/hiwire-linux-19e60402-x86_64/buildroot/build/host-libcap-2.45/tests/../libcap -L/home/ian/build/hiwire-linux-19e60402-x86_64/buildroot/build/host-libcap-2.45/tests/../libcap -L/home/ian/build/hiwire-linux-19e60402-x86_64/buildroot/build/host-libcap-2.45/progs/../libcap --static
/usr/bin/ld: cannot find -lc

gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6)
Comment 1 Heiko Thiery 2020-11-05 16:22:17 UTC
Created attachment 8631 [details]
fixes the make argument from DYNAMIC to SHARED
Comment 2 Heiko Thiery 2020-11-05 16:22:51 UTC
Could you please test the attached patch?
Comment 3 Thomas Petazzoni 2020-11-05 16:35:38 UTC
(In reply to Heiko Thiery from comment #1)
Do you need to pass both DYNAMIC=something *and* SHARED=something ? This seems a bit redundant. According to what you did in 8d38eb052e7006b6e74e9453351d7f245144481e, it seems that DYNAMIC has gone away, and SHARED is the new variable to use ?
Comment 4 Heiko Thiery 2020-11-05 19:03:49 UTC
Created attachment 8636 [details]
second iteration of the patch
Comment 5 Heiko Thiery 2020-11-05 19:05:31 UTC
Your're right. That is not needed anymore. It was just a quick shot to get a feetback. I added an updated version of the patch that removes the DYNAMIC arguments.
Comment 6 Heiko Thiery 2020-11-05 19:06:49 UTC
Or more a feedback than a feetback ;-)
Comment 7 Dr I J Ormshaw 2020-11-06 07:28:10 UTC
I am still seeing the same error, with either version of the patch after doing the following:

1) Deleting my build directory.
2) Checking out the source from tag 2020.11-rc1
3) In the where the source is checked out applying the patch with:
     patch -p1  -i <path to patch>/0001-package-libcap-fix-building-on-host-package.patch
4) Copying my config file to the build directoty
5) Building buildroot
Comment 8 Dr I J Ormshaw 2020-11-06 07:31:52 UTC
Created attachment 8646 [details]
Config file
Comment 9 Dr I J Ormshaw 2020-11-06 07:38:33 UTC
Created attachment 8651 [details]
Full log of pcap build
Comment 10 Peter Seiderer 2020-11-09 22:13:41 UTC
Same failure here (openSUSE Tumbleweed), both attached patches did not work...,
reverting 8d38eb052e7006b6e74e9453351d7f245144481e worked...
Comment 11 Heiko Thiery 2020-11-10 09:33:53 UTC
Created attachment 8656 [details]
third iteration of the patch

I added a patch for libcap that should prevent adding the --static flag. Please give it a try.

I also started a request to the libcap maintainer get feedback if this is the correct way.

Thank you
Comment 12 Dr I J Ormshaw 2020-11-10 11:21:23 UTC
That builds okay now.  Also I deployed the build to the target system, and it runs with no problems.

Thanks,

Ian
Comment 13 Heiko Thiery 2020-11-10 15:01:17 UTC
Thanks for the feedback. I will wait for a response from libcap maintainer. And if my patch is sufficient we can apply it to buildroot.
Comment 14 Dr I J Ormshaw 2020-11-11 12:00:52 UTC
Created attachment 8666 [details]
patch from kernel bug 210135
Comment 15 Dr I J Ormshaw 2020-11-11 12:05:01 UTC
tested-by:
    Reverting the previous patch 
    Testing that the build then failed. it did.
    Added the attached patch (0000-kernel.org-bug-210135.patch) to <GLOBAL_PATCHES>/libcap/2.54
    Cleaning the build area
    Rebuilding

Result:
    host-libcap once again build.
Comment 16 Heiko Thiery 2020-11-15 15:48:00 UTC
fixed with 7540fbe877d48d75113338430ce3304a00a82cb1