Skip to content

Commit

Permalink
Merge pull request #5187 from eclipse/revert-4842-stackprotect64
Browse files Browse the repository at this point in the history
Revert "Enable Stack Protect option for 64bit platforms"
  • Loading branch information
pshipton authored Mar 20, 2019
2 parents a12900a + 1fc15e2 commit 21e8e75
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 100 deletions.
2 changes: 1 addition & 1 deletion runtime/compiler/build/toolcfg/aix-xlc/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ endif

ifeq ($(HOST_BITS),64)
CX_DEFINES+=PPC64
CX_FLAGS+=-q64 -qstackprotect
CX_FLAGS+=-q64
# On AIX we don't expect to see any 64-bit POWER processors that don't support Graphics (gr) and Square Root (sq)
# instructions, so we can use this more aggressive option rather than the plain -qarch=ppc64.
CX_ARCH?=ppc64grsq
Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/build/toolcfg/gnu-xlc/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ SOLINK_SLINK+=\
#
ifeq ($(HOST_BITS),64)
CX_DEFINES+=LINUXPPC64
CX_FLAGS+=-q64 -qstackprotect
CX_FLAGS+=-q64
CX_ARCH?=ppc64
SPP_DEFINES+=LINUXPPC64
SPP_FLAGS+=-q64
Expand Down
4 changes: 0 additions & 4 deletions runtime/compiler/build/toolcfg/gnu/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ CX_DEFAULTOPT=-O3
CX_OPTFLAG?=$(CX_DEFAULTOPT)
CX_FLAGS_PROD+=$(CX_OPTFLAG)

ifeq ($(HOST_BITS),64)
CX_FLAGS+=-fstack-protector
endif

ifeq ($(HOST_ARCH),x)
CX_FLAGS+=-mfpmath=sse -msse -msse2 -fno-math-errno -fno-trapping-math

Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/build/toolcfg/zos-xlc/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ CX_OPTFLAG?=$(CX_DEFAULTOPT)
CX_FLAGS_PROD+=$(CX_OPTFLAG) -Wc,INLINE\(auto,noreport,600,5000\)

ifeq ($(HOST_BITS),64)
CX_FLAGS+=-Wc,lp64 -Wc,stackprotect
CX_FLAGS+=-Wc,lp64
endif

#
Expand Down
8 changes: 0 additions & 8 deletions runtime/gc_glue_java/configure_includes/configure_aix_ppc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,3 @@ CONFIGURE_ARGS += 'OMR_HOST_OS=aix'
CONFIGURE_ARGS += 'OMR_HOST_ARCH=ppc'
CONFIGURE_ARGS += 'OMR_TARGET_DATASIZE=$(TEMP_TARGET_DATASIZE)'
CONFIGURE_ARGS += 'OMR_TOOLCHAIN=xlc'

# Add stack protect option for 64bit platform
ifneq (,$(findstring -64,$(SPEC)))
CONFIGURE_ARGS+= \
'GLOBAL_CFLAGS=-qstackprotect' \
'GLOBAL_CXXFLAGS=-qstackprotect' \
'GLOBAL_CPPFLAGS=-qstackprotect'
endif
10 changes: 1 addition & 9 deletions runtime/gc_glue_java/configure_includes/configure_linux_390.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2016, 2019 IBM Corp. and others
# Copyright (c) 2016, 2018 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -160,11 +160,3 @@ CONFIGURE_ARGS += 'OMR_HOST_OS=linux'
CONFIGURE_ARGS += 'OMR_HOST_ARCH=s390'
CONFIGURE_ARGS += 'OMR_TARGET_DATASIZE=$(TEMP_TARGET_DATASIZE)'
CONFIGURE_ARGS += 'OMR_TOOLCHAIN=gcc'

# Add stack protect option for 64bit platform
ifneq (,$(findstring -64,$(SPEC)))
CONFIGURE_ARGS+= \
'GLOBAL_CFLAGS=-fstack-protector' \
'GLOBAL_CXXFLAGS=-fstack-protector' \
'GLOBAL_CPPFLAGS=-fstack-protector'
endif
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,3 @@ CONFIGURE_ARGS += 'OMR_TOOLS_CXX=g++'
CONFIGURE_ARGS += 'OMR_BUILD_DATASIZE=64'
CONFIGURE_ARGS += 'OMR_BUILD_TOOLCHAIN=gcc'
endif

