Skip to content

Commit

Permalink
We shouldn't need to pass -fno-strict-aliasing when building clang wi…
Browse files Browse the repository at this point in the history
…th clang.

Summary: The code comments in the Makefile indicate this was put in place to support issues when building clang with GCC. Today clang's strict aliasing works, so we shouldn't pass -fno-strict-aliasing when building with clang.

Reviewers: bogner, echristo

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D12036

llvm-svn: 245304
  • Loading branch information
Chris Bieneman committed Aug 18, 2015
1 parent f2bd72e commit c5635a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion clang/CMakeLists.txt
Expand Up @@ -253,7 +253,10 @@ configure_file(

# Add appropriate flags for GCC
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual")
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
endif ()

# Enable -pedantic for Clang even if it's not enabled for LLVM.
if (NOT LLVM_ENABLE_PEDANTIC)
Expand Down
5 changes: 4 additions & 1 deletion clang/Makefile
Expand Up @@ -67,8 +67,11 @@ endif
# http://gcc.gnu.org/PR41874
# http://gcc.gnu.org/PR41838
#
# We can revisit this when LLVM/Clang support it.
# We don't need to do this if the host compiler is clang.
ifeq ($(CXX_COMPILER), "clang")
CXX.Flags += -fno-strict-aliasing
endif


# Set up Clang's tblgen.
ifndef CLANG_TBLGEN
Expand Down

0 comments on commit c5635a6

Please sign in to comment.