clc: force fPIC for every user when using shared LLVM

As we want to start using `dladdr`, this is needed to prevent `dladdr`
returning information of the wrong file.

Fixes tag as it's required by the actual fix.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Fixes: e22491c832 ("clc: fetch clang resource dir at runtime")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25568>
(cherry picked from commit 8efd11fce9)
This commit is contained in:
Karol Herbst
2024-01-11 14:55:46 +01:00
committed by Eric Engestrom
parent c5fd24a1d4
commit 613ac7d10e
2 changed files with 7 additions and 1 deletions

View File

@@ -184,7 +184,7 @@
"description": "clc: force fPIC for every user when using shared LLVM",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "e22491c83265200f518e9fb4deff54e3c2823b68",
"notes": null

View File

@@ -125,7 +125,13 @@ _libmesaclc = static_library(
idep_mesautil, dep_spirv_tools]
)
_idep_mesaclc_link_args = []
if _shared_llvm
_idep_mesaclc_link_args += cc.get_supported_link_arguments('-fPIC')
endif
idep_mesaclc = declare_dependency(
link_with : _libmesaclc,
include_directories : include_directories('.'),
link_args : _idep_mesaclc_link_args,
)