Skip to content

Commit

Permalink
[OpenMP] [cmake] Don't use -fno-semantic-interposition on Windows (ll…
Browse files Browse the repository at this point in the history
…vm#81113)

This was added in 4b7beab. When the
flag was added implicitly elsewhere, it was added via
llvm/cmake/modules/HandleLLVMOptions.cmake, where it wasn't added on
Windows/Cygwin targets.

This avoids one warning per object file in OpenMP.

(cherry picked from commit 72f04fa)
  • Loading branch information
mstorsjo authored and llvmbot committed Feb 9, 2024
1 parent 391d948 commit 47ec6be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openmp/cmake/HandleOpenMPOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ append_if(OPENMP_HAVE_WEXTRA_FLAG "-Wno-extra" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append_if(OPENMP_HAVE_WPEDANTIC_FLAG "-Wno-pedantic" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append_if(OPENMP_HAVE_WMAYBE_UNINITIALIZED_FLAG "-Wno-maybe-uninitialized" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

append_if(OPENMP_HAVE_NO_SEMANTIC_INTERPOSITION "-fno-semantic-interposition" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
if (NOT (WIN32 OR CYGWIN))
# This flag is not relevant on Windows; the flag is accepted, but produces warnings
# about argument unused during compilation.
append_if(OPENMP_HAVE_NO_SEMANTIC_INTERPOSITION "-fno-semantic-interposition" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()
append_if(OPENMP_HAVE_FUNCTION_SECTIONS "-ffunction-section" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append_if(OPENMP_HAVE_DATA_SECTIONS "-fdata-sections" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

Expand Down

0 comments on commit 47ec6be

Please sign in to comment.