Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 703932 - =sys-libs/libcap-2.29-r1 installs unusable libcap.pc: "Name field occurs twice in '/usr/lib64/pkgconfig/libcap.pc'"
Summary: =sys-libs/libcap-2.29-r1 installs unusable libcap.pc: "Name field occurs twic...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-27 00:34 UTC by Nick Wallingford
Modified: 2020-01-23 13:25 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
app-misc:pax-utils.log.gz (app-misc:pax-utils-1.2.4:20191227-003441.log.gz,3.56 KB, application/gzip)
2019-12-27 00:36 UTC, Nick Wallingford
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Wallingford 2019-12-27 00:34:59 UTC
x86_64-pc-linux-gnu-gcc -pipe -march=native -O2 -Wl,-O1 -Wl,--as-needed  paxelf.o paxldso.o paxinc.o security.o xfuncs.o pspax.o -o pspax  -lseccomp 
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: pspax.o: in function `main':
pspax.c:(.text.startup+0x227): undefined reference to `cap_init'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: pspax.c:(.text.startup+0x634): undefined reference to `capgetp'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: pspax.c:(.text.startup+0x641): undefined reference to `cap_to_text'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: pspax.c:(.text.startup+0x777): undefined reference to `cap_free'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: pspax.c:(.text.startup+0xa11): undefined reference to `capgetp'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: pspax.c:(.text.startup+0xa1e): undefined reference to `cap_to_text'
collect2: error: ld returned 1 exit status
make: *** [Makefile:119: pspax] Error 1


Reproducible: Always




I am in the process of uninstalling python-2.7. Maybe that has something to do with it.
Comment 1 Nick Wallingford 2019-12-27 00:36:32 UTC
Created attachment 600980 [details]
app-misc:pax-utils.log.gz
Comment 2 Nick Wallingford 2019-12-27 00:40:25 UTC
Disabling the `caps` USE flag allows it to link.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-27 17:41:34 UTC
USE_CAP=$(usex caps) is probably an invalid way to link to libcap. Can you post your emerge --info for completeness?
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-27 17:45:04 UTC
The build system failed to extract libcpa's flags:

  make -j4 -l5 USE_CAP=yes USE_DEBUG=no USE_PYTHON=no USE_SECCOMP=yes
  Name field occurs twice in '/usr/lib64/pkgconfig/libcap.pc'
  Name field occurs twice in '/usr/lib64/pkgconfig/libcap.pc'

Can you post your contents of '/usr/lib64/pkgconfig/libcap.pc' file? It looks broken.
Comment 5 Eugene Shalygin 2019-12-28 12:44:28 UTC
Have the same problem. Here are the contents of libcap.pc:

prefix=/usr
exec_prefix=
libdir=/usr/lib64
includedir=/usr/include

Name: libcap
Description: libcap - linux capabilities library
Version: 2.29
Libs: -L${libdir} -lcap
Libs.private: 
Cflags: -I${includedir}

Name: libpsx
Description: libpsx - linux posix syscall API for pthreads
Version: 2.29
Libs: -L${libdir} -lpsx -lpthread -Wl,-wrap,pthread_create
Libs.private: 
Cflags: -I${includedir}
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-28 13:09:33 UTC
(In reply to Eugene Shalygin from comment #5)
> Have the same problem. Here are the contents of libcap.pc:
> 
> prefix=/usr
> exec_prefix=
> libdir=/usr/lib64
> includedir=/usr/include
> 
> Name: libcap
> Description: libcap - linux capabilities library
> Version: 2.29
> Libs: -L${libdir} -lcap
> Libs.private: 
> Cflags: -I${includedir}
> 
> Name: libpsx
> Description: libpsx - linux posix syscall API for pthreads
> Version: 2.29
> Libs: -L${libdir} -lpsx -lpthread -Wl,-wrap,pthread_create
> Libs.private: 
> Cflags: -I${includedir}

Thank you! Can you share 'emerge --info libcap' as well?
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-28 13:10:29 UTC
CC +base-system@ sys-libs/libcap maintainer.
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-12-28 13:14:07 UTC
Should be fixed with =sys-libs/libcap-2.29-r1
Please test
Comment 9 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-28 13:15:40 UTC
> > Name: libcap

> > Name: libpsx

Also happens for =sys-libs/libcap-2.29-r1 for me.

I think the real bug here is that they should live in two different .pc files.
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-28 13:21:43 UTC
The simplest reproducer is:

    $ pkg-config --libs libcap
    Name field occurs twice in '/usr/lib64/pkgconfig/libcap.pc'

It should report at least '-lcap'.
Comment 11 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-12-28 16:20:25 UTC
(In reply to Sergei Trofimovich from comment #10)
> The simplest reproducer is:
> 
>     $ pkg-config --libs libcap
>     Name field occurs twice in '/usr/lib64/pkgconfig/libcap.pc'
> 
> It should report at least '-lcap'.

Fails with dev-util/pkgconfig

Works with dev-util/pkgconf


Once I find the time I try to separate the two .pc files
Comment 12 Larry the Git Cow gentoo-dev 2019-12-28 18:02:30 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66bea220735842af03e40bfe276f9e0864c54a7f

commit 66bea220735842af03e40bfe276f9e0864c54a7f
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2019-12-28 17:58:00 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2019-12-28 18:02:24 +0000

    sys-libs/libcap: Separate libpsx stuff into own pkgconfig file
    
    Bug: https://bugs.gentoo.org/703932
    Package-Manager: Portage-2.3.84, Repoman-2.3.20
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 sys-devel/gettext/gettext-0.20.1.ebuild            |  3 +-
 .../files/libcap-2.29-libpsx_pkgconfig.patch       | 88 ++++++++++++++++++++++
 sys-libs/libcap/libcap-2.29-r2.ebuild              | 85 +++++++++++++++++++++
 3 files changed, 175 insertions(+), 1 deletion(-)
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-28 18:08:04 UTC
=sys-libs/libcap-2.29-r2 is enough to make =app-misc/pax-utils-1.2.4 build successfully \o/
Comment 14 Nick Wallingford 2019-12-29 05:03:05 UTC
-r2 fixes it for me too. Thanks everyone! Happy holidays, happy new year!