-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[cmake] Reenable libclang.dll when LLVM_ENABLE_PIC #138343
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
This was accidentally disabled in llvm#138119 for non-mingw Windows.
@llvm/pr-subscribers-clang Author: Arthur Eubanks (aeubanks) ChangesThis was accidentally disabled in #138119 for non-mingw Windows. Full diff: https://github.com/llvm/llvm-project/pull/138343.diff 1 Files Affected:
diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt
index 37a939ffcada7..8fbee71e02882 100644
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -106,7 +106,7 @@ if (LLVM_EXPORTED_SYMBOL_FILE)
DEPENDS ${LIBCLANG_VERSION_SCRIPT_FILE})
endif()
-if((NOT (WIN32 OR CYGWIN) AND LLVM_ENABLE_PIC) OR
+if((NOT CYGWIN AND LLVM_ENABLE_PIC) OR
((WIN32 OR CYGWIN) AND NOT LIBCLANG_BUILD_STATIC))
set(ENABLE_SHARED SHARED)
endif()
|
clang/tools/libclang/CMakeLists.txt
Outdated
if((NOT CYGWIN AND LLVM_ENABLE_PIC) OR | ||
((WIN32 OR CYGWIN) AND NOT LIBCLANG_BUILD_STATIC)) |
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.
I'd just do
if((NOT CYGWIN AND LLVM_ENABLE_PIC) OR | |
((WIN32 OR CYGWIN) AND NOT LIBCLANG_BUILD_STATIC)) | |
if(LLVM_ENABLE_PIC OR ((WIN32 OR CYGWIN) AND NOT LIBCLANG_BUILD_STATIC)) |
since LIBCLANG_BUILD_STATIC
is documented to build a static libclang in addition to the shared libclang
I'm running a build on Cygwin right now with that version of the change
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.
done
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.
My build just failed with too many exports. But I bet it can be fixed in a better way so it'd be fine with me to merge this to unbreak actually entirely working platforms and leave me to fix it later.
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.
I opened #138351 to try to figure out how to fix this on Cygwin. If nothing else works, maybe for our static build bootstrapping workaround we need to do both -DLLVM_ENABLE_PIC=OFF -DLIBCLANG_BUILD_STATIC=ON
.
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.
I did confirm that -DLLVM_ENABLE_PIC=OFF -DLIBCLANG_BUILD_STATIC=ON
works to build on Cygwin with GCC, so we do still have a workaround with this revert.
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.
LGTM
This was disabled for Windows/Mingw in llvm#138343, but it's actually linkable and is being used by some people.
This was disabled for Windows/Mingw in llvm#138343, but it's actually linkable and is being used by some people.
This was disabled for Windows/Mingw in llvm#138343, but it's actually linkable and is being used by some people.
This was disabled for Windows/Mingw in llvm#138343, but it's actually linkable and is being used by some people.
This was disabled for Windows/Mingw in #138343, but it's actually linkable and is being used by some people.