ref: 72780ebd1f5ea4dd22952f8bd35c23c14661c666
parent: 1b0576f9150baa5b58f176eb0769db45e92c3681
parent: a6787120854a36c537b845608caa796808c29d54
author: huili2 <huili2@cisco.com>
date: Tue Mar 19 10:12:37 EDT 2019
Merge pull request #3111 from mstorsjo/stack-protector-msvc Move -fstack-protector-all to platform specific makefiles
--- a/Makefile
+++ b/Makefile
@@ -83,7 +83,7 @@
MODULE := $(LIBPREFIX)$(MODULE_NAME).$(SHAREDLIBSUFFIX)
-CFLAGS += -DGENERATED_VERSION_HEADER -fstack-protector-all
+CFLAGS += -DGENERATED_VERSION_HEADER
LDFLAGS +=
ifeq (Yes, $(GCOV))
--- a/build/platform-android.mk
+++ b/build/platform-android.mk
@@ -44,7 +44,7 @@
CXX = $(TOOLCHAINPREFIX)g++
CC = $(TOOLCHAINPREFIX)gcc
AR = $(TOOLCHAINPREFIX)ar
-CFLAGS += -DANDROID_NDK -fpic --sysroot=$(SYSROOT) -MMD -MP
+CFLAGS += -DANDROID_NDK -fpic --sysroot=$(SYSROOT) -MMD -MP -fstack-protector-all
CFLAGS += -isystem $(NDKROOT)/sysroot/usr/include -isystem $(NDKROOT)/sysroot/usr/include/$(TOOLCHAIN_NAME) -D__ANDROID_API__=$(NDKLEVEL)
CXXFLAGS += -fno-rtti -fno-exceptions
LDFLAGS += --sysroot=$(SYSROOT)
--- a/build/platform-bsd.mk
+++ b/build/platform-bsd.mk
@@ -3,7 +3,7 @@
SHAREDLIBSUFFIXFULLVER=$(SHAREDLIBSUFFIX).$(FULL_VERSION)
SHAREDLIBSUFFIXMAJORVER=$(SHAREDLIBSUFFIX).$(SHAREDLIB_MAJORVERSION)
SHLDFLAGS = -Wl,-soname,$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER)
-CFLAGS += -fPIC
+CFLAGS += -fPIC -fstack-protector-all
LDFLAGS += -lpthread
STATIC_LDFLAGS += -lpthread -lm
ifeq ($(ASM_ARCH), x86)
--- a/build/platform-darwin.mk
+++ b/build/platform-darwin.mk
@@ -10,7 +10,7 @@
$(SHAREDLIB_DIR)/$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER)
SHARED = -dynamiclib
SHARED += -current_version $(CURRENT_VERSION) -compatibility_version $(COMPATIBILITY_VERSION)
-CFLAGS += -Wall -fPIC -MMD -MP
+CFLAGS += -Wall -fPIC -MMD -MP -fstack-protector-all
ifeq ($(ASM_ARCH), x86)
ASMFLAGS += -DPREFIX
ifeq ($(ARCH), x86_64)
--- a/build/platform-linux.mk
+++ b/build/platform-linux.mk
@@ -3,7 +3,7 @@
SHAREDLIBSUFFIXFULLVER=$(SHAREDLIBSUFFIX).$(FULL_VERSION)
SHAREDLIBSUFFIXMAJORVER=$(SHAREDLIBSUFFIX).$(SHAREDLIB_MAJORVERSION)
SHLDFLAGS = -Wl,-soname,$(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIXMAJORVER)
-CFLAGS += -Wall -fno-strict-aliasing -fPIC -MMD -MP
+CFLAGS += -Wall -fno-strict-aliasing -fPIC -MMD -MP -fstack-protector-all
LDFLAGS += -lpthread
STATIC_LDFLAGS += -lpthread -lm
AR_OPTS = crD $@