Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Misc] [refactor] Move symbol versioning to a new file #3426

Merged
merged 6 commits into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/TaichiCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ if (NOT WIN32)
if (NOT TI_EXPORT_CORE) # expose api for CHI IR Builder
target_link_libraries(${CORE_LIBRARY_NAME} -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/misc/linker.map)
endif ()
target_link_libraries(${CORE_LIBRARY_NAME} -Wl,--wrap=log2f) # Avoid glibc dependencies
target_link_libraries(${CORE_LIBRARY_NAME} -Wl,--wrap=log2f,--wrap=log2,--wrap=exp,--wrap=log,--wrap=pow) # Avoid glibc dependencies
endif()
else()
# windows
Expand Down
16 changes: 16 additions & 0 deletions taichi/common/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ __asm__(".symver log2f,log2f@GLIBC_2.2.5");
float __wrap_log2f(float x) {
qiao-bo marked this conversation as resolved.
Show resolved Hide resolved
return log2f(x);
}
__asm__(".symver log2,log2@GLIBC_2.2.5");
float __wrap_log2(float x) {
return log2(x);
}
__asm__(".symver exp,exp@GLIBC_2.2.5");
float __wrap_exp(float x) {
return exp(x);
}
__asm__(".symver log,log@GLIBC_2.2.5");
float __wrap_log(float x) {
return log(x);
}
__asm__(".symver pow,pow@GLIBC_2.2.5");
float __wrap_pow(float x, float y) {
return pow(x, y);
}
#endif
}

Expand Down