selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libselinux: utils: link with shared libfts
@ 2020-05-22  7:46 Đoàn Trần Công Danh
  2020-05-22 18:59 ` Nicolas Iooss
  0 siblings, 1 reply; 3+ messages in thread
From: Đoàn Trần Công Danh @ 2020-05-22  7:46 UTC (permalink / raw)
  To: selinux; +Cc: Đ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 <congdanhqx@gmail.com>
---
 libselinux/utils/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile
index aa2d3e1b..1a7da223 100644
--- a/libselinux/utils/Makefile
+++ b/libselinux/utils/Makefile
@@ -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
-- 
2.26.2.672.g232c24e857


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] libselinux: utils: link with shared libfts
  2020-05-22  7:46 [PATCH] libselinux: utils: link with shared libfts Đoàn Trần Công Danh
@ 2020-05-22 18:59 ` Nicolas Iooss
  2020-05-23  1:23   ` Đoàn Trần Công Danh
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Iooss @ 2020-05-22 18:59 UTC (permalink / raw)
  To: Đoàn Trần Công Danh; +Cc: SElinux list

On Fri, May 22, 2020 at 9:46 AM Đoàn Trần Công Danh
<congdanhqx@gmail.com> wrote:
>
> 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 <congdanhqx@gmail.com>
> ---
>  libselinux/utils/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile
> index aa2d3e1b..1a7da223 100644
> --- a/libselinux/utils/Makefile
> +++ b/libselinux/utils/Makefile
> @@ -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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libselinux: utils: link with shared libfts
  2020-05-22 18:59 ` Nicolas Iooss
@ 2020-05-23  1:23   ` Đoàn Trần Công Danh
  0 siblings, 0 replies; 3+ messages in thread
From: Đoàn Trần Công Danh @ 2020-05-23  1:23 UTC (permalink / raw)
  To: Nicolas Iooss; +Cc: SElinux list


Hello Nicolas,

On 2020-05-22 20:59:43+0200, Nicolas Iooss <nicolas.iooss@m4x.org> wrote:
> 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.

-- 
Danh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-23  1:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22  7:46 [PATCH] libselinux: utils: link with shared libfts Đoàn Trần Công Danh
2020-05-22 18:59 ` Nicolas Iooss
2020-05-23  1:23   ` Đoàn Trần Công Danh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).