define mesa-build-with-llvm
$(if $(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7), \
$(warning Unsupported LLVM version in Android $(MESA_ANDROID_MAJOR_VERSION)),) \
- $(eval LOCAL_CFLAGS += -DLLVM_AVAILABLE -DMESA_LLVM_VERSION_STRING=\"3.9\") \
+ $(eval LOCAL_CFLAGS += -DLLVM_AVAILABLE -DLLVM_IS_SHARED=1 -DMESA_LLVM_VERSION_STRING=\"3.9\") \
$(eval LOCAL_SHARED_LIBRARIES += libLLVM)
endef
if with_llvm
pre_args += '-DLLVM_AVAILABLE'
pre_args += '-DMESA_LLVM_VERSION_STRING="@0@"'.format(dep_llvm.version())
+ pre_args += '-DLLVM_IS_SHARED=@0@'.format(_shared_llvm.to_int())
# LLVM can be built without rtti, turning off rtti changes the ABI of C++
# programs, so we need to build all C++ code in mesa without rtti as well to
LLVMParseCommandLineOptions(ARRAY_SIZE(argv), argv, NULL);
}
-PUBLIC void ac_init_llvm_once(void)
+PUBLIC void ac_init_shared_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);
}
+#if !LLVM_IS_SHARED
+static once_flag ac_init_static_llvm_target_once_flag = ONCE_FLAG_INIT;
+static void ac_init_static_llvm_once(void)
+{
+ call_once(&ac_init_static_llvm_target_once_flag, ac_init_llvm_target);
+}
+#endif
+
+void ac_init_llvm_once(void)
+{
+#if LLVM_IS_SHARED
+ ac_init_shared_llvm_once();
+#else
+ ac_init_static_llvm_once();
+#endif
+}
+
static LLVMTargetRef ac_get_llvm_target(const char *triple)
{
LLVMTargetRef target = NULL;
LLVMTargetLibraryInfoRef ac_create_target_library_info(const char *triple);
void ac_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info);
+void ac_init_shared_llvm_once(void); /* Do not use directly, use ac_init_llvm_once */
void ac_init_llvm_once(void);
args : [
'--lib', libvulkan_radeon,
'--symbols-file', vulkan_icd_symbols,
- '--ignore-symbol', 'ac_init_llvm_once',
+ '--ignore-symbol', 'ac_init_shared_llvm_once',
symbols_check_args,
],
suite : ['amd'],
nouveau_drm_screen_create;
radeon_drm_winsys_create;
amdgpu_winsys_create;
- ac_init_llvm_once;
+ ac_init_shared_llvm_once;
};
radeon_drm_winsys_create;
amdgpu_winsys_create;
fd_drm_screen_create;
- ac_init_llvm_once;
+ ac_init_shared_llvm_once;
local:
*;
};
# due to LLVM being initialized multiple times.
radeon_drm_winsys_create;
amdgpu_winsys_create;
- ac_init_llvm_once;
+ ac_init_shared_llvm_once;
local:
*;
};
# due to LLVM being initialized multiple times.
radeon_drm_winsys_create;
amdgpu_winsys_create;
- ac_init_llvm_once;
+ ac_init_shared_llvm_once;
local:
*;
};
# due to LLVM being initialized multiple times.
radeon_drm_winsys_create;
amdgpu_winsys_create;
- ac_init_llvm_once;
+ ac_init_shared_llvm_once;
local:
*;
};
nouveau_drm_screen_create;
radeon_drm_winsys_create;
amdgpu_winsys_create;
- ac_init_llvm_once;
+ ac_init_shared_llvm_once;
local:
*;
};