CONFIGURE_ARGS+= 'GLOBAL_CFLAGS=-fstack-protector'
CONFIGURE_ARGS+= 'GLOBAL_CPPFLAGS=-fstack-protector'
CONFIGURE_ARGS+= 'GLOBAL_CXXFLAGS=-fstack-protector'
15 changes: 0 additions & 15 deletions runtime/gc_glue_java/configure_includes/configure_linux_ppc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,6 @@ ifneq (,$(findstring _gcc,$(SPEC)))
endif
CONFIGURE_ARGS += 'OMR_TOOLCHAIN=gcc'
CONFIGURE_ARGS += 'CXXLINKSHARED=$(CXX)'

# Add stack protect option for 64bit platform
ifneq (,$(findstring -64,$(SPEC)))
CONFIGURE_ARGS+= \
'GLOBAL_CFLAGS=-fstack-protector' \
'GLOBAL_CXXFLAGS=-fstack-protector' \
'GLOBAL_CPPFLAGS=-fstack-protector'
endif
else
ifeq (default,$(origin AS))
AS = xlc_r
Expand All @@ -255,13 +247,6 @@ else
CONFIGURE_ARGS += 'OMR_TOOLCHAIN=xlc'
CONFIGURE_ARGS += 'CXXLINKSHARED=$(CC)'
# CPP is unused: 'CPP=cpp'

# Add stack protect option for 64bit platform
ifneq (,$(findstring -64,$(SPEC)))
CONFIGURE_ARGS+= \
'GLOBAL_CFLAGS=-qstackprotect' \
'GLOBAL_CXXFLAGS=-qstackprotect'
endif
endif

CONFIGURE_ARGS += 'AR=$(AR)'
Expand Down
10 changes: 1 addition & 9 deletions runtime/gc_glue_java/configure_includes/configure_linux_x86.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2016, 2019 IBM Corp. and others
# Copyright (c) 2016, 2018 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -203,11 +203,3 @@ CONFIGURE_ARGS += 'OMR_HOST_OS=linux'
CONFIGURE_ARGS += 'OMR_HOST_ARCH=x86'
CONFIGURE_ARGS += 'OMR_TARGET_DATASIZE=$(TEMP_TARGET_DATASIZE)'
CONFIGURE_ARGS += 'OMR_TOOLCHAIN=gcc'

# Add stack protect option for 64bit platform
ifneq (,$(findstring -64,$(SPEC)))
CONFIGURE_ARGS+= \
'GLOBAL_CFLAGS=-fstack-protector' \
'GLOBAL_CXXFLAGS=-fstack-protector' \
'GLOBAL_CPPFLAGS=-fstack-protector'
endif
10 changes: 1 addition & 9 deletions runtime/gc_glue_java/configure_includes/configure_osx.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2019 IBM Corp. and others
# Copyright (c) 2017, 2018 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -59,11 +59,3 @@ CONFIGURE_ARGS += 'OMR_HOST_OS=osx'
CONFIGURE_ARGS += 'OMR_HOST_ARCH=x86'
CONFIGURE_ARGS += 'OMR_TARGET_DATASIZE=$(TEMP_TARGET_DATASIZE)'
CONFIGURE_ARGS += 'OMR_TOOLCHAIN=gcc'

# Add stack protect option for 64bit platform
ifneq (,$(findstring -64,$(SPEC)))
CONFIGURE_ARGS+= \
'GLOBAL_CFLAGS=-fstack-protector' \
'GLOBAL_CXXFLAGS=-fstack-protector' \
'GLOBAL_CPPFLAGS=-fstack-protector'
endif
12 changes: 3 additions & 9 deletions runtime/gc_glue_java/configure_includes/configure_zos_390.mk.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2016, 2019 IBM Corp. and others
# Copyright (c) 2016, 2018 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -148,11 +148,5 @@ CONFIGURE_ARGS += 'OMR_HOST_ARCH=s390'
CONFIGURE_ARGS += 'OMR_TARGET_DATASIZE=$(TEMP_TARGET_DATASIZE)'
CONFIGURE_ARGS += 'OMR_TOOLCHAIN=xlc'

