Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 794745 - dev-util/strace: automagic dependency on libselinux
Summary: dev-util/strace: automagic dependency on libselinux
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-07 13:31 UTC by foufou33
Modified: 2021-10-02 22:32 UTC (History)
2 users (show)

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


Attachments
patch to ebuild (file_794745.txt,963 bytes, patch)
2021-06-07 14:22 UTC, foufou33
Details | Diff
patch (file_794745.txt,828 bytes, text/plain)
2021-08-24 05:15 UTC, foufou33
Details

Note You need to log in before you can comment on or make changes to this bug.
Description foufou33 2021-06-07 13:31:13 UTC
strace links opputunistically against libselinux if present, which breaks  binary packages
for some reason my complation machine had libselinux installed,  when I installed  strace on other machines using emerge -b libselinux wasn't installed and strace  could run becuase of the missing libselinux.

it might be a good idea to add a selinux use flag to disable/enable explictely the --with-libselinux  configure options (I was about to try that )


Reproducible: Always

Steps to Reproduce:
1.install libselinux
2.compile  strace
3.generaete binary package
4. install binary package (emerge -G strace) 
Actual Results:  
$ strace 
strace: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory

Expected Results:  
$ strace 
strace: must have PROG [ARGS] or -p PID
Try 'strace -h' for more information.

on compilation host :

# ldd `which strace`
        linux-vdso.so.1 (0x00007ffe1fbf6000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f5fe6d77000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f5fe6d4b000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f5fe6b86000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5fe6b66000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f5fe6aed000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f5fe6ae7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f5fe6fab000)


on other host :

# ldd `which strace `
        linux-vdso.so.1 (0x00007f8f29b0a000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f8f298d4000)
        libselinux.so.1 => not found
        libc.so.6 => /lib64/libc.so.6 (0x00007f8f2970f000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8f296ef000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f8f29b0c000)
Comment 1 foufou33 2021-06-07 14:22:49 UTC
Created attachment 714291 [details, diff]
patch to ebuild

I wasn't sure about where to put the dependency though.
I tested the build and it seems to work:

with patched ebuild 
ldd `which strace`
        linux-vdso.so.1 (0x00007fff5a5bb000)
        librt.so.1 => /lib64/librt.so.1 (0x00007fb54255f000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fb54239a000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb54237a000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb542793000)
Comment 2 foufou33 2021-08-24 05:15:54 UTC
Created attachment 735571 [details]
patch

still a problem with 5.13
the attached patch is what I used locally to correct it
Comment 3 Larry the Git Cow gentoo-dev 2021-10-02 22:32:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e9c66b7858eef397c69239cac8ea87b2af8c837

commit 5e9c66b7858eef397c69239cac8ea87b2af8c837
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-10-02 22:32:10 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-10-02 22:32:22 +0000

    dev-util/strace: fix automagic dependency on libselinux
    
    Closes: https://bugs.gentoo.org/794745
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-util/strace/{strace-5.12.ebuild => strace-5.12-r1.ebuild} | 6 ++++--
 dev-util/strace/{strace-5.14.ebuild => strace-5.14-r1.ebuild} | 4 +++-
 dev-util/strace/strace-9999.ebuild                            | 4 +++-
 3 files changed, 10 insertions(+), 4 deletions(-)