]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
build: Turn FORTIFY_SOURCE off if DONT_OPTIMIZE is set.
authorGeorge Joseph <george.joseph@fairview5.com>
Sun, 22 Jun 2014 20:52:19 +0000 (20:52 +0000)
committerGeorge Joseph <george.joseph@fairview5.com>
Sun, 22 Jun 2014 20:52:19 +0000 (20:52 +0000)
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/
........

Merged revisions 417016 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@417017 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
Makefile.rules

index d112302f01c4191e4586ab7d967d8a1be2cf0a95..6508784bbb5b21db85896a8429aaf746f16f8716 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -186,7 +186,6 @@ ifeq ($(AST_DEVMODE),yes)
   _ASTCFLAGS+=-Werror
   _ASTCFLAGS+=-Wunused
   _ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
-  _ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
   _ASTCFLAGS+=$(AST_TRAMPOLINES)
   _ASTCFLAGS+=-Wundef
   _ASTCFLAGS+=-Wmissing-format-attribute
index fb63634ace571ca2025769627ddba9c38d666c8d..d035f978e4cbc30ba9575fc67f86286e21f1eeed 100644 (file)
@@ -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)