libselinux: utils: link with shared libfts
PATCH 1/1 libselinux: utils: link with shared libfts
On Linux with musl libc, libfts isn't shipped with libc. Hence, we link with $(FTS_LIBS) in src.
Some (most) musl-based distribution choose to ship libfts as a standalone shared object because their libfts is licensed under either very permissive license or that implementation of libfts requires attribution in every usage.
Always link with $(FTS_LIBS) in utils to prevent undefined reference problem on those platforms.
--- libselinux/utils/Makefile | 2 ++ 1 file changed, 2 insertions(+)
libselinux/utils/Makefile +2 -0
@@ -45,6 +45,8 @@ override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) override LDFLAGS += -L../src override LDLIBS += -lselinux $(FTS_LDLIBS) PCRE_LDLIBS ?= -lpcre +FTS_LDLIBS ?= +override LDLIBS += $(FTS_LDLIBS) ifeq ($(ANDROID_HOST),y) TARGETS=sefcontext_compile
Signature · 1 line
2.26.2.672.g232c24e857
Quoted 22 lines · Đoàn Trần Công Danh
On Linux with musl libc, libfts isn't shipped with libc. Hence, we link with $(FTS_LIBS) in src.
Some (most) musl-based distribution choose to ship libfts as a standalone shared object because their libfts is licensed under either very permissive license or that implementation of libfts requires attribution in every usage.
Always link with $(FTS_LIBS) in utils to prevent undefined reference problem on those platforms.
Signed-off-by Đoàn Trần Công Danh <[email protected]>--- libselinux/utils/Makefile | 2 ++ 1 file changed, 2 insertions(+)libselinux/utils/Makefile +0
-0
libselinux/utils/Makefile override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) · line 49
Quoted 5 lines
libselinux/utils/Makefile +2
-0@@ -45,6 +45,8 @@ override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) override LDFLAGS += -L../src override LDLIBS += -lselinux $(FTS_LDLIBS) PCRE_LDLIBS ?= -lpcre +FTS_LDLIBS ?= +override LDLIBS += $(FTS_LDLIBS)
Hello,
A few lines above there already is "override LDLIBS += -lselinux $(FTS_LDLIBS)". Why do you need to add $(FTS_LDLIBS) to LDLIBS again?
Thanks,
Nicolas
Hello Nicolas,
Quoted 3 lines · Nicolas Iooss
Hello,
A few lines above there already is "override LDLIBS += -lselinux $(FTS_LDLIBS)". Why do you need to add $(FTS_LDLIBS) to LDLIBS again?
Sorry for the noise, I patched this for libselinux 3.0.
It's was applied cleanly on master, hence I didn't check again.
Signature · 1 line
Danh