[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: selinux: insufficient M4 detection with building static binaries
From: |
Assaf Gordon |
Subject: |
Re: selinux: insufficient M4 detection with building static binaries |
Date: |
Mon, 8 Apr 2019 16:13:04 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
Hello Bruno,
Thanks for investigating further and the clear explanation.
On 2019-04-07 5:08 a.m., Bruno Haible wrote:
[....]
So, these are the libraries that are needed. Apparently libselinux is
built in such a way that it needs libdl in the shared build, but libsepol
in the static build.
Indeed, I now see they use dlopen/dlsym when building as a shared
library, but direct linking when static:
https://github.com/SELinuxProject/selinux/blob/5d59284381193d5a6806e7fa310ed4c4064d225d/libselinux/src/load_policy.c#L56
[...]
It would be better to instead set LIB_SELINUX to
"-lselinux -lpcre -lsepol -lpthread" (in the static case).
This is a better solution, sadly I do not know how to
implement this in M4 (e.g. detecting a static build,
then deducing the required static libraries...).
regards,
- assaf