Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752283AbbEYKrO (ORCPT ); Mon, 25 May 2015 06:47:14 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:34582 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751846AbbEYKrN (ORCPT ); Mon, 25 May 2015 06:47:13 -0400 Date: Mon, 25 May 2015 12:47:09 +0200 From: Ingo Molnar To: Martin =?utf-8?B?TGnFoWth?= Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Ingo Molnar , Paul Mackerras , Peter Zijlstra Subject: Re: [PATCH] perf: fix wrong DEBUG configuration Message-ID: <20150525104708.GB30252@gmail.com> References: <20150519140422.GJ13946@kernel.org> <555C871B.90900@suse.cz> <20150520131748.GC2955@kernel.org> <555C8C41.1080608@suse.cz> <20150520135333.GE2955@kernel.org> <20150520145506.GA15679@gmail.com> <555CB373.7090007@suse.cz> <20150521150536.GB13933@kernel.org> <20150522070250.GA30715@gmail.com> <5562D788.9000201@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5562D788.9000201@suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1534 Lines: 57 * Martin Liška wrote: > Currently, GCC optimizes -O6 same as -O3 level, thus change the value > to -O6. s/to -O6 to -O3 > Right optimize debugging experience is given by passing -Og to > compiler. Assign default value for pointers that are identified by > compiler as non-initialized. s/Right optimize debugging experience is given/ Correct debugging experience is given/ s/identified by compiler identified by the compiler > ifeq ($(DEBUG),0) > - CFLAGS += -O6 > + CFLAGS += -O3 > +else > + CFLAGS += $(call cc-option,-Og,-O0) > endif > +# try-run > +# Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise) > +# Exit code chooses option. "$$TMP" is can be used as temporary file and > +# is automatically cleaned up. > +try-run = $(shell set -e; \ > + TMP="$(TMPOUT).$$$$.tmp"; \ > + TMPO="$(TMPOUT).$$$$.o"; \ > + if ($(1)) >/dev/null 2>&1; \ > + then echo "$(2)"; \ > + else echo "$(3)"; \ > + fi; \ > + rm -f "$$TMP" "$$TMPO") > + > +# cc-option > +# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) > + > +cc-option = $(call try-run,\ > + $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) Looks good to me! Acked-by: Ingo Molnar Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/