Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 133236 - app-misc/pax-utils does not compile with -Wl,--as-needed and USE=caps
Summary: app-misc/pax-utils does not compile with -Wl,--as-needed and USE=caps
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: High normal
Assignee: solar (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-13 14:23 UTC by Sascha G.
Modified: 2006-05-13 18:48 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha G. 2006-05-13 14:23:48 UTC
pax-utils fails to compile with LDFLAGS=-Wl,--as-needed and USE=caps:

i686-pc-linux-gnu-gcc -O2 -pipe -march=pentium4 -fomit-frame-pointer -DWANT_SYSCAP -Wl,--as-needed -lcap paxinc.o paxelf.o -o pspax pspax.o
pspax.o: In function `.L30':
pspax.c:(.text+0x448): undefined reference to `cap_init'
pspax.c:(.text+0x9ce): undefined reference to `capgetp'
pspax.c:(.text+0x9e0): undefined reference to `cap_to_text'
pspax.c:(.text+0xb31): undefined reference to `cap_free'
collect2: ld returned 1 exit status
make: *** [pspax] Error 1

The solution is to put -lcap at the end, i.e.:
i686-pc-linux-gnu-gcc -O2 -pipe -march=pentium4 -fomit-frame-pointer -DWANT_SYSCAP -Wl,--as-needed  paxinc.o paxelf.o -o pspax pspax.o -lcap

Unfortunately, I do not know how to modify the ebuild appropriately.

Changing
emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" pspax || die
to
emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" pspax LDFLAGS="${LDFLAGS}" || die
does not do what I intended.


Gentoo Base System version 1.6.15
Portage 2.1_pre10-r5 (selinux/2005.1/x86/hardened, gcc-3.4.6, glibc-2.3.6-r4, 2.6.16-hardened-r6 i686)
=================================================================
System uname: 2.6.16-hardened-r6 i686 Intel(R) Pentium(R) 4 CPU 1.60GHz
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.92
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe -march=pentium4 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical"
FEATURES="autoconfig collision-protect distlocks loadpolicy metadata-transfer parallel-fetch sandbox selinux sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from /etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file -
-delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/pac
kages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 X a52 aac alsa bzip2 caps cjk crypt cups curl dts dvd dvdread ffmpeg flac gif glut gtk hardened idn ipv6 jpeg mad matroska mikmod mmap mmx mp3 ncurses nptl offensive ogg opengl pam pic png readline sdl selinux sndfile sse sse2 ssl theora threads tiff truetype unicode vorbis win32codecs xinerama xv xvid zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux linguas_en userland_GNU"
Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LC_ALL
Comment 1 solar (RETIRED) gentoo-dev 2006-05-13 16:29:04 UTC
Unless somebody posts a patch for this, I'm not that worried about it.
Comment 2 SpanKY gentoo-dev 2006-05-13 16:40:47 UTC
> Changing
> emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" pspax || die
> to
> emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" pspax LDFLAGS="${LDFLAGS}" || die
> does not do what I intended.

that's because that isnt how make works

fixed up in pax-utils cvs
Comment 3 Sascha G. 2006-05-13 18:48:23 UTC
(In reply to comment #2)
[...]
> that's because that isnt how make works

Now I know that. :-)

> fixed up in pax-utils cvs

Works nicely, thanks!
This really is much appreciated.