diff --git a/omrmakefiles/rules.linux.mk b/omrmakefiles/rules.linux.mk index 8568ffe7815..00ecd4a56f3 100644 --- a/omrmakefiles/rules.linux.mk +++ b/omrmakefiles/rules.linux.mk @@ -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