[Asterisk-code-review] build system: Split COMPILE DOUBLE from DONT OPTIMIZE (asterisk[13])

George Joseph asteriskteam at digium.com
Sat Mar 12 16:35:34 CST 2016


George Joseph has uploaded a new change for review.

  https://gerrit.asterisk.org/2380

Change subject: build_system:  Split COMPILE_DOUBLE from DONT_OPTIMIZE
......................................................................

build_system:  Split COMPILE_DOUBLE from DONT_OPTIMIZE

I can't ever recall actually needed the intermediate files or
the checking that a double compile produces.  What I CAN remember
is every DONT_OPTIMIZE build needing 3 invocations of gcc instead
of 1 just to produce those intermediate files.

If you really do need them, just check COMPILE_DOUBLE in menuselect.

Change-Id: Id49ca930ac4b5ec4fc2d8141979ad888da7b1611
---
M Makefile.rules
M build_tools/cflags.xml
2 files changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/80/2380/1

diff --git a/Makefile.rules b/Makefile.rules
index 1031f2d..a22f19c 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -103,13 +103,15 @@
 CXX_LIBS=$(PTHREAD_LIBS) $(LIBS)
 
 # determine whether to double-compile so that the optimizer can report code path problems
-# this is only done when developer mode and DONT_OPTIMIZE are both enabled
-# in that case, we run the preprocessor to produce a .i or .ii file from the source
+# In this case, we run the preprocessor to produce a .i or .ii file from the source
 # code, then compile once with optimizer enabled (and the output to /dev/null),
 # and if that doesn't fail then compile again with optimizer disabled
-ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),DONT_OPTIMIZEyes)
+
+ifeq ($(findstring COMPILE_DOUBLE,$(MENUSELECT_CFLAGS)),COMPILE_DOUBLE)
 COMPILE_DOUBLE=yes
-else
+endif
+
+ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),)
 _ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
 endif
 
diff --git a/build_tools/cflags.xml b/build_tools/cflags.xml
index ea74153..282f36b 100644
--- a/build_tools/cflags.xml
+++ b/build_tools/cflags.xml
@@ -2,6 +2,9 @@
 		<member name="DONT_OPTIMIZE" displayname="Disable Optimizations by the Compiler">
 			<support_level>core</support_level>
 		</member>
+		<member name="COMPILE_DOUBLE" displayname="Double Compile Through Intermediate Files">
+			<support_level>core</support_level>
+		</member>
 		<member name="DEBUG_THREADS" displayname="Enable Thread Debugging">
 			<support_level>core</support_level>
 		</member>

-- 
To view, visit https://gerrit.asterisk.org/2380
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id49ca930ac4b5ec4fc2d8141979ad888da7b1611
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>



More information about the asterisk-code-review mailing list