-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Offload] Fix the offload cache file triggering libc++ / libstdc++ mixing #126313
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
Conversation
…xing Summary: We originally wanted `-stdlib=libc++` by default so that it could use offloading support in libc++, however this causes issues with out the Offloading proejct itself is built. Is the user builds the LLVM libs with libstdc++ then uses this cache it will enable this option by default for the ensuing build of the offloading libraries with the newly build clang. This will cause a lot of linker failured because the C++ library doesn't match. Long term I think the proper solution to this is to make better use of clang configuration files, but I don't know a good way to do that by default. For now just make it build right.
@llvm/pr-subscribers-offload Author: Joseph Huber (jhuber6) ChangesSummary: Long term I think the proper solution to this is to make better use of Full diff: https://github.com/llvm/llvm-project/pull/126313.diff 1 Files Affected:
diff --git a/offload/cmake/caches/Offload.cmake b/offload/cmake/caches/Offload.cmake
index 8749fcccb0ed1e8..5533a6508f5d57c 100644
--- a/offload/cmake/caches/Offload.cmake
+++ b/offload/cmake/caches/Offload.cmake
@@ -2,9 +2,6 @@ set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "")
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libunwind;libcxx;libcxxabi;openmp;offload" CACHE STRING "")
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
-set(CLANG_DEFAULT_CXX_STDLIB "libc++" CACHE STRING "")
-set(CLANG_DEFAULT_LINKER "lld" CACHE STRING "")
-
set(LLVM_RUNTIME_TARGETS default;amdgcn-amd-amdhsa;nvptx64-nvidia-cuda CACHE STRING "")
set(RUNTIMES_nvptx64-nvidia-cuda_CACHE_FILES "${CMAKE_SOURCE_DIR}/../libcxx/cmake/caches/NVPTX.cmake" CACHE STRING "")
set(RUNTIMES_amdgcn-amd-amdhsa_CACHE_FILES "${CMAKE_SOURCE_DIR}/../libcxx/cmake/caches/AMDGPU.cmake" CACHE STRING "")
|
@@ -2,9 +2,6 @@ set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "") | |||
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libunwind;libcxx;libcxxabi;openmp;offload" CACHE STRING "") | |||
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "") | |||
|
|||
set(CLANG_DEFAULT_CXX_STDLIB "libc++" CACHE STRING "") | |||
set(CLANG_DEFAULT_LINKER "lld" CACHE STRING "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why also disable lld
here as the default linker?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not required for anything, probably shouldn't just default to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WFM
…xing (llvm#126313) Summary: We originally wanted `-stdlib=libc++` by default so that it could use offloading support in libc++, however this causes issues with out the Offloading proejct itself is built. Is the user builds the LLVM libs with libstdc++ then uses this cache it will enable this option by default for the ensuing build of the offloading libraries with the newly build clang. This will cause a lot of linker failured because the C++ library doesn't match. Long term I think the proper solution to this is to make better use of clang configuration files, but I don't know a good way to do that by default. For now just make it build right.
…xing (llvm#126313) Summary: We originally wanted `-stdlib=libc++` by default so that it could use offloading support in libc++, however this causes issues with out the Offloading proejct itself is built. Is the user builds the LLVM libs with libstdc++ then uses this cache it will enable this option by default for the ensuing build of the offloading libraries with the newly build clang. This will cause a lot of linker failured because the C++ library doesn't match. Long term I think the proper solution to this is to make better use of clang configuration files, but I don't know a good way to do that by default. For now just make it build right.
…xing (llvm#126313) Summary: We originally wanted `-stdlib=libc++` by default so that it could use offloading support in libc++, however this causes issues with out the Offloading proejct itself is built. Is the user builds the LLVM libs with libstdc++ then uses this cache it will enable this option by default for the ensuing build of the offloading libraries with the newly build clang. This will cause a lot of linker failured because the C++ library doesn't match. Long term I think the proper solution to this is to make better use of clang configuration files, but I don't know a good way to do that by default. For now just make it build right.
Summary:
We originally wanted
-stdlib=libc++
by default so that it could useoffloading support in libc++, however this causes issues with out the
Offloading proejct itself is built. Is the user builds the LLVM libs
with libstdc++ then uses this cache it will enable this option by
default for the ensuing build of the offloading libraries with the newly
build clang. This will cause a lot of linker failured because the C++
library doesn't match.
Long term I think the proper solution to this is to make better use of
clang configuration files, but I don't know a good way to do that by
default. For now just make it build right.