Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 767964 - media-libs/mesa: loader is broken with musl libc
Summary: media-libs/mesa: loader is broken with musl libc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo musl team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-01-30 10:01 UTC by fee1-dead-beef
Modified: 2022-02-03 00:35 UTC (History)
3 users (show)

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


Attachments
Patch for media-libs/mesa-21.0.0_rc3 (use-global-dynamic-tls-kill-asm-stubs.diff,40.05 KB, patch)
2021-01-30 12:48 UTC, fee1-dead-beef
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fee1-dead-beef 2021-01-30 10:01:26 UTC
After unmasking and emerging the latest mesa release, dlerror is reported:

> MESA_LOADER: failed to open (driver name): Error relocating /usr/lib/dri/(driver name)_dri.so: _glapi_tls_Dispatch: initial-exec TLS resolves to dynamic definition in /usr/lib/libglapi.so.0

Looks like this error was reported upstream 1 year ago:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/966

But before the fix gets implemented upstream, running sway or weston with drm  with musl libc would require a patch.

Reproducible: Always

Steps to Reproduce:
1. On a musl system, try to run wayland applications that uses gbm or mesa-loader.
Comment 1 fee1-dead-beef 2021-01-30 12:36:56 UTC
> 1. On a musl system, try to run wayland applications that uses gbm or mesa-loader.

Such as sway or weston with use egl.
Comment 3 fee1-dead-beef 2021-01-30 12:48:43 UTC
Created attachment 685176 [details, diff]
Patch for media-libs/mesa-21.0.0_rc3

From a commit of a fork:
https://gitlab.freedesktop.org/jbeich/mesa/-/commit/f936fbc30e37bc2e4547f5307c1532fa168eae65

Removed a FreeBSD specific patch in the file (because it makes the emerge fail)
Comment 4 fee1-dead-beef 2021-01-30 12:50:24 UTC
(In reply to Sam James from comment #2)
> Is this
> https://github.com/gentoo/musl/blob/master/media-libs/mesa/files/mesa-20.1.7-
> add-disable-tls-support.patch?

Don't think so. That patch adds an option, but the problem was with the TLS model.
Comment 5 Piotr Karbowski (RETIRED) gentoo-dev 2021-02-13 20:16:46 UTC
Since you have patch, have you consider chasing upstream to review and include the patch?
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-22 11:36:51 UTC
This has been fixed upstream! https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12722
Comment 7 tt_1 2021-11-22 22:13:37 UTC
I took mesa-9999 for a testride on armv7 with vc4 drivers, and have a working desktop with xorg. Not sure what was broken initally, is this sufficent testing from my side?
Comment 8 Matt Turner gentoo-dev 2021-12-05 22:40:38 UTC
This is fixed upstream by https://cgit.freedesktop.org/mesa/mesa/commit/?id=8570a2a280587a1e43ac11ad46ad62dfdd6c7b39 I believe.
Comment 9 Larry the Git Cow gentoo-dev 2022-02-03 00:35:55 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cd171699fb941c94a11ddf029380173344a93cb

commit 2cd171699fb941c94a11ddf029380173344a93cb
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2022-02-03 00:11:10 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2022-02-03 00:35:33 +0000

    media-libs/mesa: Version bump to 22.0.0_rc1
    
    Closes: https://bugs.gentoo.org/767964
    Closes: https://bugs.gentoo.org/803860
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 media-libs/mesa/Manifest               |   1 +
 media-libs/mesa/mesa-22.0.0_rc1.ebuild | 463 +++++++++++++++++++++++++++++++++
 media-libs/mesa/mesa-9999.ebuild       |   2 +-
 3 files changed, 465 insertions(+), 1 deletion(-)