Summary: | <sys-libs/libsemanage-2.3-r1 fails to emerge on multilib system with ABI_X86="32" | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Amadeusz Sławiński <amade> |
Component: | SELinux | Assignee: | Sven Vermeulen (RETIRED) <swift> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | selinux, sven.eden |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | selinux-utils | ||
Package list: | Runtime testing required: | --- | |
Attachments: |
build log with gcc-4.6.4
build log with 4.8.2 ustr-1.0.4-r4.ebuild build.log with updated ustr Patch from ustr-1.0.4-r3 to multilib building enabled ustr-1.0.4-r4 Add multilib build support to look in the correct lib dirs |
Description
Amadeusz Sławiński
2014-04-01 13:13:16 UTC
Created attachment 374050 [details]
build log with gcc-4.6.4
older gcc as requested per irc
Created attachment 374052 [details]
build log with 4.8.2
As I thought... headers do different things depending on 32 vs 64 bit system root@maelstrom $ diff -uNr /mnt/32bit/usr/include/ustr-conf.h /usr/include/ustr-conf.h --- /mnt/32bit/usr/include/ustr-conf.h 2014-04-02 00:17:51.082557737 +0200 +++ /usr/include/ustr-conf.h 2014-04-01 15:00:56.618026496 +0200 @@ -20,7 +20,7 @@ #if ! USTR_CONF_INCLUDE_CODEONLY_HEADERS /* If you aren't just using the headers, these should match the .c's */ -# define USTR_CONF_HAVE_64bit_SIZE_MAX 0 +# define USTR_CONF_HAVE_64bit_SIZE_MAX 1 # define USTR_CONF_HAVE_RETARDED_VSNPRINTF 0 # define USTR_CONF_HAVE_STDINT_H 1 # define USTR_CONF_HAVE_DYNAMIC_CONF 1 @@ -39,7 +39,7 @@ /* Note that you really shouldn't alter the _HAVE_* ones, but whatever */ # ifndef USTR_CONF_HAVE_64bit_SIZE_MAX -# define USTR_CONF_HAVE_64bit_SIZE_MAX 0 +# define USTR_CONF_HAVE_64bit_SIZE_MAX 1 # endif # ifndef USTR_CONF_HAVE_RETARDED_VSNPRINTF # define USTR_CONF_HAVE_RETARDED_VSNPRINTF 0 Is there a different include path to be used here for x86? Is there a /usr/include32 or so? (In reply to Sven Vermeulen from comment #4) > Is there a different include path to be used here for x86? > > Is there a /usr/include32 or so? determine which package installs the header... $ qfile -v /usr/include/ustr-main.h ...use multilib-build.eclass and MULTILIB_WRAPPED_HEADERS=( /usr/include/ustr-main.h ) ...look for examples in tree: $ cd /usr/portage $ grep MULTILIB_WRAPPED_HEADERS */*/*.ebuild @Sven Eden: I've been trying to get libsemanage to build in a multilib but am coming across some ugly hurdles. Attached is an attempted update on dev-libs/ustr ebuild that wraps the ustr-main.h but builds of libsemanage fail furtherdown anyway (see build log with updated ustr). If you have any ideas on this, be my guest to suggest anything. Created attachment 375434 [details]
ustr-1.0.4-r4.ebuild
ustr-1.0.4-r4 ebuild that wraps ustr-main.h
Created attachment 375436 [details]
build.log with updated ustr
libsemanage build log with updated dev-libs/ustr, which now fails on other locations
What concerns me currently is that the builds contain: """ In file included from /usr/include/ustr.h:14:0, from utilities.c:29: /usr/include/ustr-main.h:13:3: error: #error "abi_x86_32 not supported by the package." """ Yet dev-libs/ustr was built with USE="abi_x86_32 abi_x86_64" :-/ Also: # qlist ustr | grep ustr-main /usr/share/ustr-1.0.4/ustr-main-code.h /usr/share/ustr-1.0.4/ustr-main-internal.h /usr/share/ustr-1.0.4/ustr-main-opt-code.c /usr/share/ustr-1.0.4/ustr-main-dbg-code.c /usr/include/i686-pc-linux-gnu/ustr-main.h /usr/include/x86_64-pc-linux-gnu/ustr-main.h /usr/include/ustr-main.h Sven, /usr/include/ustr-main.h isn't enough to wrap I guess. The main decisions are made in ustr-compiler.h and whatnot. I'll take a look into it and try to build a 32bit sys-libs/libsemanage-2.2-r2 by hand. Maybe there need some other files to be wrapped, maybe not. We'll see. Apparently the 32bit build ends up with wrong limits all over the place using a 64bit config. But I must ask for a little patience, as I have no idea whether I'll find the time today already. It could be a day or two. Shouldn't the wrapped one be ustr-conf.h header? (In reply to Amadeusz Sławiński from comment #11) > Shouldn't the wrapped one be ustr-conf.h header? I'll check that. Hi everybody, first of all a big sorry for the delay! I have currently hell at work (fun, but multiple project managers simply don't do their jobs...) and very little time. Fortunately I was able to sort this out, but libsemanage will keep to have one big problem: libaudit. It is not available as 32bit, so while (patches follow) ustr-1.0.4-r4 (Available from my overlay seden) installs fine and libsemanage-2.2-r3 (Available from my overlay seden, too) compiles just well, the 32bit variant does not succeed to link: -------- x86_64-pc-linux-gnu-gcc -m32 -march=native -pipe -ftree-vectorize -ggdb -O2 -I../include -I/usr/include -D_GNU_SOURCE -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--hash-style=gnu -shared -o libsemanage.so.1 users_join.lo users_extra_file.lo ports_policy.lo nodes_policydb.lo users_local.lo context_record.lo port_record.lo users_base_policydb.lo semanage_store.lo modules.lo boolean_record.lo users_base_file.lo booleans_activedb.lo interfaces_file.lo user_record.lo interfaces_policydb.lo genhomedircon.lo booleans_policydb.lo fcontexts_file.lo booleans_file.lo booleans_local.lo interfaces_policy.lo utilities.lo handle.lo direct_api.lo interfaces_local.lo database.lo fcontexts_local.lo policy_components.lo seusers_file.lo seusers_local.lo database_llist.lo parse_utils.lo booleans_policy.lo seuser_record.lo nodes_file.lo fcontexts_policy.lo nodes_local.lo debug.lo fcontext_record.lo database_file.lo database_join.lo seusers_policy.lo ports_local.lo database_activedb.lo ports_policydb.lo user_extra_record.lo nodes_policy.lo users_policy.lo ports_file.lo database_policydb.lo iface_record.lo node_record.lo user_base_record.lo booleans_active.lo conf-scan.lo conf-parse.lo -lsepol -laudit -lselinux -lbz2 -lustr -L/usr/lib32 -Wl,-soname,libsemanage.so.1,--version-script=libsemanage.map,-z,defs ranlib libsemanage.a /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../libaudit.so when searching for -laudit /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../libaudit.a when searching for -laudit /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libaudit.so when searching for -laudit /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libaudit.a when searching for -laudit /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -laudit collect2: error: ld returned 1 exit status make[1]: *** [libsemanage.so.1] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory `/home/portage/sys-libs/libsemanage-2.2-r3/work/libsemanage-2.2-x86/src' make: *** [all] Error 2 * ERROR: sys-libs/libsemanage-2.2-r3::seden failed (compile phase): * emake failed -------- I have looked, it is libaudit only (as far as I can see) : -------- $ l /usr/lib64/libaudit* -rw-r--r-- 1 root root 352K 7. Mai 18:48 /usr/lib64/libaudit.a -rw-r--r-- 1 root root 920 7. Mai 18:48 /usr/lib64/libaudit.la -rwxr-xr-x 1 root root 527 7. Mai 18:48 /usr/lib64/libaudit.so $ l /usr/lib32/libaudit* ls: cannot access /usr/lib32/libaudit*: No such file or directory -------- An none of the libaudit ebuilds supports ABI multilib. Once that is fixed, all should be well. However, someone should take a good look, because the multilib and multilib-build eclasses are quite new to me. Created attachment 376604 [details, diff]
Patch from ustr-1.0.4-r3 to multilib building enabled ustr-1.0.4-r4
Patches in multilib (ABI enabled) building and installing.
Fortunately the Makefile was already prepared to do the right thing, and no wrapping of headers is needed. ustr-config.h is simply substituted by one that automatically pulls in the proper ustr-config-32.h or ustr-config-64.h.
Created attachment 376606 [details, diff]
Add multilib build support to look in the correct lib dirs
Unfortunately this is not enough, as there is no ABI-enabled version of libaudit.
Thanks, I've committed ustr already and will look into the audit stuff. audit-2.2.2-r2 has multilib support and provides 32-bit libraries if requested. It's pmasked for now though as unmasking it is something to be done as part of a larger unmasking set (emul-something). libsemanage-2.3-r1 is committed to the tree, but has been p.masked as well as it depends on audit-2.2.2-r2 which is p.masked. libsemanage-2.3-r2 is in the tree and stable |