ac/llvm: export ac_init_llvm_once in targets
If a program like mpv uses both radeon_dri.so (because --vo=gpu) and
radeonsi_drv_video.so (because --hwdec=vaapi) then LLVM will be inialized twice.
The commit exports the ac_init_llvm_once so there's only one instance of the
function.
See also 18b12bf533
("targets: export radeon winsys_create functions to silence LLVM warning")
which implemented this workaround initially.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1377
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5648>
This commit is contained in:
@@ -78,10 +78,9 @@ static void ac_init_llvm_target()
|
||||
LLVMParseCommandLineOptions(ARRAY_SIZE(argv), argv, NULL);
|
||||
}
|
||||
|
||||
static once_flag ac_init_llvm_target_once_flag = ONCE_FLAG_INIT;
|
||||
|
||||
void ac_init_llvm_once(void)
|
||||
PUBLIC void ac_init_llvm_once(void)
|
||||
{
|
||||
static once_flag ac_init_llvm_target_once_flag = ONCE_FLAG_INIT;
|
||||
call_once(&ac_init_llvm_target_once_flag, ac_init_llvm_target);
|
||||
}
|
||||
|
||||
|
@@ -176,6 +176,7 @@ if with_symbols_check
|
||||
args : [
|
||||
'--lib', libvulkan_radeon,
|
||||
'--symbols-file', vulkan_icd_symbols,
|
||||
'--ignore-symbol', 'ac_init_llvm_once',
|
||||
symbols_check_args,
|
||||
],
|
||||
suite : ['amd'],
|
||||
|
@@ -2,4 +2,5 @@
|
||||
nouveau_drm_screen_create;
|
||||
radeon_drm_winsys_create;
|
||||
amdgpu_winsys_create;
|
||||
ac_init_llvm_once;
|
||||
};
|
||||
|
@@ -6,6 +6,7 @@
|
||||
radeon_drm_winsys_create;
|
||||
amdgpu_winsys_create;
|
||||
fd_drm_screen_create;
|
||||
ac_init_llvm_once;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
@@ -7,6 +7,7 @@
|
||||
# due to LLVM being initialized multiple times.
|
||||
radeon_drm_winsys_create;
|
||||
amdgpu_winsys_create;
|
||||
ac_init_llvm_once;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
@@ -7,6 +7,7 @@
|
||||
# due to LLVM being initialized multiple times.
|
||||
radeon_drm_winsys_create;
|
||||
amdgpu_winsys_create;
|
||||
ac_init_llvm_once;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
@@ -6,6 +6,7 @@
|
||||
# due to LLVM being initialized multiple times.
|
||||
radeon_drm_winsys_create;
|
||||
amdgpu_winsys_create;
|
||||
ac_init_llvm_once;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
@@ -4,6 +4,7 @@
|
||||
nouveau_drm_screen_create;
|
||||
radeon_drm_winsys_create;
|
||||
amdgpu_winsys_create;
|
||||
ac_init_llvm_once;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
Reference in New Issue
Block a user