From: George Joseph Date: Sun, 22 Jun 2014 20:46:38 +0000 (+0000) Subject: build: Turn FORTIFY_SOURCE off if DONT_OPTIMIZE is set. X-Git-Tag: 1.8.29.0-rc1~12 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c64fde05ab23c8c34610388b8040db7a08162d44;p=thirdparty%2Fasterisk.git build: Turn FORTIFY_SOURCE off if DONT_OPTIMIZE is set. AST_FORTIFY_SOURCE is automatically set in ./Makefile even if DONT_OPTIMIZE is set in menuselect. This causes gcc to complain that _FORTIFY_SOURCE requires optimization and the build will fail. You can specify "make AST_FORTIFY_SOURCE=''" but I always forget. This patch moves the set of AST_FORTIFY_SOURCE to Makefile.rules and only sets it if DONT_OPTIMIZE is "no". The move is necessary because the top-level Makefile doesn't include menuselect.makeopts. This doesn't solve the entire problem however because res_config_mysql seems to force _FORTIFY_SOURCE so res_config_mysql has to be disabled for now if DONT_OPTIMIZE is set. Tested by: George Joseph Review: https://reviewboard.asterisk.org/r/3664/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@417016 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/Makefile b/Makefile index 6c88ac321e..36a8b7e0c5 100644 --- a/Makefile +++ b/Makefile @@ -176,7 +176,6 @@ ifeq ($(AST_DEVMODE),yes) _ASTCFLAGS+=-Werror _ASTCFLAGS+=-Wunused _ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT) - _ASTCFLAGS+=$(AST_FORTIFY_SOURCE) _ASTCFLAGS+=-Wundef _ASTCFLAGS+=-Wmissing-format-attribute _ASTCFLAGS+=-Wformat=2 diff --git a/Makefile.rules b/Makefile.rules index fb63634ace..d035f978e4 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -82,6 +82,8 @@ CXX_LIBS=$(PTHREAD_LIBS) $(LIBS) # and if that doesn't fail then compile again with optimizer disabled ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),DONT_OPTIMIZEyes) COMPILE_DOUBLE=yes +else +_ASTCFLAGS+=$(AST_FORTIFY_SOURCE) endif ifeq ($(findstring BUILD_NATIVE,$(MENUSELECT_CFLAGS)),BUILD_NATIVE)