Created attachment 254513 [details] Add initial-exec TLS for FreeBSD When it is compiled with Clang 19, it fails to run with errors like this: Unsupported relocation type 36 in non-PLT relocations That's because Clang 19 now supports "-mtls-dialect=gnu2" but our rtld does not support it. In fact, we have been using "-ftls-model=initial-exec" instead.
Created attachment 254626 [details] Detect and use TLS model for FreeBSD Updated to use the upstream merge request.
Comment on attachment 254626 [details] Detect and use TLS model for FreeBSD > -TIMESTAMP = 1729714788 > +TIMESTAMP = 1730244192 Better drop this hunk to avoid conflicts when cherry-picking e.g., during "git bisect" in ports/ or with old /quarterly branches.
Comment on attachment 254626 [details] Detect and use TLS model for FreeBSD After more testing I'd prefer implicit -ftls-model=global-dynamic to avoid regressions. For one, Rusticl is important due to bug 281566.
Created attachment 254839 [details] Disable "-mtls-dialect=gnu2" when built with clang 19 I disabled support for TLS model because I failed to fix regressions reported by jbeich@.
(In reply to Jan Beich from comment #3) I don't see any reason to implicitly set '-ftls-model=global-dynamic' as it is default.
Comment on attachment 254839 [details] Disable "-mtls-dialect=gnu2" when built with clang 19 Thanks. Works fine and matches Clang < 19 behavior.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9deb1db0634686b589ce81278e03206fe340f4bc commit 9deb1db0634686b589ce81278e03206fe340f4bc Author: Jung-uk Kim <jkim@FreeBSD.org> AuthorDate: 2024-11-01 18:12:46 +0000 Commit: Jung-uk Kim <jkim@FreeBSD.org> CommitDate: 2024-11-01 18:12:46 +0000 graphics/mesa-devel: Disable "-mtls-dialect=gnu2" when built with clang 19 Clang 19 now supports "-mtls-dialect=gnu2" but it does not work for us. Originally, I tried to use "-ftls-model=initial-exec" but it caused regressions. Disable the optimization for now until we have a proper implementation. Approved by: jbeich (maintainer) PR: 282322 graphics/mesa-devel/Makefile | 1 + graphics/mesa-devel/distinfo | 2 ++ 2 files changed, 3 insertions(+)