Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 525136

Summary: dev-libs/pth-2.0.7-r3 doesn't compile on musl
Product: Gentoo Linux Reporter: Philipp Ammann <philipp.ammann>
Component: [OLD] UnspecifiedAssignee: Gentoo musl team <musl>
Status: RESOLVED OBSOLETE    
Severity: normal CC: alonbl, blueness, embedded, gentoo, hardened, herrtimson
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702    

Description Philipp Ammann 2014-10-12 11:52:06 UTC
GNU PTH doesn't compile on musl due to some glibc-isms:

pth_mctx.c: In function ‘__pth_mctx_set’:
pth_mctx.c:480:2: error: #error "Unsupported Linux (g)libc version and/or platform"

In pth_mctx.c, they offer multiple variants to do the machine state switching. I manually edited the IFDEFs to try the various versions, but to no avail. According to the comments, variant 2 should run "really on _all_ POSIX compliant systems" but doesn't.

Sorry I can't offer a patch, but since I'm no programmer, editing the IFDEFs is really all I can do.






Reproducible: Always

Steps to Reproduce:
Compile dev-libs/pth on musl. Also happens on a fresh stage3 without any special ricer configs.



This is really just emerge --info from a fresh musl hardened stage3:

Portage 2.2.14_rc1 (python 2.7.7-final-0, hardened/linux/musl/amd64, gcc-4.7.4, musl-1.1.4, 3.14.14-gentoo x86_64)
=================================================================
System uname: Linux-3.14.14-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E3-1240_v3_@_3.40GHz-with-gentoo-2.2
KiB Mem:     3088196 total,   2761408 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Fri, 10 Oct 2014 15:30:01 +0000
ld GNU ld (Gentoo 2.23.2 p1.0) 2.23.2
app-shells/bash:          4.2_p45
dev-lang/perl:            5.18.2-r1
dev-lang/python:          2.7.7, 3.3.5-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4-r99::hardened-dev
sys-apps/sandbox:         2.6-r999::hardened-dev
sys-devel/autoconf:       2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.4-r99::hardened-dev
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-gentoo-linux-musl"
CFLAGS="-O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer"
DISTDIR="/var/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="charset.alias"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/var/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="/var/portage/repositories/gentoo"
PORTDIR_OVERLAY=""
USE="amd64 cli cracklib crypt cxx dri hardened iconv ipv6 mmx modules ncurses nptl openmp pax_kernel pcre pic readline session sse sse2 sse3 ssl ssse3 tcpd threads unicode vim-syntax xattr zlib" ABI_X86="64" 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="musl" 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l" 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"
USE_PYTHON="2.7"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC
Comment 1 Anthony Basile gentoo-dev 2014-10-12 12:15:07 UTC
(In reply to Philipp Ammann from comment #0)
> GNU PTH doesn't compile on musl due to some glibc-isms:
> 
> pth_mctx.c: In function ‘__pth_mctx_set’:
> pth_mctx.c:480:2: error: #error "Unsupported Linux (g)libc version and/or
> platform"
> 
> In pth_mctx.c, they offer multiple variants to do the machine state
> switching. I manually edited the IFDEFs to try the various versions, but to
> no avail. According to the comments, variant 2 should run "really on _all_
> POSIX compliant systems" but doesn't.
> 
> Sorry I can't offer a patch, but since I'm no programmer, editing the IFDEFs
> is really all I can do.
> 

Yes, this is a known issue.  pth is basically "portable" (heh!) threads which is pretty much dead. We do have a hacky fix, but its the wrong approach because pth insists on looking at implementation details which it should not.

I'm guessing you hit this because of gnupg-2.  If so, for now use gnupg-1.  there is a version of gnupg-2 which uses pth-ng which does work.  You can test that now if you like, or just wait until its stabilized.
Comment 2 Philipp Ammann 2014-10-12 13:09:04 UTC
> I'm guessing you hit this because of gnupg-2.  If so, for now use gnupg-1. 
> there is a version of gnupg-2 which uses pth-ng which does work.  You can
> test that now if you like, or just wait until its stabilized.

Yes, it's because of gnupg. The 2.1 beta (which relies on npth) doesn't compile, I'll have to look into that. And the ebuild pulls in a lot of hard dependencies (openldap and gnutls, among others), which - after a quick look at ./configure --help - may not be necessary. I'll notify you if I get it to work.

In the meantime, do you know if there's a patch for 2.0 to use npth?
Comment 3 Anthony Basile gentoo-dev 2014-10-12 13:40:38 UTC
(In reply to Philipp Ammann from comment #2)
> > I'm guessing you hit this because of gnupg-2.  If so, for now use gnupg-1. 
> > there is a version of gnupg-2 which uses pth-ng which does work.  You can
> > test that now if you like, or just wait until its stabilized.
> 
> Yes, it's because of gnupg. The 2.1 beta (which relies on npth) doesn't
> compile, I'll have to look into that. And the ebuild pulls in a lot of hard
> dependencies (openldap and gnutls, among others), which - after a quick look
> at ./configure --help - may not be necessary. I'll notify you if I get it to
> work.
> 
> In the meantime, do you know if there's a patch for 2.0 to use npth?

No sorry, no patch for 2.0 + npth.  Does npth at least compile on musl, let's start there.

We could open a bug for 2.1 beta independantly of musl.  I don't see why it should hard depend on openldap.  The gnutls dependency is probably unavoidable.  And I assume the other dependencies are secondary to openldap and gnutls.
Comment 4 Philipp Ammann 2014-10-12 14:42:20 UTC
(In reply to Anthony Basile from comment #3)
> No sorry, no patch for 2.0 + npth.  Does npth at least compile on musl,
> let's start there.

Yes npth-1.0 does compile on musl.

> We could open a bug for 2.1 beta independantly of musl.  I don't see why it
> should hard depend on openldap.  The gnutls dependency is probably
> unavoidable.  And I assume the other dependencies are secondary to openldap
> and gnutls.

See bug #525154
Comment 5 tt_1 2016-01-01 16:29:56 UTC
is it possible to mask dev-libs/pth for the musl profile?
Comment 6 Anthony Basile gentoo-dev 2016-01-01 18:18:10 UTC
(In reply to tt_1 from comment #5)
> is it possible to mask dev-libs/pth for the musl profile?

yep, done!
Comment 7 Alon Bar-Lev (RETIRED) gentoo-dev 2016-10-14 04:55:50 UTC
gnupg-2.1 uses npth
Comment 8 Haelwenn (lanodan) Monnier 2016-10-26 17:12:02 UTC
And so I think >=gnupg-2.1 should be stabilized for arm to really resolve this bug.
Comment 9 Alon Bar-Lev (RETIRED) gentoo-dev 2016-10-26 17:14:38 UTC
musl is not stable blocker as far as I know