Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 670052 - mesa-18.2.1 TLS relocation error with musl-hardened profile
Summary: mesa-18.2.1 TLS relocation error with musl-hardened profile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo musl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-31 18:47 UTC by Steve Arnold
Modified: 2020-03-16 17:26 UTC (History)
1 user (show)

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


Attachments
upstream patch to control glx-tls support (0001-Allow-disable-tls-for-musl.patch,1.18 KB, patch)
2019-03-07 21:48 UTC, Jory A. Pratt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Arnold archtester gentoo-dev 2018-10-31 18:47:30 UTC
This actually pulled in newer packages from the main tree first (before I noticed the gdk-pixbuf-query-loaders fail because adwaita-icon-theme blows up (note this is still building in a chroot).

# gdk-pixbuf-query-loaders --update-cache
g_module_open() failed for /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: Error relocating /usr/lib/libGL.so.1: _glapi_tls_Dispatch: initial-exec TLS resolves to dynamic definition in /usr/lib/libglapi.so.0

I masked out some packages and rebuilt using musl overlay, then I added some patches from an xorg bug:

https://bugs.freedesktop.org/show_bug.cgi?id=35268

and rebuilt, same error.  Lemme know what else you need to see.

# emerge --info
Portage 2.3.51 (python 3.6.6-final-0, default/linux/amd64/17.0/musl/hardened/selinux, gcc-7.3.0, musl-1.1.20-r1, 4.15.12-gentoo x86_64)
=================================================================
System uname: Linux-4.15.12-gentoo-x86_64-Intel-R-_Core-TM-_i5_CPU_M_520_@_2.40GHz-with-gentoo-2.6
KiB Mem:     5955860 total,   1993324 free
KiB Swap:   12572668 total,  12571376 free
Timestamp of repository gentoo: Mon, 29 Oct 2018 00:45:01 +0000
Head commit of repository gentoo: 4a4db851d0c697581069d638fe88cc56ccb8754b
sh bash 4.4_p23
ld GNU ld (Gentoo 2.30 p2) 2.30.0
app-shells/bash:          4.4_p23::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.6::gentoo
dev-util/cmake:           3.12.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.2::gentoo
sys-apps/sandbox:         2.13::musl
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r2::gentoo, 2.31.1-r1::gentoo
sys-devel/gcc:            7.3.0-r6::musl, 8.2.0-r4::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/musl:            1.1.20-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

musl
    location: /usr/local/musl
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA @GPL-COMPATIBLE @OSI-APPROVED @EULA dlj-1.1 skype-eula googleearth AdobeFlash-10.1"
CBUILD="x86_64-gentoo-linux-musl"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nostrip parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms strict 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"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_US en"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_BZIP2_COMMAND="/bin/bzip2"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 amr apache2 apng aspell audit avahi bluetooth bzip2 bzlib caps cdda cdr consolekit crypt cups curl cxx dbus diff djvu dnotify dts dvd enchant exif expat fam firefox3 flac fortran gd gif git glade glamor gmp gnome-keyring gnome-online-accounts gnutls gstreamer gtk gtk3 hardened iconv imagemagick inotify introspection ipv6 jpeg json lcms libav libnotify libsecret libtirpc lua lz4 mng mp3 nautilus ncurses networking networkmanager nfs nls nptl nptlonly nsplugin ogg open_perms opengl openmp orc pam pango pax_kernel pcre pda pdf peer_perms pic pie pkcs11 png policykit pulseaudio python qt5 readline rtc samba sasl sdl seamonkey seccomp selinux sip slp smartcard snmp spell sqlite ssh ssl ssp startup-notification svg system-cairo system-harfbuzz system-icu system-jpeg system-libvpx system-sqlite tcl tcpd text theora threads thunar tiff tk truetype ubac udev udisks unicode upower usb v4l vala vorbis webp wheel wifi x264 xattr xcb xkb xml xtpax zeroconf zlib" ABI_X86="64" ALSA_CARDS="hda-intel usb-audio" APACHE2_MODULES="actions alias authn_core authz_core cgid access_compat auth_digest auth_basic authn_alias authn_anon cache_disk cern_meta authn_dbm authn_default authn_file authz_dbm authz_default cache authz_groupfile authz_host authz_owner authz_user unixd socache_shmcb autoindex 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 proxy proxy_connect proxy_http rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage words" CAMERAS="ptp2 agfa_cl20 canon casio_qv clicksmart310 digigr8 digita dimagev directory fuji hp215 iclick jamcam kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 spca50x" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 sse3" CURL_SSL="openssl" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-32 efi-64 pc" INPUT_DEVICES="keyboard mouse joystick evdev synaptics" KERNEL="linux" L10N="en-US en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-minimizer wiki-publisher" LLVM_TARGETS="AMDGPU BPF NVPTX X86 AArch64 ARM Hexagon MSP430 Mips Lanai RISCV PowerPC Sparc SystemZ XCore" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" QEMU_SOFTMMU_TARGETS="arm i386 microblaze mips mips64 mips64el mipsel mipsn32 mipsn32el ppc ppc64 x86_64" QEMU_USER_TARGETS="arm i386 microblaze mips mips64 mips64el mipsel ppc ppc64 x86_64" RUBY_TARGETS="ruby23" SANE_BACKENDS="net" USERLAND="GNU" VIDEO_CARDS="intel i915 i965 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"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Steve Arnold archtester gentoo-dev 2018-10-31 20:21:36 UTC
So far, only media-libs/mesa-18.1.9 from musl overlay seems to work.
Comment 2 Anthony Basile gentoo-dev 2018-11-09 13:43:47 UTC
(In reply to Steve Arnold from comment #1)
> So far, only media-libs/mesa-18.1.9 from musl overlay seems to work.

I forward ported the mesa patches from the overlay to mesa-18.2.4.  It builds but doesn't address the initial-exec TLS issue.
Comment 3 Fabio Scaccabarozzi 2019-01-26 09:51:18 UTC
I encountered the same issue when setting up a new chroot, as adwaita-icon-theme was a dependency for other packages and would constantly break the "emerge -e1 @world" halfway.

I locally patched mesa ebuild with "-Dglx-tls=false" appended to emesonargs (just before "meson_src_configure", but can't test yet whether mesa actually works with this.

Also note that while it makes adwaita work and there's no more errors about relocation of symbols, I am not sure about the runtime consequences of disabling this, and apparently upstream expects it to be enabled by default ( https://patchwork.freedesktop.org/patch/125627/ , https://bugs.freedesktop.org/show_bug.cgi?id=72902 ).
Comment 4 tt_1 2019-02-03 15:17:05 UTC
to pass --disable-glx-tls did the trick for me at runtime for mesa-18.1.6, nptl useflag has to be disabled to trigger the switch. 

problem is: that use flag is gone for 18.2*, still the issue should be solvable by passing --disable-glx-tls 

I'm going to open a pullrequest for the overlay, with mesa-18.2.8, for others users to test.
Comment 5 tt_1 2019-02-03 16:21:05 UTC
pullrequest is online, please test: https://github.com/gentoo/musl/pull/216
Comment 6 Jory A. Pratt gentoo-dev 2019-03-07 21:48:25 UTC
Created attachment 568152 [details, diff]
upstream patch to control glx-tls support

Will apply cleanly, and can add a option to control easily.
Comment 7 Jory A. Pratt gentoo-dev 2019-03-14 23:31:14 UTC
(In reply to tt_1 from comment #5)
> pullrequest is online, please test: https://github.com/gentoo/musl/pull/216

Keep with meson build, I have added the upstream patch with working ebuild to overlay if you would test it we can get this closed and off the radar.
Comment 8 Anthony Basile gentoo-dev 2019-03-27 12:01:31 UTC
(In reply to Jory A. Pratt from comment #7)
> (In reply to tt_1 from comment #5)
> > pullrequest is online, please test: https://github.com/gentoo/musl/pull/216
> 
> Keep with meson build, I have added the upstream patch with working ebuild
> to overlay if you would test it we can get this closed and off the radar.

I just forward ported all the patches to mesa-18.2.8 and above on the musl overlay.  Can people give me feedback.
Comment 9 Jory A. Pratt gentoo-dev 2019-04-10 17:16:59 UTC
(In reply to Anthony Basile from comment #8)
> (In reply to Jory A. Pratt from comment #7)
> > (In reply to tt_1 from comment #5)
> > > pullrequest is online, please test: https://github.com/gentoo/musl/pull/216
> > 
> > Keep with meson build, I have added the upstream patch with working ebuild
> > to overlay if you would test it we can get this closed and off the radar.
> 
> I just forward ported all the patches to mesa-18.2.8 and above on the musl
> overlay.  Can people give me feedback.

I am still on 19.0.1 with no reported tls issues.
Comment 10 Jory A. Pratt gentoo-dev 2020-03-16 17:26:58 UTC
We carry a single patch to disable glx-tls for mesa now, everything else has been accepted upstream.