From: David Michael <fedora.dm0@gmail.com>
To: linux-erofs@lists.ozlabs.org, bluce.liguifu@huawei.com,
miaoxie@huawei.com, fangwei1@huawei.com
Cc: gaoxiang25@huawei.com
Subject: [PATCH] erofs-utils: fuse: fix linking when using --with-selinux
Date: Thu, 10 Dec 2020 21:29:43 -0500 [thread overview]
Message-ID: <87360dnkh4.fsf@gmail.com> (raw)
The libselinux functions selabel_open and selabel_close are called
by lib/config.c, so include libselinux in CFLAGS and LIBS to fix
building erofsfuse.
Signed-off-by: David Michael <fedora.dm0@gmail.com>
---
Hi,
Trying to build both mkfs.erofs with SELinux and erofsfuse at the same
time (with both --enable-fuse and --with-selinux) results in the
following linking errors:
/usr/bin/ld: ../lib/.libs/liberofs.a(liberofs_la-config.o): in function `erofs_selabel_open':
/home/dm0/rpmbuild/BUILD/erofs-utils-1.2/lib/config.c:75: undefined reference to `selabel_open'
/usr/bin/ld: ../lib/.libs/liberofs.a(liberofs_la-config.o): in function `erofs_exit_configure':
/home/dm0/rpmbuild/BUILD/erofs-utils-1.2/lib/config.c:42: undefined reference to `selabel_close'
Are these programs supposed to be configured separately? If this build
configuration is supposed to work, this change fixes linking.
Thanks.
David
fuse/Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fuse/Makefile.am b/fuse/Makefile.am
index f14f6fd..e7757bc 100644
--- a/fuse/Makefile.am
+++ b/fuse/Makefile.am
@@ -5,6 +5,6 @@ AUTOMAKE_OPTIONS = foreign
bin_PROGRAMS = erofsfuse
erofsfuse_SOURCES = dir.c main.c
erofsfuse_CFLAGS = -Wall -Werror -I$(top_srcdir)/include
-erofsfuse_CFLAGS += -DFUSE_USE_VERSION=26 ${libfuse_CFLAGS}
-erofsfuse_LDADD = $(top_builddir)/lib/liberofs.la ${libfuse_LIBS} ${liblz4_LIBS}
+erofsfuse_CFLAGS += -DFUSE_USE_VERSION=26 ${libfuse_CFLAGS} ${libselinux_CFLAGS}
+erofsfuse_LDADD = $(top_builddir)/lib/liberofs.la ${libfuse_LIBS} ${liblz4_LIBS} ${libselinux_LIBS}
--
2.29.2
next reply other threads:[~2020-12-11 2:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 2:29 David Michael [this message]
2020-12-11 2:37 ` [PATCH] erofs-utils: fuse: fix linking when using --with-selinux Gao Xiang
2020-12-12 9:49 ` Li GuiFu via Linux-erofs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87360dnkh4.fsf@gmail.com \
--to=fedora.dm0@gmail.com \
--cc=bluce.liguifu@huawei.com \
--cc=fangwei1@huawei.com \
--cc=gaoxiang25@huawei.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=miaoxie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox