Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 383549 - dev-libs/apr-1.4.5 fails to compile with: PTHREAD_PRIO_INHERIT undeclared when CPPFLAGS=" "
Summary: dev-libs/apr-1.4.5 fails to compile with: PTHREAD_PRIO_INHERIT undeclared whe...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL: https://issues.apache.org/bugzilla/sh...
Whiteboard:
Keywords:
Depends on:
Blocks: portage-multilib
  Show dependency tree
 
Reported: 2011-09-18 22:38 UTC by Konstantin M
Modified: 2013-01-03 18:42 UTC (History)
1 user (show)

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


Attachments
build.log of failed emerge (build.log,56.58 KB, text/plain)
2011-09-18 22:43 UTC, Konstantin M
Details
configure of apr-1.4.5 (configure.gz,193.36 KB, application/x-gzip)
2011-09-19 01:31 UTC, Konstantin M
Details
configure of apr-1.4.5 (gzipped) (configure.gz,193.36 KB, application/octet-stream)
2011-09-19 01:32 UTC, Konstantin M
Details
configure of apr-1.4.5 (gzipped) (configure.gz,193.36 KB, application/octet-stream)
2011-09-19 01:42 UTC, Konstantin M
Details
apr-r1152852-build-flags-extra.patch (apr-r1152852-build-flags-extra.patch,418 bytes, patch)
2011-09-19 04:17 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin M 2011-09-18 22:38:19 UTC
For a few weeks now, dev-libs/apr-1.4.5 fails to compile for me. This is the reason why:

locks/unix/proc_mutex.c: In function 'proc_mutex_proc_pthread_create':
locks/unix/proc_mutex.c:393:53: error: 'PTHREAD_PRIO_INHERIT' undeclared (first use in this function)

Apparently there have been similar errors some years ago, but I couldn't find anything recent.
NOTE: I'm using the multilib overlay. But since this happens during the amd64 compile, I think it isn't related to that.

Reproducible: Always

Steps to Reproduce:
1. emerge -au1 apr
Actual Results:  
Compilation failure

Expected Results:  
Successful compile

Portage 2.2.0_alpha55-r1 (default/linux/amd64/10.0, gcc-4.5.3, glibc-2.13-r4, 3.1.0-rc4 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.1.0-rc4-x86_64-Intel-R-_Core-TM-_i7_CPU_965_@_3.20GHz-with-gentoo-2.0.3
Timestamp of tree: Sun, 18 Sep 2011 21:00:01 +0000
app-shells/bash:          4.2_p10
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r2, 3.2-r2
dev-util/cmake:           2.8.5-r2
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.3-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1-r1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.4.6, 4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo multilib x11 enlightenment
Installed sets: 
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_IE.UTF-8"
LC_ALL="en_IE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en de"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/multilib /var/lib/layman/x11 /var/lib/layman/enlightenment"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acpi alsa amd64 avahi berkdb bzip2 cli consolekit cracklib crypt cups cxx d3d dbus dri gallium gdbm gdu gnutls gtk hddtemp iconv ipv6 java jpeg kpathsea lcms libkms libnotify lm_sensors midi mmx modules mp3 multilib ncurses nptl nptlonly nsplugin opengl openmp pam pcre perl png pppd pulseaudio python qt qt3support qt4 readline sdl semantic-desktop session smp sse sse2 ssl startup-notification svg sysfs tcpd threads thunar udev unicode usb xcomposite xorg zlib" 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" 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 stage tables krita karbon braindump" CAMERAS="canon 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 ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de" MULTILIB_ABIS="amd64 x86" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="r600 radeon vesa" 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" multilib_abi="x86"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Konstantin M 2011-09-18 22:43:46 UTC
Created attachment 286931 [details]
build.log of failed emerge
Comment 2 Konstantin M 2011-09-18 23:29:01 UTC
Fix for the problem:
CPPFLAGS=-D_XOPEN_SOURCE emerge -1au apr

Suggested by binki on irc (freenode #gentoo-multilib-overlay). Thanks !
Comment 3 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2011-09-19 01:12:19 UTC
Upon closer examination of build.log:

    * Running eautoreconf in '/var/tmp/portage/dev-libs/apr-1.4.5/work/apr-1.4.5' ...

and looking at the commandline of the compiler:

    -D_REENTRANT-D_GNU_SOURCE

This means that the autoconf scripts are trying to define _GNU_SOURCE which implies _XOPEN_SOURCE, but a very new version of either m4 or autoconf or a related package which luzipher is using is producing the erroneous CPPFLAGS quoted above.

I'll be looking for the right autoconf macro to patch to fix this problem...
Comment 4 Konstantin M 2011-09-19 01:31:07 UTC
Created attachment 286943 [details]
configure of apr-1.4.5
Comment 5 Konstantin M 2011-09-19 01:32:33 UTC
Created attachment 286945 [details]
configure of apr-1.4.5 (gzipped)
Comment 6 Konstantin M 2011-09-19 01:42:35 UTC
Created attachment 286947 [details]
configure of apr-1.4.5 (gzipped)
Comment 7 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2011-09-19 04:17:59 UTC
Created attachment 286967 [details, diff]
apr-r1152852-build-flags-extra.patch

Reproduce this bug by setting CPPFLAGS=" ".

This bug shows up for many portage-multilib users because we randomly add spaces to things like CPPFLAGS -- even when compiling the for the main ABI (and future portage-multilib won't distinguish between main and non-main ABI as much) --  http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=blob;f=bin/auto-multilib.sh;h=4cafc356fb20e3b889380fc0e9b2554a6d6d9a62;hb=375a9f2a59b734492d3d105f9272f1d2b9829fb4#l232

apr's configure script tries to separate user-supplied CPPFLAGS and ./configure-added CPPFLAGS after-the-fact by using sed. It tries to remove the original CPPFLAGS by essentially replacing the first instance of the user's CPPFLAGS with the empty string instead of using more careful string manipulation. This patch, submitted upstream, deals with the string in a more deterministic and reliable manner and thus fixes this bug.
Comment 8 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2012-03-14 17:10:54 UTC
This is fixed in dev-libs/apr-1.4.6.

Blocking bug #306835 since this is triggered by the multilib branch of sys-apps/portage.
Comment 9 Pacho Ramos gentoo-dev 2012-11-27 20:00:49 UTC
(In reply to comment #8)
> This is fixed in dev-libs/apr-1.4.6.
> 
> Blocking bug #306835 since this is triggered by the multilib branch of
> sys-apps/portage.
Comment 10 Pacho Ramos gentoo-dev 2013-01-03 18:42:38 UTC
(In reply to comment #8)
> This is fixed in dev-libs/apr-1.4.6.
> 
> Blocking bug #306835 since this is triggered by the multilib branch of
> sys-apps/portage.