I tried to get libapparmor from hardened-dev overlay just for fun. When emerging such library using the python USE flag, I got the following message: [snip] running build_ext building '_LibAppArmor' extension creating build/temp.linux-i686-3.3 i686-pc-linux-gnu-gcc -pthread -O2 -march=i686 -pipe -fomit-frame-pointer -fpic -fPIE -fPIC -I../../src -I/usr/include/python3.3 -c libapparmor_wrap.c -o build/temp.linux-i686-3.3/libapparmor_wrap.o i686-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -O2 -march=i686 -pipe -fomit-frame-pointer -fpic -fPIE build/temp.linux-i686-3.3/libapparmor_wrap.o -L/usr/lib -lpython3.3 -o build/lib.linux-i686-3.3/LibAppArmor/_LibAppArmor.cpython-33.so -L../../src/.libs -lapparmor /usr/lib/gcc/i686-pc-linux-gnu/4.8.1/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lapparmor collect2: error: ld returned 1 exit status error: command 'i686-pc-linux-gnu-gcc' failed with exit status 1 make: *** [all-local] Error 1 [snip] The root cause is the libraries/libapparmor/swig/python/setup.py.in file, which looks for a ".libs" subdir where libapparmor.so resides at the wrong place. I've wrote a patch which removes the macro usage and uses a fixed correct path to the right subdirectory, allowing libapparmor to be built. As I took the ebuild from hardened-dev overlay I don't mind this needs to be quickly fixed. Reproducible: Always Steps to Reproduce: 1. Add hardened-dev overlay to your system 2. USE="python" emerge libapparmor
Created attachment 360356 [details, diff] Fixes librar path
Created attachment 360358 [details] ebuild for -r1 release using epatch
looks sane here, this kind or thing can easily be missed on upgrade as it often only presents on fresh install.
Thanks, this is fixed in 2.8.2 which is in portage. Big thanks to mgorny for massive cleanup to python code.