From patchwork Tue Apr 19 14:57:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 8881101 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 12DDC9F39D for ; Tue, 19 Apr 2016 14:59:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 444D320263 for ; Tue, 19 Apr 2016 14:59:28 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D0442026C for ; Tue, 19 Apr 2016 14:59:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asX5p-0004Fx-5s; Tue, 19 Apr 2016 14:57:33 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asX5n-0004Fq-Ov for xen-devel@lists.xen.org; Tue, 19 Apr 2016 14:57:31 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id AD/FF-29636-B5746175; Tue, 19 Apr 2016 14:57:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGIsWRWlGSWpSXmKPExsVyMXThYd0od7F wg1N3pSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oynk6ML7rBVrN46jbmB8R5rFyMnh5DAREaJ Ez+Muhi5OFgE2pkl9u2dwgziSAi8Y5E4uesrUxcjB5ATIzGrXwWkQUKgWmLJ79XsEM0KEr8nH GICqRcSmMQkcfHFcrAEm4CGxJNfM9hAbBEBaYlrny8zgtjMAgUSLX0/GUFmCgu4SVz8KwoSZh FQlbje84AFxOYVcJDYvXcVG8RaOYkF730mMPItYGRYxahRnFpUllqka2isl1SUmZ5RkpuYmaN raGCql5taXJyYnpqTmFSsl5yfu4kRGCIMQLCD8d82z0OMkhxMSqK8PNZi4UJ8SfkplRmJxRnx RaU5qcWHGGU4OJQkePXdgHKCRanpqRVpmTnAYIVJS3DwKInwOoOkeYsLEnOLM9MhUqcY7Tm2/ L62loljwY/bQPLTxjtActvUe2uZhFjy8vNSpcR537sCtQmAtGWU5sENhUXXJUZZKWFeRqAzhX gKUotyM0tQ5V8xinMwKgnzOoEs58nMK4Hb/QroLCags/jvioKcVZKIkJJqYJQ+dHl6s15mHvc 5d/VPGlunSYfOeV3jtctRU9eh+JyzhGHnQ0bLI5P1md/+eLz+XpKBSMk/IaMd5/dt/6D0osDx Fl/J67PZ8c+m+W1crZwaJftLS9B3MpPVd6YIgTfzdss5+ohyFPqKSs7Vu6Ao6jZXs04u7OTpk 04cvsd042KXve1zDYzcrcRSnJFoqMVcVJwIAK9mmgKpAgAA X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1461077849!35134079!1 X-Originating-IP: [209.85.161.195] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 33722 invoked from network); 19 Apr 2016 14:57:30 -0000 Received: from mail-yw0-f195.google.com (HELO mail-yw0-f195.google.com) (209.85.161.195) by server-7.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 19 Apr 2016 14:57:30 -0000 Received: by mail-yw0-f195.google.com with SMTP id v81so2614872ywa.2 for ; Tue, 19 Apr 2016 07:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cardoe.com; s=google; h=from:to:cc:subject:date:message-id; bh=1ST+m686FY0daJgQZIuJ4msGTCc2E+iUb/gIAD/9fkk=; b=DwnO7A3MUQrZSBd+81RzAM9BIs8iu1DSNtFb1USc/LsbREve3KsCmKJVDHLT8qKzpe oS3EoesMbxZ+kKWCJEwxgV2FDDAyDIKomwl5vQ61TPjXA2EalOR/52gPvS9Fos8QV8J9 7ViGPzAJfakCLdOIcibdC+dGajPpQvdtAdIso= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1ST+m686FY0daJgQZIuJ4msGTCc2E+iUb/gIAD/9fkk=; b=HdetKkvWVw2qgI2C3oAf9c3HpLnbQETQEAlTb20IECdqfczvJzV+kV84faXu90lTSv 3b25IafKQ/T/Rfa4qxKhCUb/Jm0SZwkrnSI4d7SGr8jtRQ2tSxEmy+tz76unZmhgwWwo xuVrf6bGhoIHiGiQLE6RPoLREXGtwzJfBDpZn3Z0NIJ0qXm0jRflaoF7ziVKyomooqP8 HRZNFoZCI+JlwGjYgoL76CvW0/OtYrzU/coXisL1DAq2xlX5o43ZbblflJaCAqRHR3BB /tI69VeOweKwRqbTEA05gsi/uJ0Xz8N8cq3DzxrUQMhUan3ugeK49Zg48UqgdQ7SdTP4 4HjQ== X-Gm-Message-State: AOPr4FW8nJSgd/RetnBKDbFKc1lYJIvETf4152BVSz+B88gDMgpsmaVdm5VvRDj4G5oVHw== X-Received: by 10.129.51.140 with SMTP id z134mr1875966ywz.322.1461077849243; Tue, 19 Apr 2016 07:57:29 -0700 (PDT) Received: from swanson.lan (c-68-46-196-185.hsd1.al.comcast.net. [68.46.196.185]) by smtp.gmail.com with ESMTPSA id z20sm793053ywd.44.2016.04.19.07.57.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Apr 2016 07:57:27 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Tue, 19 Apr 2016 09:57:16 -0500 Message-Id: <1461077836-7735-1-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.7.3 Cc: Ian Jackson , Wei Liu , Doug Goldstein Subject: [Xen-devel] [PATCH v2] tools: detect appropriate debug optimization level X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building debug use -Og as the optimization level if its available, otherwise retain the use of -O0. -Og has been added by GCC to enable all optimizations that to not affect debugging while retaining full debugability. Signed-off-by: Doug Goldstein --- tools/Rules.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index 9ef0b47..4162bd9 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -137,7 +137,8 @@ SHLIB_libxenvchan = $(SHDEPS_libxenvchan) -Wl,-rpath-link=$(XEN_LIBVCHAN) ifeq ($(debug),y) # Disable optimizations and enable debugging information for macros -CFLAGS += -O0 -g3 +CFLAGS += $(call cc-option,$(CC),-Og,-O0) +CFLAGS += -g3 # But allow an override to -O0 in case Python enforces -D_FORTIFY_SOURCE=. PY_CFLAGS += $(PY_NOOPT_CFLAGS) endif