Skip to contentSkip to conversation

policycoreutils: make `-laudit -lbz2` conditional

PATCH Superseded Petr Lautrbach 2 participants 2 messages Jun 23, 2025 SELinux security module

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 policycoreutils: make `-laudit -lbz2` conditional

Commit da6cd3d8d7600 ("Support static-only builds") introduced possibility to build static-only toolchain. For static builds of semodule and setsebool seems to be necessary to use -laudit -lbz2. As an side effect, when policycoreutils is built without other components, the buildroot requires libaudit.so and libbz2.so to be available. For shared builds this is not necessary and had not been required before.

---
 policycoreutils/semodule/Makefile  | 4 +++-
 policycoreutils/setsebool/Makefile | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
policycoreutils/semodule/Makefile +3 -1
index 7c45831fcd4e..e5e5a3086224 100644
@@ -12,7 +12,9 @@ SEMODULE_OBJS = semodule.o
 
 all: semodule genhomedircon
 
-semodule: LDLIBS += -laudit -lbz2
+ifeq ($(DISABLE_SHARED),y)
+	semodule: LDLIBS += -laudit -lbz2
+endif
 semodule: $(SEMODULE_OBJS)
 
 genhomedircon:
policycoreutils/setsebool/Makefile +3 -1
index 1d5148469f01..03b8b67a5cb3 100644
@@ -15,7 +15,9 @@ BASHCOMPLETIONS=setsebool-bash-completion.sh
 
 all: setsebool
 
-setsebool: LDLIBS += -laudit -lbz2
+ifeq ($(DISABLE_SHARED),y)
+	setsebool: LDLIBS += -laudit -lbz2
+endif
 setsebool: $(SETSEBOOL_OBJS)
 
 install: all
Signature · 1 line
2.49.0
#1 lore raw
Quoted 19 lines · Petr Lautrbach

Commit da6cd3d8d7600 ("Support static-only builds") introduced possibility to build static-only toolchain. For static builds of semodule and setsebool seems to be necessary to use -laudit -lbz2. As an side effect, when policycoreutils is built without other components, the buildroot requires libaudit.so and libbz2.so to be available. For shared builds this is not necessary and had not been required before.

---
 policycoreutils/semodule/Makefile  | 4 +++-
 policycoreutils/setsebool/Makefile | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
policycoreutils/semodule/Makefile +0 -0
index 7c45831fcd4e..e5e5a3086224 100644

policycoreutils/semodule/Makefile SEMODULE_OBJS = semodule.o · line 16

Quoted 6 lines
policycoreutils/semodule/Makefile +2 -1
@@ -12,7 +12,9 @@ SEMODULE_OBJS = semodule.o
 
 all: semodule genhomedircon
 
-semodule: LDLIBS += -laudit -lbz2
+ifeq ($(DISABLE_SHARED),y)
+       semodule: LDLIBS += -laudit -lbz2

make does not like the tab here (or the one below either). Thanks,
Jim

Quoted 23 lines
policycoreutils/semodule/Makefile +1 -0
+endif
 semodule: $(SEMODULE_OBJS)
 
 genhomedircon:
policycoreutils/setsebool/Makefile +3 -2
index 1d5148469f01..03b8b67a5cb3 100644
@@ -15,7 +15,9 @@ BASHCOMPLETIONS=setsebool-bash-completion.sh
 
 all: setsebool
 
-setsebool: LDLIBS += -laudit -lbz2
+ifeq ($(DISABLE_SHARED),y)
+       setsebool: LDLIBS += -laudit -lbz2
+endif
 setsebool: $(SETSEBOOL_OBJS)
 
 install: all
--

2.49.0