# HG changeset patch # User rubidium # Date 2014-08-16 10:17:18 # Node ID 95c0c9aca14adcab49cc2117163e862aff5ad1bd # Parent e1869da1486dcff103203776c46a1f408409eaae (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 diff --git a/config.lib b/config.lib --- a/config.lib +++ b/config.lib @@ -1450,7 +1450,11 @@ make_cflags_and_ldflags() { 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" @@ -1494,7 +1498,7 @@ make_cflags_and_ldflags() { fi if [ "$enable_profiling" != "0" ]; then - CFLAGS="$CFLAGS -p" + CFLAGS="$CFLAGS -pg" LDFLAGS="$LDFLAGS -pg" fi