# Add stack protect option for 64bit platform
ifneq (,$(findstring -64,$(SPEC)))
CONFIGURE_ARGS += 'GLOBAL_CXXFLAGS=-W "c,SERVICE(j${uma.buildinfo.build_date})" -Wc,stackprotect'
CONFIGURE_ARGS += 'GLOBAL_CFLAGS=-W "c,SERVICE(j${uma.buildinfo.build_date})" -Wc,stackprotect'
else
CONFIGURE_ARGS += 'GLOBAL_CXXFLAGS=-W "c,SERVICE(j${uma.buildinfo.build_date})"'
CONFIGURE_ARGS += 'GLOBAL_CFLAGS=-W "c,SERVICE(j${uma.buildinfo.build_date})"'
endif
CONFIGURE_ARGS += 'GLOBAL_CXXFLAGS=-W "c,SERVICE(j${uma.buildinfo.build_date})"'
CONFIGURE_ARGS += 'GLOBAL_CFLAGS=-W "c,SERVICE(j${uma.buildinfo.build_date})"'
6 changes: 3 additions & 3 deletions runtime/makelib/targets.mk.aix.inc.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ CXXFLAGS += -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE -DRS6000 -DAIXPPC -D_LARGE_
CPPFLAGS += -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE -DRS6000 -DAIXPPC -D_LARGE_FILES

ifeq ($(j9vm_env_data64),1)
CFLAGS += -DPPC64 -qstackprotect
CXXFLAGS += -DPPC64 -qstackprotect
CPPFLAGS += -DPPC64 -qstackprotect
CFLAGS += -DPPC64
CXXFLAGS += -DPPC64
CPPFLAGS += -DPPC64
endif

ifdef I5_VERSION
Expand Down
32 changes: 16 additions & 16 deletions runtime/makelib/targets.mk.linux.inc.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -295,26 +295,26 @@ ifdef j9vm_uma_supportsIpv6
endif

