Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 506460 - <sys-libs/libsemanage-2.3-r1 fails to emerge on multilib system with ABI_X86="32"
Summary: <sys-libs/libsemanage-2.3-r1 fails to emerge on multilib system with ABI_X86=...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: SELinux (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard: selinux-utils
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-01 13:13 UTC by Amadeusz Sławiński
Modified: 2014-08-01 21:12 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log with gcc-4.6.4 (sys-libs:libsemanage-2.2-r2:20140401-205244.log,3.99 KB, text/x-log)
2014-04-01 20:54 UTC, Amadeusz Sławiński
Details
build log with 4.8.2 (sys-libs:libsemanage-2.2-r2:20140401-205454.log,3.80 KB, text/x-log)
2014-04-01 20:55 UTC, Amadeusz Sławiński
Details
ustr-1.0.4-r4.ebuild (ustr-1.0.4-r3.ebuild,1.11 KB, text/plain)
2014-04-21 20:10 UTC, Sven Vermeulen (RETIRED)
Details
build.log with updated ustr (build.log,69.04 KB, text/x-log)
2014-04-21 20:11 UTC, Sven Vermeulen (RETIRED)
Details
Patch from ustr-1.0.4-r3 to multilib building enabled ustr-1.0.4-r4 (ustr-1.0.4-r3_to_ustr-1.0.4-r4.patch,1.68 KB, patch)
2014-05-09 08:28 UTC, Sven Eden
Details | Diff
Add multilib build support to look in the correct lib dirs (libsemanage-2.2-r2_to_libsemanage-2.2-r3.patch,1.71 KB, patch)
2014-05-09 08:29 UTC, Sven Eden
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Amadeusz Sławiński 2014-04-01 13:13:16 UTC
On multilib system:

make -C src all
make[1]: Entering directory '/var/tmp/portage/sys-libs/libsemanage-2.2-r2/work/libsemanage-2.2-x86/src'
x86_64-pc-linux-gnu-gcc -m32 -O2 -march=native -pipe -I../include -I/usr/include -D_GNU_SOURCE  -c -o users_join.o users_join.c
x86_64-pc-linux-gnu-gcc -m32 -O2 -march=native -pipe -I../include -I/usr/include -D_GNU_SOURCE  -c -o utilities.o utilities.c
x86_64-pc-linux-gnu-gcc -m32 -O2 -march=native -pipe -I../include -I/usr/include -D_GNU_SOURCE  -c -o ports_policy.o ports_policy.c
x86_64-pc-linux-gnu-gcc -m32 -O2 -march=native -pipe -I../include -I/usr/include -D_GNU_SOURCE  -c -o seusers_local.o seusers_local.c
x86_64-pc-linux-gnu-gcc -m32 -O2 -march=native -pipe -I../include -I/usr/include -D_GNU_SOURCE  -c -o port_record.o port_record.c
x86_64-pc-linux-gnu-gcc -m32 -O2 -march=native -pipe -I../include -I/usr/include -D_GNU_SOURCE  -c -o users_base_policydb.o users_base_policydb.c
In file included from /usr/include/ustr.h:14:0,
                 from utilities.c:29:
/usr/include/ustr-main.h:205:1: error: size of array ‘ustr__compiler_assert_small_size_t_limit64’ is negative
 USTR__COMPILE_ASSERT(USTR__SIZE_MAX >= 0xFFFFFFFFFFFFFFFFULL,
 ^
Makefile:113: recipe for target 'utilities.o' failed
make[1]: *** [utilities.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/var/tmp/portage/sys-libs/libsemanage-2.2-r2/work/libsemanage-2.2-x86/src'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2


Reproducible: Always




Portage 2.2.10 (hardened/linux/amd64/selinux, gcc-4.8.2, glibc-2.19, 3.13.6-hardened-r3 x86_64)
=================================================================
System uname: Linux-3.13.6-hardened-r3-x86_64-Intel-R-_Core-TM-_i3_CPU_M_350_@_2.27GHz-with-gentoo-2.2
KiB Mem:     2998944 total,    374632 free
KiB Swap:    3145724 total,   3145724 free
Timestamp of tree: Mon, 31 Mar 2014 00:45:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p45-r1
dev-lang/python:          2.7.6, 3.3.5, 3.4.0
dev-util/cmake:           2.8.12.2
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          9999
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.13.4, 1.14.1
sys-devel/binutils:       2.24-r2
sys-devel/gcc:            4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.19
Repositories: gentoo gamerlay local-overlay
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x skype-4.0.0.7-copyright"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/gamerlay /home/amade/overlay"
SYNC=""
USE="X aac acpi alsa amd64 berkdb bzip2 cli cracklib crypt cxx dbus dri dvd ffmpeg flac gdbm gif gnutls gold gpg hardened iconv icu ipv6 jpeg jpeg2k justify mmx mmxext mng modules mp3 multilib ncurses nls nptl open_perms opencl opengl openmp pam pax_kernel pcre png readline selinux session sse sse2 sse4_1 sse4_2 ssl ssse3 svg tcpd theora threads thunar tiff udev unicode urandom usb v4l vaapi vdpau vim-syntax x264 xattr xcb xft xinerama xpm xtpax zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB pl" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="x86_64 ppc" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Amadeusz Sławiński 2014-04-01 20:54:01 UTC
Created attachment 374050 [details]
build log with gcc-4.6.4

older gcc as requested per irc
Comment 2 Amadeusz Sławiński 2014-04-01 20:55:10 UTC
Created attachment 374052 [details]
build log with 4.8.2
Comment 3 Amadeusz Sławiński 2014-04-01 22:26:42 UTC
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
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2014-04-11 17:45:19 UTC
Is there a different include path to be used here for x86?

Is there a /usr/include32 or so?
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2014-04-11 21:53:55 UTC
(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
Comment 6 Sven Vermeulen (RETIRED) gentoo-dev 2014-04-21 20:09:05 UTC
@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.
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2014-04-21 20:10:00 UTC
Created attachment 375434 [details]
ustr-1.0.4-r4.ebuild

ustr-1.0.4-r4 ebuild that wraps ustr-main.h
Comment 8 Sven Vermeulen (RETIRED) gentoo-dev 2014-04-21 20:11:18 UTC
Created attachment 375436 [details]
build.log with updated ustr

libsemanage build log with updated dev-libs/ustr, which now fails on other locations
Comment 9 Sven Vermeulen (RETIRED) gentoo-dev 2014-04-21 20:14:28 UTC
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
Comment 10 Sven Eden 2014-04-22 10:40:58 UTC
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.
Comment 11 Amadeusz Sławiński 2014-04-22 16:54:24 UTC
Shouldn't the wrapped one be ustr-conf.h header?
Comment 12 Sven Eden 2014-04-23 08:28:38 UTC
(In reply to Amadeusz Sławiński from comment #11)
> Shouldn't the wrapped one be ustr-conf.h header?

I'll check that.
Comment 13 Sven Eden 2014-05-09 08:14:27 UTC
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.
Comment 14 Sven Eden 2014-05-09 08:28:40 UTC
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.
Comment 15 Sven Eden 2014-05-09 08:29:25 UTC
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.
Comment 16 Sven Vermeulen (RETIRED) gentoo-dev 2014-05-30 14:05:22 UTC
Thanks, I've committed ustr already and will look into the audit stuff.
Comment 17 Sven Vermeulen (RETIRED) gentoo-dev 2014-05-30 20:12:06 UTC
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).
Comment 18 Sven Vermeulen (RETIRED) gentoo-dev 2014-06-01 12:22:53 UTC
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.
Comment 19 Sven Vermeulen (RETIRED) gentoo-dev 2014-08-01 21:12:19 UTC
libsemanage-2.3-r2 is in the tree and stable