Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 184912 - net-dns/avahi-0.6.19-r1 build fails on hardened - Missing POSIX Threads support
Summary: net-dns/avahi-0.6.19-r1 build fails on hardened - Missing POSIX Threads support
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Sven Wegener
URL: http://rafb.net/p/hqEtIc93.html
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-11 01:12 UTC by James Browning
Modified: 2008-09-21 20:11 UTC (History)
2 users (show)

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


Attachments
Avahi config log (config.log,49.70 KB, text/plain)
2007-07-12 18:22 UTC, James Browning
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Browning 2007-07-11 01:12:30 UTC
Avahi fails to emerge on my hardened x86 Gentoo Linux box.
It complains about incosistant threading.

Reproducible: Always

Steps to Reproduce:
1. set up a hardened gentoo x86 bow w/ glibc 2.5-r4
2. emerge avahi

Actual Results:  
avahi crashed

Expected Results:  
avahi should emerge.

the ebuild cranks out.
::snip::
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking whether to check for GCC pthread/shared inconsistencies... yes
checking whether -pthread is sufficient with -shared... no
checking whether -lpthread fixes that... no
checking whether -lc_r fixes that... no
configure: WARNING: Impossible to determine how to use pthreads with shared libraries
configure: error: Missing POSIX Threads support
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-07-11 07:01:33 UTC
Please, don't refer to pastebins in bugs. Attach the config.log and post your emerge --info here.
Comment 2 James Browning 2007-07-12 18:17:25 UTC
Portage 2.1.2.9 (hardened/x86/2.6, gcc-3.4.6, glibc-2.5-r4, 2.6.17-hardened-r1-i686b i686)
=================================================================
System uname: 2.6.17-hardened-r1-i686b i686 Intel(R) Celeron(R) CPU 2.66GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Thu, 12 Jul 2007 17:50:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -g -ggdb"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=prescott -O2 -pipe -g -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg candy ccache distlocks metadata-transfer nostrip parallel-fetch sandbox severe sfperms strict userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://mirror.usu.edu/mirrors/gentoo/ ftp://ftp.wwc.edu/pub/mirrors/ftp.gentoo.org "
LDFLAGS="-nopie"
PKGDIR="/usr/portage/packages.prescott"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="   "
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X acl acpi alsa apache2 arts artworkextra avahi berkdb branding bzip2 cddb cdr cdrom cgi crypt curl dbus debug debug-freelist debug-malloc debugger dmi double-precision dri dvd dvdr dvdread dvi eds examples fam fbdev fbsplash ffmpeg freeimage fuse gcc64 gcj gdbm gif glibc-compat20 glitz gnome gnome-print gnomecanvas gnomedb gnustep gnutls gtk gtk2 gtkhtml gtkspell hal hardened ipv6 java javascript jpeg jpeg2k kdrive kerberos lcms ldap mad mdnsresponder-compat midi motif mp3 mp4 mpeg mpeg2 mplayer msn msnextras multilib nautilus ncurses net nls nntp nptl nptlonly numeric objhc offensive ogg openexr opengl openssl pam pam_chroot pam_console pam_timestamp pango paste64 patch pdf perl pic pmu png python qt3 quicktime quotas rdesktop readline real rogue sdl slp spell ssl svg sysfs t1lib tcl tcpd threads threadsafe threadsonly tiff tk truetype truetype-fonts urandom usb utempter v4l vorbis win32codecs x86 xcomposite xine xorg yahoo zeroconf zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev vmmouse void" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="dummy fbdev i810 trident v4l vesa vga vmware"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 James Browning 2007-07-12 18:22:58 UTC
Created attachment 124669 [details]
Avahi config log
Comment 4 James Browning 2007-07-12 18:24:19 UTC
Guess I should have done that in reverse...
Comment 5 Sven Wegener gentoo-dev 2007-07-12 18:52:27 UTC
configure:20459: i686-pc-linux-gnu-gcc -o conftest -shared -fPIC -Wl,-z,defs -march=prescott -O2 -pipe -g -ggdb -fstack-protector -pthread  -nopie conftest.c -lpthread   >&5
i686-pc-linux-gnu-gcc: -shared and -static|pie|fPIE|fpie|fno-PIC|fno-pic|nopie are incompatible

Your LDFLAGS="-nopie" is breaking it. I don't consider -nopie a supported global flag for LDFLAGS, as LDFLAGS is always used, not only for ET_EXEC. We could argue that -nopie is only for ET_EXEC and with -shared the linker should ignore it. Hardened Team, your opinion?
Comment 6 James Browning 2008-09-21 20:11:53 UTC
I'd forgotten about this bug. removing -nopie from ldflags appeared to have made it work. I should have posted this 14 months ago. I recall I got the idea from somewhere, but I don't recall where.