<#if uma.spec.processor.amd64>
CFLAGS += -DJ9HAMMER -m64 -fstack-protector
CXXFLAGS += -DJ9HAMMER -m64 -fstack-protector
CPPFLAGS += -DJ9HAMMER -m64 -fstack-protector
CFLAGS += -DJ9HAMMER -m64
CXXFLAGS += -DJ9HAMMER -m64
CPPFLAGS += -DJ9HAMMER -m64
<#elseif uma.spec.processor.arm>
CFLAGS += -DJ9ARM -DARMGNU -DARM -DFIXUP_UNALIGNED -I$(XCOMP_TOOLCHAIN_BASEDIR)/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/include
CXXFLAGS += -DJ9ARM -DARMGNU -DARM -DFIXUP_UNALIGNED -I$(XCOMP_TOOLCHAIN_BASEDIR)/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/include -fno-threadsafe-statics
CPPFLAGS += -DJ9ARM -DARMGNU -DARM -DFIXUP_UNALIGNED-I$(XCOMP_TOOLCHAIN_BASEDIR)/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/include
<#elseif uma.spec.processor.aarch64>
CFLAGS += -DJ9AARCH64 -fstack-protector
CXXFLAGS += -DJ9AARCH64 -fstack-protector
CPPFLAGS += -DJ9AARCH64 -fstack-protector
CFLAGS += -DJ9AARCH64
CXXFLAGS += -DJ9AARCH64
CPPFLAGS += -DJ9AARCH64
<#elseif uma.spec.processor.ppc>
CFLAGS += -DLINUXPPC
CXXFLAGS += -DLINUXPPC
CPPFLAGS += -DLINUXPPC
<#if uma.spec.flags.env_gcc.enabled>
ifdef j9vm_env_data64
CFLAGS += -m64 -DLINUXPPC64 -DPPC64 -fstack-protector
CXXFLAGS += -m64 -DLINUXPPC64 -DPPC64 -fstack-protector
CPPFLAGS += -m64 -DLINUXPPC64 -DPPC64 -fstack-protector
CFLAGS += -m64 -DLINUXPPC64 -DPPC64
CXXFLAGS += -m64 -DLINUXPPC64 -DPPC64
CPPFLAGS += -m64 -DLINUXPPC64 -DPPC64
else
CFLAGS += -m32
CXXFLAGS += -m32
Expand All @@ -331,17 +331,17 @@ endif
CFLAGS += -qarch=ppc64
CXXFLAGS += -qarch=ppc64
</#if>
CFLAGS += -q64 -DLINUXPPC64 -DPPC64 -qstackprotect
CXXFLAGS += -q64 -DLINUXPPC64 -DPPC64 -qstackprotect
CPPFLAGS += -DLINUXPPC64 -DPPC64 -qstackprotect
CFLAGS += -q64 -DLINUXPPC64 -DPPC64
CXXFLAGS += -q64 -DLINUXPPC64 -DPPC64
CPPFLAGS += -DLINUXPPC64 -DPPC64
else
CFLAGS += -qarch=ppc
CXXFLAGS += -qarch=ppc
endif
</#if>
ifdef j9vm_env_data64
ifdef USE_PPC_GCC
PPC_GCC_CXXFLAGS += -DLINUXPPC -DLINUXPPC64 -DPPC64 -m64 -fstack-protector
PPC_GCC_CXXFLAGS += -DLINUXPPC -DLINUXPPC64 -DPPC64 -m64
endif
else
ifdef USE_PPC_GCC
Expand All @@ -353,9 +353,9 @@ endif
CXXFLAGS += $(J9M31) -DS390 -D_LONG_LONG -DJ9VM_TIERED_CODE_CACHE -fno-strict-aliasing
CPPFLAGS += -DS390 -D_LONG_LONG -DJ9VM_TIERED_CODE_CACHE
ifdef j9vm_env_data64
CFLAGS += -DS39064 -fstack-protector
CXXFLAGS += -DS39064 -fstack-protector
CPPFLAGS += -DS39064 -fstack-protector
CFLAGS += -DS39064
CXXFLAGS += -DS39064
CPPFLAGS += -DS39064
endif
<#elseif uma.spec.processor.x86>
CFLAGS += -DJ9X86 -m32 -msse2
Expand Down
8 changes: 4 additions & 4 deletions runtime/makelib/targets.mk.osx.inc.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#--
Copyright (c) 1998, 2019 IBM Corp. and others
Copyright (c) 1998, 2018 IBM Corp. and others
This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -116,9 +116,9 @@ ifdef j9vm_uma_supportsIpv6
endif

<#if uma.spec.processor.amd64>
CFLAGS += -DJ9HAMMER -m64 -fstack-protector
CXXFLAGS += -DJ9HAMMER -m64 -fstack-protector
CPPFLAGS += -DJ9HAMMER -m64 -fstack-protector
CFLAGS += -DJ9HAMMER -m64
CXXFLAGS += -DJ9HAMMER -m64
CPPFLAGS += -DJ9HAMMER -m64
</#if>

# https://stackoverflow.com/questions/21907504/how-to-compile-shared-lib-with-clang-on-osx
Expand Down
8 changes: 1 addition & 7 deletions runtime/makelib/targets.mk.zos.inc.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#--
Copyright (c) 1998, 2019 IBM Corp. and others
Copyright (c) 1998, 2017 IBM Corp. and others
This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -114,12 +114,6 @@ CFLAGS+=-Wc,"langlvl(extc99)" $(UMA_ZOS_FLAGS)
CPPFLAGS+=-Wc,"langlvl(extc99)"
CXXFLAGS+=-Wc,"langlvl(extended)" $(UMA_WC_64) -+ $(UMA_ZOS_FLAGS)

ifdef j9vm_env_data64
CFLAGS+= -Wc,stackprotect
CPPFLAGS+= -Wc,stackprotect
CXXFLAGS+= -Wc,stackprotect
endif

UMA_ZOS_CXX_LD_FLAGS+=-Wc,"langlvl(extended)" $(UMA_WC_64) -+

UMA_DLLTARGET_XSRC=$($(UMA_TARGET_NAME)_xsrc)
Expand Down

0 comments on commit 21e8e75

Please sign in to comment.