From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by mx.groups.io with SMTP id smtpd.web10.102400.1674828031260276172 for ; Fri, 27 Jan 2023 06:00:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AsSNxaWo; spf=pass (domain: kernel.org, ip: 145.40.73.55, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C2034CE28AC for ; Fri, 27 Jan 2023 14:00:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6550BC433A1 for ; Fri, 27 Jan 2023 14:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674828025; bh=N5E1VvvvuuE27VFsIOeMiGelNmr5sNsNHVdBnpuzdHQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AsSNxaWo6aXb3FKgD+Xq3oiQFOVNKjh/OWhm4KLjOvHJsxRtgKCzQ6SAYk7uw2jZv BEzVWPNnJmRE0Y5UHqAK4A+NnJw1rV2xHk2JwUgV8yTN/q5FZGGcMQ5Ys+KhuSxfHT C4qmsBIVwWWLn0+HzxMOhyaMVs37nQNztPEayyc+gG8nGYpvDGyN+bpeTAj0pN4lXp MMYE6BfXLaGlK0/RpN+uBuQMX36Bi6yF9RGGGQeW2y1pe+vX1dKMqFU9hYijKE1j+Q XA5fNu5B4U6qTV+WW4KtNcofvoVfhTxwAn3cGI5cOx7NR5lyw0yAHMlp7Ac9rl9FHt FIGtiUEtVF7vg== Received: by mail-lj1-f182.google.com with SMTP id y19so5619995ljq.7 for ; Fri, 27 Jan 2023 06:00:25 -0800 (PST) X-Gm-Message-State: AFqh2kp8+WkIldrITp7cCL7NgqjcPHGYFMW3IbBYYqi5yfCt3+LGQteG fc/OghwEX8uFw8rIYMrH32sGbbCnEXqBu1D8B/k= X-Google-Smtp-Source: AMrXdXsrpRi1xE2IFWP7gxB9+mpEiTesCS+Cg1/4N8idDaPDMYxGJN1bR9VME8+g4BBlBsPEXqYlD0QZ2xOLoq2zhYU= X-Received: by 2002:a2e:b746:0:b0:285:820a:3173 with SMTP id k6-20020a2eb746000000b00285820a3173mr2249932ljo.186.1674828023369; Fri, 27 Jan 2023 06:00:23 -0800 (PST) MIME-Version: 1.0 References: <20230125092059.497721-1-pierre.gondois@arm.com> In-Reply-To: <20230125092059.497721-1-pierre.gondois@arm.com> From: "Ard Biesheuvel" Date: Fri, 27 Jan 2023 15:00:11 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/1] tools_def: Remove duplicated -Os To: pierre.gondois@arm.com Cc: devel@edk2.groups.io, Bob Feng , Liming Gao , Yuwei Chen , Leif Lindholm , Sami Mujawar , Laszlo Ersek Content-Type: text/plain; charset="UTF-8" On Wed, 25 Jan 2023 at 10:21, wrote: > > From: Pierre Gondois > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2928 > > commit 17bd834eb5fd ("BaseTools: Factorize GCC flags") > makes GCC48_ALL_CC_FLAGS inherit from GCC_ALL_CC_FLAGS. > GCC_ALL_CC_FLAGS contains the '-Os' flag. > The latest flag in a command line overrides the previous > optimization option. This allows more specific build > configuration to override the inherited '-Os' flag. > > If a build configuration includes GCC48_ALL_CC_FLAGS, > hard-coded '-Os' options are not necessary anymore. > Remove them. > > Reported-by: Laszlo Ersek > Signed-off-by: Pierre Gondois Acked-by: Ard Biesheuvel > --- > BaseTools/Conf/tools_def.template | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template > index 380d4587335a..f77e936c0453 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -2024,8 +2024,8 @@ DEFINE GCC5_LOONGARCH64_PP_FLAGS = -mabi=lp64d -march=loongarch64 DEF( > *_GCC48_IA32_OBJCOPY_FLAGS = > *_GCC48_IA32_NASM_FLAGS = -f elf32 > > - DEBUG_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os > -RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable > + DEBUG_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) > +RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Wno-unused-but-set-variable > NOOPT_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -O0 > > ################## > @@ -2052,8 +2052,8 @@ RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but > *_GCC48_X64_OBJCOPY_FLAGS = > *_GCC48_X64_NASM_FLAGS = -f elf64 > > - DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Os > -RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable > + DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) > +RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Wno-unused-but-set-variable > NOOPT_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -O0 > > ################## > @@ -2161,8 +2161,8 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s > *_GCC49_IA32_OBJCOPY_FLAGS = > *_GCC49_IA32_NASM_FLAGS = -f elf32 > > - DEBUG_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os > -RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable > + DEBUG_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) > +RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Wno-unused-but-set-variable -Wno-unused-const-variable > NOOPT_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -O0 > > ################## > @@ -2189,8 +2189,8 @@ RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but > *_GCC49_X64_OBJCOPY_FLAGS = > *_GCC49_X64_NASM_FLAGS = -f elf64 > > - DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Os > -RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable > + DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) > +RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-variable -Wno-unused-const-variable > NOOPT_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -O0 > > ################## > @@ -2304,10 +2304,10 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 > *_GCC5_IA32_OBJCOPY_FLAGS = > *_GCC5_IA32_NASM_FLAGS = -f elf32 > > - DEBUG_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Os > + DEBUG_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto > DEBUG_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 > > -RELEASE_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Os -Wno-unused-but-set-variable -Wno-unused-const-variable > +RELEASE_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Wno-unused-but-set-variable -Wno-unused-const-variable > RELEASE_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 > > NOOPT_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -O0 > @@ -2336,10 +2336,10 @@ RELEASE_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl, > *_GCC5_X64_OBJCOPY_FLAGS = > *_GCC5_X64_NASM_FLAGS = -f elf64 > > - DEBUG_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os > + DEBUG_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO > DEBUG_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os > > -RELEASE_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os -Wno-unused-but-set-variable -Wno-unused-const-variable > +RELEASE_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Wno-unused-but-set-variable -Wno-unused-const-variable > RELEASE_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os > > NOOPT_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -O0 > -- > 2.25.1 >