From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BBB441A1E05 for ; Thu, 6 Oct 2016 01:20:42 -0700 (PDT) Received: by mail-io0-x233.google.com with SMTP id j37so8159101ioo.3 for ; Thu, 06 Oct 2016 01:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7dY89SUYfpWSOKKfbTbYHwibNyALvxXmsaaxf36Qm04=; b=iA4kFsjAc4qEy9htzPFLy5C8IM+Z6sOvxMYAbl/GRPB2zmcxwko/Ra6bLL4RNNRzGq Tt3pXCgvbodO3aGMVl7nnKptgNe7XiLtv4tJXQNjqVDubUxr35ADSWEoXFxO9ffucwb9 z9flt+SXEt6gdW1FwqVDlAL8Ml/gSabNVn3x8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7dY89SUYfpWSOKKfbTbYHwibNyALvxXmsaaxf36Qm04=; b=A3atHT+ty3ulndPkGCk6TWdutyTU3b+lK8bJlGUuF6Zm1oPKVpt0i6+M59WuFdj+zS r34vdjgR2gfuHa4EX5y18ARSiP20vL3qKJaa9LvTpgLTWU6JyqL/4l9/t2W68Ezon4dh DZZ8oQvareMYOO5FxdUww3qR1ZdoJ+5bdbuksKKx99Hd2t5+J2pA9BMWPat/pDTAD2Gm tapF9bWcrfxv3yGreWPFgFQ0p6yWTS4pFZY3quD43dqljUTB6fxXZbVvmrpd1TLYJ8T0 VLCiLMUCE48IDYF6wj28VtEGtn1scO4GxqTJoDYX9zlvvNDZMzLGc0sBAVEvbtrcVd3F APBQ== X-Gm-Message-State: AA6/9RlaXVuG2YTgT3OHNqdFIxCaW+JoEkektg19CQu7S/Vsd+fh5vsa6O29FbhXmuf4r20uIX+dwwdj5BzWBzUi X-Received: by 10.107.28.148 with SMTP id c142mr13005242ioc.45.1475742042020; Thu, 06 Oct 2016 01:20:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.5.139 with HTTP; Thu, 6 Oct 2016 01:20:41 -0700 (PDT) In-Reply-To: <896ca32b-3f51-6815-5c1b-1846b2cffd1c@redhat.com> References: <1475631026-23928-1-git-send-email-yonghong.zhu@intel.com> <9a33de86-b2f0-bd43-8c05-0a091cde0599@cran.org.uk> <896ca32b-3f51-6815-5c1b-1846b2cffd1c@redhat.com> From: Ard Biesheuvel Date: Thu, 6 Oct 2016 09:20:41 +0100 Message-ID: To: Laszlo Ersek Cc: Bruce Cran , Yonghong Zhu , "edk2-devel@lists.01.org" , Liming Gao Subject: Re: [Patch V2] BaseTools: support the NOOPT target with the GCC tool chains X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 08:20:43 -0000 Content-Type: text/plain; charset=UTF-8 On 6 October 2016 at 09:19, Laszlo Ersek wrote: > On 10/06/16 00:39, Bruce Cran wrote: >> On 10/04/2016 07:30 PM, Yonghong Zhu wrote: >> >>> Update the tools_def.template to add NOOPT support with GCC tool chains. >>> >>> Cc: Liming Gao >>> Cc: Laszlo Ersek >>> Contributed-under: TianoCore Contribution Agreement 1.0 >>> Signed-off-by: Yonghong Zhu >> >> Reviewed-by: Bruce Cran >> Tested-by: Bruce Cran >> >> Tested with both GCC49 and GCC5 toolchain settings (using gcc 6.2.1 for >> both) and verified that both have functional debugging, though gdb skips >> around with GCC5 as expected due to LTCG. >> > > Right; as I mentioned up-thread, I wonder if we should disable -flto and -Os in NOOPT_GCC5_IA32_DLINK_FLAGS and NOOPT_GCC5_X64_DLINK_FLAGS. > > How about we add the following to Yonghong's v2? > - first, move "-flto" from GCC5_IA32_X64_DLINK_FLAGS and GCC5_X64_DLINK_FLAGS to the users of those macros (both GCC5- and CLANG38-related users exist), > - second, for the GCC5 users of these macros: split them into DEBUG/RELEASE/NOOPT, and remove -Os from NOOPT. > > The end result is that none of the earlier macro values change, except for NOOPT_GCC5_(IA32|X64)_DLINK_FLAGS; those two lose both -flto and -Os, which is our purpose. This would eliminate the skipping around that you mention. > > What do you guys think? See the patch below (again, to be applied on top of Yonghong's v2, or to be squashed into it). > I agree. If we are going through the trouble of having a separate NOOPT flavor, it should at least do what it says on the tin. If it skips around, using it has no advantage over using DEBUG