Skip to content

Commit

Permalink
Try a workaround suggested by @compnerd
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed Sep 16, 2024
1 parent 4b235e6 commit 08a64c1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,21 @@ target_link_libraries(llvmshims PRIVATE llvmc)
# The Ubuntu GitHub runner demands this option: /usr/bin/ld.gold: error:
# lib/libllvmshims.a(shim.cc.o): requires dynamic R_X86_64_PC32 reloc against
# '_ZN4llvm17OptimizationLevel2O0E' which may overflow at runtime; recompile with -fPIC. We don't
# use -fPIC directly because it clang on Windows rejects it.
# use -fPIC directly because clang on Windows rejects it.
set_target_properties(llvmshims
PROPERTIES
POSITION_INDEPENDENT_CODE True)

if(WIN32)
# According to compnerd, “a Microsoft update requires a newer clang
# than what swift ships. That’s a second chance that they pushed
# that breaks after working around this. The best option is to use a
# 6.0 pre release.” We don't want to impose that on downstream
# clients, so we use this workaround, which isn't compatible with
# Swift/C++ interop.
target_compile_definitions(llvmshims PRIVATE _ALLOW_COMPILER_AND_STL_VERSION_MISMATCH)
endif()

#
# The Swift module our clients depend on.
#
Expand Down

0 comments on commit 08a64c1

Please sign in to comment.