gentoo / musl

[MIRROR] musl development overlay
https://gitweb.gentoo.org/proj/musl.git
99 stars 59 forks source link

apparmor musl patch #132

Closed g3ngr33n closed 6 years ago

g3ngr33n commented 6 years ago

Hello,

Nice to see apparmor into the musl repo, however I could not make the build on my system :

https://paste.pound-python.org/show/h33LuYuziQXGxTXIFMQi/

Thanks

blueness commented 6 years ago

                ^           
ar -rcs libapparmor_re.a parse.o expr-tree.o hfa.o chfa.o aare_rules.o
make[1]: Leaving directory '/var/tmp/portage/sys-apps/apparmor-2.12.0/work/apparmor-2.12/parser/libapparmor_re'
x86_64-gentoo-linux-musl-g++ -Wl,-O1 -Wl,--as-needed -march=skylake -O2 -pipe  -Wall -Wsign-compare -Wmissing-field-initializers -Wformat-security -Wunused-parameter -std=gnu++0x -D_GNU_SOURCE  -DPACKAGE=\"apparmor-parser\" -DLOCALEDIR=\"/usr/share/locale\" -DSUBDOMAIN_CONFDIR=\"/etc/apparmor\"  -o apparmor_parser parser_common.o parser_include.o parser_interface.o parser_lex.o parser_main.o parser_misc.o parser_merge.o parser_symtab.o parser_yacc.o parser_regex.o parser_variable.o parser_policy.o parser_alias.o common_optarg.o lib.o network.o  mount.o  dbus.o  profile.o  rule.o  signal.o  ptrace.o  af_rule.o  af_unix.o policy_cache.o  -lunwind \
        libapparmor_re/libapparmor_re.a -static-libgcc -static-libstdc++ -L. -Wl,-O1 -Wl,--as-needed -Wl,-Bdynamic -lapparmor -Wl,-Bdynamic -lpthread
/usr/lib/gcc/x86_64-gentoo-linux-musl/6.4.0/../../../../x86_64-gentoo-linux-musl/bin/ld: cannot find -lunwind
collect2: error: ld returned 1 exit status
make: *** [Makefile:187: apparmor_parser] Error 1
 * ERROR: sys-apps/apparmor-2.12.0::musl failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-apps/apparmor-2.12.0::musl'`,
 * the complete build log and the output of `emerge -pqv '=sys-apps/apparmor-2.12.0::musl'`.
 * The complete build log is located at '/var/tmp/portage/sys-apps/apparmor-2.12.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/apparmor-2.12.0/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-apps/apparmor-2.12.0/work/apparmor-2.12/parser'
 * S: '/var/tmp/portage/sys-apps/apparmor-2.12.0/work/apparmor-2.12/parser'
blueness commented 6 years ago

I'll look at this, but in the mean time make sure libunwind is installed and if that doesn't fix it, then try passing CFLAGS=-Wl,-lunwind or LDFLAGS=-lunwind

g3ngr33n commented 6 years ago

emerge libunwind did the tricks. I'm using now the patched libapparmor / apparmor you made. I will feedback any potential problem

Thanks a lot for those patch, apparmor with a profile "written from scratch" for firejail harden seriously the untrusted/risked app (Like Firefox, Qemu...). Thanks x10

blueness commented 6 years ago

to be clear, you did not have to pass CFLAGS=-Wl,-lunwind or LDFLAGS=-lunwind, correct?