Skip to content

Commit

Permalink
WIP Add -fno-strict-aliasing to compiler options
Browse files Browse the repository at this point in the history
Add this option to ARM, PPC linux, and X86 linux. Update bot makefiles and
cmakefiles.  Remove the option from the GC project.

This is related to Issue eclipse-openj9/openj9#2872

Signed-off-by: Peter Bain <[email protected]>
  • Loading branch information
pdbain-ibm committed Nov 13, 2018
1 parent e706e5c commit db3bf1e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmake/modules/platform/toolcfg/gnu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set(OMR_WARNING_AS_ERROR_FLAG -Werror)

set(OMR_ENHANCED_WARNING_FLAG -Wall)

list(APPEND OMR_PLATFORM_COMPILE_OPTIONS -pthread)
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS -pthread -fno-strict-aliasing)

if(OMR_ENV_DATA64)
if (NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64"))
Expand Down
2 changes: 1 addition & 1 deletion gc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ if(OMR_ENHANCED_WARNINGS)
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
target_compile_options(omrgc PRIVATE -fno-strict-aliasing)
target_compile_options(omrgc PRIVATE)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "XL|VisualAge")
target_compile_options(omrgc PRIVATE -qalias=noansi)
endif()
Expand Down
10 changes: 7 additions & 3 deletions omrmakefiles/rules.linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -187,21 +187,25 @@ ifeq (x86,$(OMR_HOST_ARCH))
GLOBAL_CXXFLAGS+=-m32 -msse2 -I/usr/include/nptl
GLOBAL_CPPFLAGS+=-DJ9X86
endif
GLOBAL_CFLAGS+=-fno-strict-aliasing
GLOBAL_CXXFLAGS+=-fno-strict-aliasing

else ifeq (aarch64,$(OMR_HOST_ARCH))
GLOBAL_CFLAGS+=-march=armv8-a+simd -Wno-unused-but-set-variable
GLOBAL_CXXFLAGS+=-march=armv8-a+simd -Wno-unused-but-set-variable
GLOBAL_CFLAGS+=-march=armv8-a+simd -Wno-unused-but-set-variable -fno-strict-aliasing
GLOBAL_CXXFLAGS+=-march=armv8-a+simd -Wno-unused-but-set-variable -fno-strict-aliasing
GLOBAL_CPPFLAGS+=-DJ9AARCH64 -DAARCH64GNU -DAARCH64 -DFIXUP_UNALIGNED -Wno-unused-but-set-variable

else
ifeq (arm,$(OMR_HOST_ARCH))
GLOBAL_CFLAGS+=$(ARM_ARCH_FLAGS) -Wno-unused-but-set-variable
GLOBAL_CFLAGS+=$(ARM_ARCH_FLAGS) -Wno-unused-but-set-variable -fno-strict-aliasing
GLOBAL_CPPFLAGS+=-DJ9ARM -DARMGNU -DARM -DFIXUP_UNALIGNED $(ARM_ARCH_FLAGS) -Wno-unused-but-set-variable
else
ifeq (ppc,$(OMR_HOST_ARCH))
GLOBAL_CPPFLAGS+=-DLINUXPPC

ifeq (gcc,$(OMR_TOOLCHAIN))
GLOBAL_CFLAGS+=-fno-strict-aliasing
GLOBAL_CXXFLAGS+=-fno-strict-aliasing
ifeq (1,$(OMR_ENV_DATA64))
GLOBAL_CFLAGS+=-m64
GLOBAL_CXXFLAGS+=-m64
Expand Down

0 comments on commit db3bf1e

Please sign in to comment.