From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web11.6736.1596110903967653414 for ; Thu, 30 Jul 2020 05:08:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=BAxaXxL4; spf=pass (domain: nuviainc.com, ip: 209.85.128.52, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f52.google.com with SMTP id 3so5986508wmi.1 for ; Thu, 30 Jul 2020 05:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+wT/9udzXoky9AuD6iPAe5coIyDFVOImWw40TDSCzFc=; b=BAxaXxL4fFYHg+D4peRIrwRmJUWN0WZwpXD9UIos2cMBOKmgWU72F21vkT/+17Q+X3 3HEeCXOS93JtG5SwngRG+fkSq6MAcFaGJePnuDj7EOjh0udbgt5II9IXt1ZxNmAsPtnb rhhgFQsZgvLC2uP+JFsMwgiPrYuuYpQZUUNWHVY828+tndFTjHsmYX8xh8ctSfV5qwHP 9PKaU74VNTgd7E/iSmPAO7rJwxzVgJUYK42HGy+tQ93vDgea4nEsjetD01caK5QcZxQu YmO2WHRI33p3a5tDkViMV/T3t7DR0IeBKr0OLmgWN1FMqP7cEYeL1p3m271Zqm/b18tC 0QzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+wT/9udzXoky9AuD6iPAe5coIyDFVOImWw40TDSCzFc=; b=p4BM8oa7tLLsXCCt5CkNLmPgZ+bciI54FvXPl2/hTLs+2yBrCsTJARBH+W0yWiiP4r c8Nv4ogEamMPwO+/I73GYXKFKhX+ddwU5UA/o0e63f5ytJesq2vrhcV2B1qkBBn3Ifat 7JRHZzESSEkHmgsr42FdZZQQUClV2JPxq+LrT6NBhPXeaJJRLutOUxKtIy+xwzS3/VKP 8ftUN4wMOnxBGzaSgrSQ4vB/RyejL7MIpWeRNcpmzm1Qch9od/ShyypzwkDNR8GE3OHF KnwC5p7R6Qv0uty/dhLgA8w8gL9RfGxa0PInSQfNc+azqHENt0bcE1rD4UCgb9ULoiO8 NeUw== X-Gm-Message-State: AOAM532ohbImLEeXQs4HEyNStOTxwQkHPsPHoOzarxUKpmKnmMQVKYCq A2dUwuIldNcZ/nagZ6wnnewujkVZS+6gqVWt3v+qqqSFCSw5+L4MFzLfmqoZ9nGi4Pa7KDg7dml fxmECzXw2daI5vdyyuRSR/yuRKAwelmLPnpuSntX0H8K9P+FHhTTYNyumYOsD+et/CQ== X-Google-Smtp-Source: ABdhPJwCFL9rF27sFQnmGJ6FUxZTMkuWtNo5Yrzhmnjjp272/sT88ZTaM41BZ8aSr2r7YuRip8b/mg== X-Received: by 2002:a1c:7311:: with SMTP id d17mr12938069wmb.60.1596110902142; Thu, 30 Jul 2020 05:08:22 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id n18sm9990423wrw.45.2020.07.30.05.08.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2020 05:08:21 -0700 (PDT) Date: Thu, 30 Jul 2020 13:08:18 +0100 From: "Leif Lindholm" To: devel@edk2.groups.io, bob.c.feng@intel.com Cc: PierreGondois , "Gao, Liming" , tomas@nuviainc.com, Ard Biesheuvel Subject: Re: [edk2-devel] [PATCH V2 2/2] BaseTools: Factorize GCC flags Message-ID: <20200730120818.GO31778@vanye> References: <20200707083522.138944-1-pierre.gondois@arm.com> <20200707083522.138944-3-pierre.gondois@arm.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline And now I spotted this one. Why are we going back and changing build flags for toolchain profiles that are kept around for legacy use only? GCC 4.8 was released in 2013. While I agree it *semantically* makes sense for GCC*_CC_FLAGS to inherit GCC_ALL_CC_FLAGS, I am pretty sure the discrepancy was put there for a reason - to keep the legacy profile working as it had done even if we decided to enable new features for all modern profiles. (That we then stopped having to create new profiles for each new GCC release and hence haven't gone beyond GCC5 is beside the point - GCC5 encompasses all gcc toolchains since.) I'll let Ard comment (when he's back), but I'm thinking this one ought to be reverted as well. / Leif On Mon, Jul 20, 2020 at 04:11:53 +0000, Bob Feng wrote: > Reviewed-by: Bob Feng > > -----Original Message----- > From: PierreGondois > Sent: Tuesday, July 7, 2020 4:35 PM > To: devel@edk2.groups.io > Cc: Pierre Gondois ; Feng, Bob C ; Gao, Liming ; tomas.pilar@arm.com; nd@arm.com > Subject: [PATCH V2 2/2] BaseTools: Factorize GCC flags > > From: Pierre Gondois > > GCC48_ALL_CC_FLAGS has no dependency on GCC_ALL_CC_FLAGS. > By definition, there should be such dependency. > > The outcomes of this patch is that GCC48_ALL_CC_FLAGS and other dependent configurations will inherit from the additional "-Os" flag. > The "-Os" flag optimizes a build in size, not breaking any build. In a gcc command line, the last optimization flag has precedence. This means that this "-Os" flag will be overriden by a more specific optimization configuration, provided that this more specific flag is appended at the end of the CC_FLAGS. > > Signed-off-by: Pierre Gondois > Suggested-by: Tomas Pilar > --- > > The changes can be seen at: https://github.com/PierreARM/edk2/commits/831_Add_gcc_flag_warning_v2 > > Notes: > v2: > - Make GCC48_ALL_CC_FLAGS dependent on > GCC_ALL_CC_FLAGS. [Tomas] > > BaseTools/Conf/tools_def.template | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template > index 397b011ba38f97f81f314f8641ac8bb95d5a2197..a1fd27b1adba8769949b7d628d7fbed49fe24267 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -1952,7 +1952,7 @@ DEFINE GCC_RISCV64_RC_FLAGS = -I binary -O elf64-littleriscv -B riscv > # GCC Build Flag for included header file list generation > DEFINE GCC_DEPS_FLAGS = -MMD -MF $@.deps > > -DEFINE GCC48_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings > +DEFINE GCC48_ALL_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings > DEFINE GCC48_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20 > DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address > DEFINE GCC48_X64_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address > -- > 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' > > > >