shithub: openh264

Download patch

ref: a6787120854a36c537b845608caa796808c29d54
parent: 579a5bc6c255edfde90a3ea5e376fc59c7b2e49b
author: Martin Storsjö <martin@martin.st>
date: Fri Mar 15 06:36:11 EDT 2019

Move -fstack-protector-all to platform specific makefiles

This flag isn't supported by all compilers, namely MSVC warns about
this flag being unrecognized.

--- 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 $@