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
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
Depends on:
Reported: 2021-06-07 13:31 UTC by foufou33
Modified: 2021-08-24 05:15 UTC (History)
2 users (show)

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

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

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: 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` (0x00007ffe1fbf6000) => /lib64/ (0x00007f5fe6d77000) => /lib64/ (0x00007f5fe6d4b000) => /lib64/ (0x00007f5fe6b86000) => /lib64/ (0x00007f5fe6b66000) => /lib64/ (0x00007f5fe6aed000) => /lib64/ (0x00007f5fe6ae7000)
        /lib64/ (0x00007f5fe6fab000)

on other host :

# ldd `which strace ` (0x00007f8f29b0a000) => /lib64/ (0x00007f8f298d4000) => not found => /lib64/ (0x00007f8f2970f000) => /lib64/ (0x00007f8f296ef000)
        /lib64/ (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` (0x00007fff5a5bb000) => /lib64/ (0x00007fb54255f000) => /lib64/ (0x00007fb54239a000) => /lib64/ (0x00007fb54237a000)
        /lib64/ (0x00007fb542793000)
Comment 2 foufou33 2021-08-24 05:15:54 UTC
Created attachment 735571 [details]

still a problem with 5.13
the attached patch is what I used locally to correct it