Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 436752 - sys-apps/busybox[selinux] static linking with sys-libs/libselinux-2.1.12 fails due to undefined reference to pcre_free
Summary: sys-apps/busybox[selinux] static linking with sys-libs/libselinux-2.1.12 fail...
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard: selinux-utils
Keywords:
: 439078 (view as bug list)
Depends on:
Blocks: 438998
  Show dependency tree
 
Reported: 2012-10-01 08:04 UTC by iGentoo
Modified: 2012-11-17 17:01 UTC (History)
5 users (show)

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


Attachments
build logs (build.log.tar.bz2,25.69 KB, application/x-bzip-compressed-tar)
2012-10-01 08:05 UTC, iGentoo
Details
busybox-1.20.2.ebuild.diff (busybox-1.20.2.ebuild.diff,896 bytes, patch)
2012-10-01 08:06 UTC, iGentoo
Details | Diff
build log for failed busybox installation (for libpcre) (build.log,424.90 KB, text/plain)
2012-10-28 14:17 UTC, Sven Vermeulen (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description iGentoo 2012-10-01 08:04:15 UTC
* # CONFIG_PAM is not set
make -j1 CONFIG_STATIC=y busybox 
scripts/kconfig/conf -s Config.in
#
# using defaults found in .config
#
  SPLIT   include/autoconf.h -> include/config/*
  GEN     include/bbconfigopts.h
  HOSTCC  applets/usage
applets/usage.c: In function ‘main’:
applets/usage.c:52:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
  GEN     include/usage_compressed.h
  HOSTCC  applets/applet_tables
applets/applet_tables.c: In function ‘main’:
applets/applet_tables.c:144:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
  GEN     include/applet_tables.h
  CC      applets/applets.o
  LD      applets/built-in.o
  HOSTCC  applets/usage_pod
applets/usage_pod.c: In function ‘main’:
applets/usage_pod.c:74:3: warning: format not a string literal and no format arguments [-Wformat-security]
  CC      libbb/appletlib.o
  AR      libbb/lib.a
  CC      loginutils/login.o
  AR      loginutils/lib.a
  CC      miscutils/bbconfig.o
  AR      miscutils/lib.a
  CC      networking/httpd.o
  AR      networking/lib.a
  LINK    busybox_unstripped
Trying libraries: crypt m selinux sepol
Failed: -Wl,--start-group -lcrypt -lm -lselinux -lsepol -Wl,--end-group
Output of:
x86_64-pc-linux-gnu-gcc -O2 -pipe -w -fno-strict-aliasing -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -Wold-style-definition -fno-builtin-strlen -finline-limit=0 -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -fpie -static -pie -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--sort-section=alignment -o busybox_unstripped -Wl,--sort-common -Wl,--sort-section,alignment -Wl,--start-group applets/built-in.o archival/lib.a archival/libarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a mailutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a printutils/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a util-linux/volume_id/lib.a archival/built-in.o archival/libarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o mailutils/built-in.o miscutils/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o printutils/built-in.o procps/built-in.o runit/built-in.o selinux/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o util-linux/volume_id/built-in.o -Wl,--end-group -Wl,--start-group -lcrypt -lm -lselinux -lsepol -Wl,--end-group
==========
debianutils/lib.a(mktemp.o): In function `mktemp_main':
mktemp.c:(.text.mktemp_main+0xd5): warning: the use of `tempnam' is dangerous, better use `mkstemp'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64/libselinux.a(seusers.o): In function `getseuserbyname':
(.text+0x34f): warning: Using 'getgrouplist' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64/libselinux.a(seusers.o): In function `getseuserbyname':
(.text+0x31e): warning: Using 'getgrnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64/libselinux.a(seusers.o): In function `getseuserbyname':
(.text+0x54d): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
networking/lib.a(nslookup.o): In function `print_host':
nslookup.c:(.text.print_host+0x4e): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libbb/lib.a(inet_common.o): In function `INET_rresolve':
inet_common.c:(.text.INET_rresolve+0x114): warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libbb/lib.a(inet_common.o): In function `INET_resolve':
inet_common.c:(.text.INET_resolve+0xeb): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libbb/lib.a(inet_common.o): In function `INET_rresolve':
inet_common.c:(.text.INET_rresolve+0x194): warning: Using 'getnetbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libbb/lib.a(inet_common.o): In function `INET_resolve':
inet_common.c:(.text.INET_resolve+0x106): warning: Using 'getnetbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libbb/lib.a(xconnect.o): In function `bb_lookup_port':
xconnect.c:(.text.bb_lookup_port+0x51): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
networking/lib.a(netstat.o): In function `ip_port_str':
netstat.c:(.text.ip_port_str+0x9e): warning: Using 'getservbyport' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64/libselinux.a(label_file.o): In function `closef':
(.text+0x1ad): undefined reference to `pcre_free'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64/libselinux.a(label_file.o): In function `closef':
(.text+0x1b8): undefined reference to `pcre_free_study'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64/libselinux.a(label_file.o): In function `compile_regex.isra.6':
(.text+0x2d1): undefined reference to `pcre_compile'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64/libselinux.a(label_file.o): In function `compile_regex.isra.6':
(.text+0x2f2): undefined reference to `pcre_study'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64/libselinux.a(label_file.o): In function `lookup':
(.text+0x559): undefined reference to `pcre_exec'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64/libselinux.a(label_file.o): In function `lookup':
(.text+0x5cc): undefined reference to `pcre_exec'
collect2: error: ld returned 1 exit status
make: *** [busybox_unstripped] Error 1
 * ERROR: sys-apps/busybox-1.20.2 failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-apps/busybox-1.20.2'`,
 * the complete build log and the output of `emerge -pqv '=sys-apps/busybox-1.20.2'`.
 * The complete build log is located at '/var/log/portage/build/sys-apps/busybox-1.20.2:20121001-071949.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/sys-apps/busybox-1.20.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/busybox-1.20.2/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-apps/busybox-1.20.2/work/busybox-1.20.2'
 * S: '/var/tmp/portage/sys-apps/busybox-1.20.2/work/busybox-1.20.2'

emerge --info busybox libselinux libpcre

Portage 2.2.0_alpha134 (hardened/linux/amd64/selinux, gcc-4.7.2, glibc-2.16.0, 3.6.0-rc7-custom x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.6.0-rc7-custom-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9300_@_2.50GHz-with-gentoo-2.2
Timestamp of tree: Mon, 01 Oct 2012 07:00:01 +0000
ccache version 3.1.8 [disabled]
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12
dev-lang/python:          2.7.3-r2, 3.2.3-r1
dev-util/ccache:          3.1.8
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.10.5
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.4
sys-devel/binutils:       2.22.90
sys-devel/gcc:            4.6.3, 4.7.2::custom
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.5 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo systemd hardened-dev custom
Installed sets: @local-boot, @local-protected, @local-selibs
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Wall -Wextra -march=native -pipe -O3 -fno-tree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/emul /usr/share/config /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/portage/sets /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-Wall -Wextra -march=native -pipe -O3 -fno-tree-vectorize"
DISTDIR="/usr/local/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles multilib-strict news parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms split-elog split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirrors.163.com/gentoo http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--sort-section=alignment"
LINGUAS="en en_US zh zh_CN"
MAKEOPTS="V=1 -j10"
PKGDIR="/usr/local/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS="-9ef"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--ipv4"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --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/systemd /var/lib/layman/hardened-development /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl alsa amd64 audit bash-completion berkdb bzip2 c++0x cairo caps cli cracklib crypt custom-cflags cxx dbus dri ffmpeg gdbm gmp gnome gpm gtk gtk3 hardened iconv icu ipv6 jit jpeg jpeg2k justify lzma mmx modules mudflap multilib ncurses nls nptl open_perms opengl openmp orc pam pcre png pppd pulseaudio qt4 readline selinux session sse sse2 ssl svg systemd tcpd threads tiff udev unicode urandom vim-syntax xattr xinetd zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="bootchart btrfs caps dmsquash-live gensplash livenet lvm nfs ssh-client syslog systemd" 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 ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US zh zh_CN" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" QEMU_SOFTMMU_TARGETS="arm mips64el x86_64" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nouveau 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-apps/busybox-1.20.2 was built with the following:
USE="ipv6 math mdev (multilib) pam savedconfig selinux -livecd -make-symlinks -sep-usr -static"
CFLAGS="-Wall -Wextra -march=native -pipe -O3 -fno-tree-vectorize -fno-strict-aliasing"
CXXFLAGS="-Wall -Wextra -march=native -pipe -O3 -fno-tree-vectorize -fno-strict-aliasing"


sys-libs/libselinux-2.1.12 was built with the following:
USE="(multilib) (python) -ruby" RUBY_TARGETS="ruby18"


dev-libs/libpcre-8.31 was built with the following:
USE="bzip2 cxx jit (multilib) readline recursion-limit static-libs (unicode) zlib -libedit -pcre16"
Comment 1 iGentoo 2012-10-01 08:05:51 UTC
Created attachment 325444 [details]
build logs
Comment 2 iGentoo 2012-10-01 08:06:17 UTC
Created attachment 325446 [details, diff]
busybox-1.20.2.ebuild.diff
Comment 3 SpanKY gentoo-dev 2012-10-02 19:27:01 UTC
Comment on attachment 325446 [details, diff]
busybox-1.20.2.ebuild.diff

this is not correct for many reasons
Comment 4 SpanKY gentoo-dev 2012-10-02 19:28:00 UTC
there is no selinux-2.1.12 in the tree that i can see
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-03 20:20:54 UTC
libselinux-2.1.12 is in hardened-dev overlay for now.

libpcre is marked as a dependency, and I had to include "-lpcre" in the LDFLAGS to build it correctly, but that should be set in the ebuild for now too.

Is the fix you need something we can include in the libselinux ebuild instead (as its the cause and target of failure)?
Comment 6 SpanKY gentoo-dev 2012-10-03 20:47:13 UTC
(In reply to comment #5)

no ebuild should be hardcoding -lpcre.  we should be going through pkg-config.
i can update busybox to use that instead.
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-06 14:16:17 UTC
I surely can update the libselinux ebuild for this. Is the following then ok?

diff --git a/sys-libs/libselinux/libselinux-2.1.12.ebuild b/sys-libs/libselinux/libselinux-2.1.12.ebuild
index cbb227e..3c7831b 100644
--- a/sys-libs/libselinux/libselinux-2.1.12.ebuild
+++ b/sys-libs/libselinux/libselinux-2.1.12.ebuild
@@ -55,12 +55,12 @@ src_prepare() {
 }
 
 src_compile() {
-       emake AR="$(tc-getAR)" CC="$(tc-getCC)" LDFLAGS="-fPIC -lpcre ${LDFLAGS}" all || die
+       emake AR="$(tc-getAR)" CC="$(tc-getCC)" LDFLAGS="-fPIC $(pkg-config --libs libpcre) ${LDFLAGS}" all || die
 
        if use python; then
                python_copy_sources src
                building() {
-                       emake CC="$(tc-getCC)" PYINC="-I$(python_get_includedir)" PYTHONLIBDIR="$(python_get_library -l)" PYPREFIX="python-$(python_get_version)" LDFLAGS="-fPIC -lpcre ${LDFLAGS}" pywrap
+                       emake CC="$(tc-getCC)" PYINC="-I$(python_get_includedir)" PYTHONLIBDIR="$(python_get_library -l)" PYPREFIX="python-$(python_get_version)" LDFLAGS="-fPIC $(pkg-config --libs libpcre) ${LDFLAGS}" pywrap
                }
                python_execute_function -s --source-dir src building
        fi
Comment 8 Jory A. Pratt gentoo-dev 2012-10-08 15:56:05 UTC
Couldn't busybox be built to use the shared libs instead of static? I thought we had the ability to pass -static to the linker to accomplish this.
Comment 9 SpanKY gentoo-dev 2012-10-09 21:49:18 UTC
(In reply to comment #7)

you should use $(tc-getPKG_CONFIG) and not "pkg-config"

however, what i meant was for the libselinux.pc file itself to get fixed.  atm it only says:
  Requires.private: libsepol

that should instead be:
  Requires.private: libsepol libpcre

once that is fixed, doing `pkg-config libselinux` will return the correct results so other packages will "just work" and not incorrectly hardcode -lpcre in their own build setups.
Comment 10 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-14 12:32:54 UTC
I notice that the pkg-config setup also has a Libs: entry, should that too be updated? Like so?

-Requires.private: libsepol
-Libs: -L${libdir} -lselinux
+Requires.private: libsepol libpcre
+Libs: -L${libdir} -lselinux -lpcr
Comment 11 SpanKY gentoo-dev 2012-10-14 18:02:22 UTC
(In reply to comment #10)

no.  just update Requires.private.
Comment 12 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-19 18:41:37 UTC
sys-libs/libselinux-2.1.12-r1 in hardened-dev overlay, uses tc-getPKG_CONFIG and has libpcre in the Requires.private part of libselinux.pc
Comment 13 SpanKY gentoo-dev 2012-10-20 16:15:47 UTC
*** Bug 439078 has been marked as a duplicate of this bug. ***
Comment 15 SpanKY gentoo-dev 2012-10-22 02:29:24 UTC
(In reply to comment #12)

btw, i see that 2.1.12 was merged to the main tree sans the .pc fix, so this is going to start biting people more and basically won't be fixable until 2.1.12-r1 is added.
Comment 16 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-28 14:15:49 UTC
I still get a related failure:

"""
Trying libraries: crypt m pcre selinux sepol
Failed: -Wl,--start-group -lcrypt -lm -lpcre -lselinux -lsepol -Wl,--end-group
Output of:
x86_64-pc-linux-gnu-gcc -march=native -ggdb -O2 -pipe -fno-strict-aliasing -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -Wold-style-definition -fno-builtin-strlen -finline-limit=0 -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -static -Wl,-O1 -Wl,--as-needed -o busybox_unstripped -Wl,--sort-common -Wl,--sort-section,alignment -Wl,--start-group applets/built-in.o archival/lib.a archival/libarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a mailutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a printutils/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a util-linux/volume_id/lib.a archival/built-in.o archival/libarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o mailutils/built-in.o miscutils/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o printutils/built-in.o procps/built-in.o runit/built-in.o selinux/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o util-linux/volume_id/built-in.o -Wl,--end-group -Wl,--start-group -lcrypt -lm -lpcre -lselinux -lsepol -Wl,--end-group
==========
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lpcre
collect2: ld returned 1 exit status
make: *** [busybox_unstripped] Error 1
"""

Yet my libselinux.pc file on the system only mentions libpcre in the Requires.private part. Build log will be attached hereafter.
Comment 17 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-28 14:17:08 UTC
Created attachment 327584 [details]
build log for failed busybox installation (for libpcre)
Comment 18 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-28 14:18:12 UTC
I also think the failure is because libpcre doesn't provide a libpcre.a file...
Comment 19 SpanKY gentoo-dev 2012-10-28 16:59:22 UTC
(In reply to comment #18)

you need to update libselinux to RDEPEND on libpcre[static-libs] when libselinux itself is built with USE=static-libs
Comment 20 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-28 18:14:32 UTC
Okay, libselinux currently doesn't listen to the static-libs USE flag, but I'll add it to IUSE and use libpcre[static-libs?] within the RDEPEND variable.
Comment 21 SpanKY gentoo-dev 2012-10-28 18:21:19 UTC
(In reply to comment #20)

sounds like a good time to add USE=static-libs support to libselinux so it doesn't install libselinux.a
Comment 22 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-28 21:13:40 UTC
Ok, I remove libselinux.a if USE="static-libs" isn't set, and depend on libpcre[static-libs?]. Having built with USE="static-libs" it pulls in libpcre[static-libs], and busybox installs correctly.

However, when building with USE="-static-libs", it removes the libselinux.a file (I just rm the file in the src_install phase) but busybox still fails to build on it with the error message:
"""
x86_64-pc-linux-gnu-gcc -march=native -ggdb -O2 -pipe -fno-strict-aliasing -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -Wold-style-definition -fno-builtin-strlen -finline-limit=0 -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -static -Wl,-O1 -Wl,--as-needed -o busybox_unstripped -Wl,--sort-common -Wl,--sort-section,alignment -Wl,--start-group applets/built-in.o archival/lib.a archival/libarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a mailutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a printutils/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a util-linux/volume_id/lib.a archival/built-in.o archival/libarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o mailutils/built-in.o miscutils/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o printutils/built-in.o procps/built-in.o runit/built-in.o selinux/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o util-linux/volume_id/built-in.o -Wl,--end-group -Wl,--start-group -lcrypt -lm -lpcre -lselinux -lsepol -Wl,--end-group
==========
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lpcre
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lselinux
collect2: ld returned 1 exit status
make: *** [busybox_unstripped] Error 1
"""

BTW, if busybox isn't built with USE="static", why does it call emake CONFIG_STATIC=y busybox? I tried it with CONFIG_STATIC=n and it builds (but haven't tested the results).
Comment 23 SpanKY gentoo-dev 2012-10-29 04:00:25 UTC
(In reply to comment #22)

busybox always provides a static rescue shell regardless of USE=static.  i can update the ebuild's DEPEND to pull in the right selinux USE settings.
Comment 24 Sven Vermeulen (RETIRED) gentoo-dev 2012-10-29 15:38:53 UTC
Ok, updated libselinux-2.12.1-r1 committed to main tree. 

@SpanKY/vapier: yes, depending on libselinux[static-libs] should fix the failures
Comment 25 SpanKY gentoo-dev 2012-11-02 18:59:21 UTC
Commit message: Make USE=static the default to reflect what we have always been doing (building /bin/bb statically), and depend on libselinux[static-libs] as need be
http://sources.gentoo.org/sys-apps/busybox/busybox-1.20.2.ebuild?r1=1.11&r2=1.12
http://sources.gentoo.org/sys-apps/busybox/busybox-9999.ebuild?r1=1.6&r2=1.7
http://sources.gentoo.org/sys-apps/busybox/metadata.xml?r1=1.13&r2=1.14
Comment 26 Sven Vermeulen (RETIRED) gentoo-dev 2012-11-10 17:17:41 UTC
Marking as VERIFIED:TEST-REQUEST since its in ~arch
Comment 27 Anton Kochkov 2012-11-10 17:42:08 UTC
(In reply to comment #26)
> Marking as VERIFIED:TEST-REQUEST since its in ~arch

Works for me.
Comment 28 Sven Vermeulen (RETIRED) gentoo-dev 2012-11-17 17:01:58 UTC
recent selinux userspace utilities are now stabilized