Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/tools/libclang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Copy link
Contributor

@jeremyd2019 jeremyd2019 May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just do

Suggested change
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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

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.

Copy link
Contributor

@jeremyd2019 jeremyd2019 May 2, 2025

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.

Copy link
Contributor

@jeremyd2019 jeremyd2019 May 3, 2025

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.

set(ENABLE_SHARED SHARED)
endif()
Expand Down
Loading