mirror of
https://github.com/SELinuxProject/selinux
synced 2025-03-03 08:47:42 +00:00
When -lbz2 is written before libsemanage.a in the linker command line, the linker may fail to find all needed symbols. This occurs for example when building on Ubuntu 14.04 without the gold linker (cf. Travis build result https://travis-ci.org/fishilico/selinux/builds/245072498): gcc libsemanage-tests.o test_semanage_store.o test_utilities.o utilities.o -L/home/travis/build/fishilico/selinux/installdir/usr/lib -o libsemanage-tests -lcunit -lbz2 -laudit ../src/libsemanage.a -lselinux -lsepol ../src/libsemanage.a(direct_api.o): In function `bzip': direct_api.c:(.text+0xee6): undefined reference to `BZ2_bzWriteOpen' direct_api.c:(.text+0xf11): undefined reference to `BZ2_bzWriteClose' direct_api.c:(.text+0xf79): undefined reference to `BZ2_bzWrite' direct_api.c:(.text+0xfa1): undefined reference to `BZ2_bzWriteClose' direct_api.c:(.text+0xfe0): undefined reference to `BZ2_bzWriteClose' ../src/libsemanage.a(direct_api.o): In function `bunzip': direct_api.c:(.text+0x114e): undefined reference to `BZ2_bzReadOpen' direct_api.c:(.text+0x1249): undefined reference to `BZ2_bzRead' direct_api.c:(.text+0x13b4): undefined reference to `BZ2_bzReadClose' ../src/libsemanage.a(seusers_local.o): In function `semanage_seuser_audit': seusers_local.c:(.text+0x4c5): undefined reference to `audit_open' seusers_local.c:(.text+0x5b6): undefined reference to `audit_log_semanage_message' seusers_local.c:(.text+0x5cd): undefined reference to `audit_close' As ../src/libsemanage.a is a dependency of $(EXECUTABLE) in the Makefile, use $^ to include it in the command line. While at it, put $^ after $(LDFLAGS) as other Makefiles do. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org> |
||
---|---|---|
checkpolicy | ||
dbus | ||
gui | ||
libselinux | ||
libsemanage | ||
libsepol | ||
mcstrans | ||
policycoreutils | ||
python | ||
restorecond | ||
sandbox | ||
scripts | ||
secilc | ||
semodule-utils | ||
.gitignore | ||
.travis.yml | ||
CleanSpec.mk | ||
Makefile | ||
README |
Please submit all bug reports and patches to selinux@tycho.nsa.gov. Subscribe via selinux-join@tycho.nsa.gov. Build dependencies on Fedora: yum install audit-libs-devel bison bzip2-devel dbus-devel dbus-glib-devel flex flex-devel flex-static glib2-devel libcap-devel libcap-ng-devel pam-devel pcre-devel python-devel setools-devel swig xmlto redhat-rpm-config To build and install everything under a private directory, run: make DESTDIR=~/obj install install-pywrap To install as the default system libraries and binaries (overwriting any previously installed ones - dangerous!), on x86_64, run: make LIBDIR=/usr/lib64 SHLIBDIR=/lib64 install install-pywrap relabel or on x86 (32-bit), run: make install install-pywrap relabel This may render your system unusable if the upstream SELinux userspace lacks library functions or other dependencies relied upon by your distribution. If it breaks, you get to keep both pieces. To install libsepol on macOS (mainly for policy analysis): cd libsepol; make DESTDIR=/usr/local PREFIX=/usr/local install This requires GNU coreutils (brew install coreutils).