Changeset - r21605:95c0c9aca14a
[Not reviewed]
master
0 1 0
rubidium - 10 years ago 2014-08-16 10:17:18
rubidium@openttd.org
(svn r26735) -Fix (rmakefilerewrite): for profiling CFLAGS got a -p (for prof) and LDFLAGS got -pg (for gprof), but in the end gprof would be used (via make run-prof). Furthermore -pg isn't compatible with -fomit-frame-pointer on certain architectures (most importantly x86(_64)), so simply don't enable that flag when profiling is enabled
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1447,13 +1447,17 @@ make_cflags_and_ldflags() {
 
		OBJS_SUBDIR="release"
 
		if [ "$os" = "MORPHOS" ]; then
 
			CFLAGS="-I/gg/os-include -noixemul -fstrict-aliasing -fexpensive-optimizations -mcpu=604 -fno-inline -mstring -mmultiple $CFLAGS"
 
			LDFLAGS="$LDFLAGS -noixemul"
 
		fi
 

	
 
		CFLAGS="-O2 -fomit-frame-pointer $CFLAGS"
 
		if [ "$enable_profiling" == "0" ]; then
 
			# -fomit-frame-pointer and -pg do not go well together (gcc errors they are incompatible)
 
			CFLAGS="-fomit-frame-pointer $CFLAGS"
 
		fi
 
		CFLAGS="-O2 $CFLAGS"
 
	else
 
		OBJS_SUBDIR="debug"
 

	
 
		# Each debug level reduces the optimization by a bit
 
		if [ $enable_debug -ge 1 ]; then
 
			CFLAGS="$CFLAGS -g -D_DEBUG"
 
@@ -1491,13 +1495,13 @@ make_cflags_and_ldflags() {
 
		# Apple's GCC 4.0 has a compiler bug for x86_64 with (higher) optimization,
 
		# wrongly optimizing ^= in loops. This disables the failing optimisation.
 
		CFLAGS="$CFLAGS -fno-expensive-optimizations"
 
	fi
 

	
 
	if [ "$enable_profiling" != "0" ]; then
 
		CFLAGS="$CFLAGS -p"
 
		CFLAGS="$CFLAGS -pg"
 
		LDFLAGS="$LDFLAGS -pg"
 
	fi
 

	
 
	if [ "$with_threads" = "0" ]; then
 
		CFLAGS="$CFLAGS -DNO_THREADS"
 
	fi
0 comments (0 inline, 0 general)