Skip to content

build: avoid redundant flag specification #31544

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

Merged
merged 1 commit into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 1 addition & 5 deletions stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ endif()
# on the presence of symbols in libSupport to identify how the code was
# built and cause link failures for mismatches. Without linking that library,
# we get link failures regardless, so instead, this just disables the checks.
if(CMAKE_VERSION VERSION_LESS 3.12)
append("-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
else()
add_compile_definitions(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1)
endif()
add_compile_definitions($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1>)

set(SWIFT_STDLIB_LIBRARY_BUILD_TYPES)
if(SWIFT_BUILD_DYNAMIC_STDLIB)
Expand Down
8 changes: 0 additions & 8 deletions stdlib/cmake/modules/AddSwiftStdlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1147,14 +1147,6 @@ function(_add_swift_target_library_single target name)
MACCATALYST_BUILD_FLAVOR "${SWIFTLIB_SINGLE_MACCATALYST_BUILD_FLAVOR}"
)

if(SWIFTLIB_IS_STDLIB)
# We don't ever want to link against the ABI-breakage checking symbols
# in the standard library, runtime, or overlays because they only rely
# on the header parts of LLVM's ADT.
list(APPEND c_compile_flags
"-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1")
endif()

if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS)
if(libkind STREQUAL SHARED)
list(APPEND c_compile_flags -D_WINDLL)
Expand Down
12 changes: 0 additions & 12 deletions stdlib/toolchain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,6 @@ if("Thread" IN_LIST SWIFT_RUNTIME_USE_SANITIZERS)
list(APPEND CXX_LINK_FLAGS "-fsanitize=thread")
endif()

# Do not enforce checks for LLVM's ABI-breaking build settings.
# The Swift runtime uses some header-only code from LLVM's ADT classes,
# but we do not want to link libSupport into the runtime. These checks rely
# on the presence of symbols in libSupport to identify how the code was
# built and cause link failures for mismatches. Without linking that library,
# we get link failures regardless, so instead, this just disables the checks.
if(CMAKE_VERSION VERSION_LESS 3.12)
append("-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
else()
add_compile_definitions(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1)
endif()

# Compatibility libraries build in a special alternate universe that can't
# directly link to most OS runtime libraries, and have to access the
# runtime being patched only through public ABI.
Expand Down