From 8efd11fce99710757b14cb575f33778f730ec904 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: --- src/compiler/clc/meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/compiler/clc/meson.build b/src/compiler/clc/meson.build index 0d49495bb26..69bd04bad04 100644 --- a/src/compiler/clc/meson.build +++ b/src/compiler/clc/meson.build @@ -105,7 +105,13 @@ _libmesaclc = static_library( idep_mesautil, dep_spirv_tools, idep_vtn] ) +_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, )