From 613ac7d10e414d22efbf75d7009b1b77e37a8bf0 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 11 Jan 2024 14:55:46 +0100 Subject: [PATCH] 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 Fixes: e22491c8326 ("clc: fetch clang resource dir at runtime") Part-of: (cherry picked from commit 8efd11fce99710757b14cb575f33778f730ec904) --- .pick_status.json | 2 +- src/compiler/clc/meson.build | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 80d91f1fe91..ca1d1d446b4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/compiler/clc/meson.build b/src/compiler/clc/meson.build index 3e4f1a7f441..b5d2efba7cf 100644 --- a/src/compiler/clc/meson.build +++ b/src/compiler/clc/meson.build @@ -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, )