Skip to content

Commit 8373b83

Browse files
[build] Enforce compatibility with manylinux2014 when TI_WITH_VULKAN=OFF (#4406)
* [build] Enforce compatibility with manylinux2014 when TI_WITH_VULKAN=OFF * Auto Format Co-authored-by: Taichi Gardener <[email protected]>
1 parent 01917b1 commit 8373b83

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

cmake/TaichiCore.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,12 @@ if (NOT WIN32)
395395
target_link_libraries(${CORE_LIBRARY_NAME} -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/misc/linker.map)
396396
endif ()
397397
# Avoid glibc dependencies
398-
target_link_libraries(${CORE_LIBRARY_NAME} -Wl,--wrap=log2f)
398+
if (TI_WITH_VULKAN)
399+
target_link_libraries(${CORE_LIBRARY_NAME} -Wl,--wrap=log2f)
400+
else()
401+
# Enforce compatibility with manylinux2014
402+
target_link_libraries(${CORE_LIBRARY_NAME} -Wl,--wrap=log2f -Wl,--wrap=exp2 -Wl,--wrap=log2 -Wl,--wrap=logf -Wl,--wrap=powf -Wl,--wrap=exp -Wl,--wrap=log -Wl,--wrap=pow)
403+
endif()
399404
endif()
400405
else()
401406
# windows

taichi/common/symbol_version.cpp

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,35 @@ float __wrap_log2f(float x) {
2626
return log2f(x);
2727
}
2828
// The following are offending symbols using higher GLIBC versions
29-
// TODO currently commented out due to failing Vulkan tests
30-
//__asm__(".symver log2,log2@GLIBC_2.2.5");
31-
// float __wrap_log2(float x) {
32-
// return log2(x);
33-
//}
34-
//__asm__(".symver exp,exp@GLIBC_2.2.5");
35-
// float __wrap_exp(float x) {
36-
// return exp(x);
37-
//}
38-
//__asm__(".symver log,log@GLIBC_2.2.5");
39-
// float __wrap_log(float x) {
40-
// return log(x);
41-
//}
42-
//__asm__(".symver pow,pow@GLIBC_2.2.5");
43-
// float __wrap_pow(float x, float y) {
44-
// return pow(x, y);
45-
//}
29+
// They will fail Vulkan tests if wrapping is enabled
30+
__asm__(".symver exp2,exp2@GLIBC_2.2.5");
31+
float __wrap_exp2(float x) {
32+
return exp2(x);
33+
}
34+
__asm__(".symver log2,log2@GLIBC_2.2.5");
35+
float __wrap_log2(float x) {
36+
return log2(x);
37+
}
38+
__asm__(".symver logf,logf@GLIBC_2.2.5");
39+
float __wrap_logf(float x) {
40+
return logf(x);
41+
}
42+
__asm__(".symver powf,powf@GLIBC_2.2.5");
43+
float __wrap_powf(float x, float y) {
44+
return powf(x, y);
45+
}
46+
__asm__(".symver exp,exp@GLIBC_2.2.5");
47+
float __wrap_exp(float x) {
48+
return exp(x);
49+
}
50+
__asm__(".symver log,log@GLIBC_2.2.5");
51+
float __wrap_log(float x) {
52+
return log(x);
53+
}
54+
__asm__(".symver pow,pow@GLIBC_2.2.5");
55+
float __wrap_pow(float x, float y) {
56+
return pow(x, y);
57+
}
4658
#endif
4759
}
4860

0 commit comments

Comments
 (0)