From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (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 03AC920D80BF7 for ; Mon, 3 Apr 2017 09:21:56 -0700 (PDT) Received: by mail-io0-x22c.google.com with SMTP id b140so79050380iof.1 for ; Mon, 03 Apr 2017 09:21:55 -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=tJj7luENmfaWS4Qeo3/oP7ApGvhx/f02+bJj16cULjg=; b=gxLorZGYbr98ij3kdArfmF/duQQeGMjP71bQSBwq6E/36h4WU3YgqAeuroVuED0kfj JZS4rUvvk7ujTO0mQCa/ErYgirxIlh3dKKwratj+bNu+LYJ+hmgsM8UkeYJOdl3WkQ02 IP/GQNZoTgHGMK4RKeEU1i9PCgjswl/1nxPPQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tJj7luENmfaWS4Qeo3/oP7ApGvhx/f02+bJj16cULjg=; b=N3Fsux4WcyVv1JO7kZxqCjwmCGO0U6dkkPu2LIDQtnvzfH+D3K/0fTZvyg8j0mOPcV 6V1MUxhzR51+7588uQxMwC6AvVDYMJKR0Y9va1TxQp40esq6TjL8C3lcwjD9epHKUjvK mfB4CkCj4kTWGPraHMosqyvs3+mr9cfnYifanFSuk4bWUVXeeUIO9NJIAqlqgPVkJEwL eT7PamdpCp9qbD3dHwpFETG3YIeW5623bf/bpBuJOlu6yMdNfyIxy5mC8xM2zDQgnKDO NtK1fVYh0bhdZi563J4p27evrOAeDXQFN0+khElgFghfZwAJP0bW940E/uCi0zPDTX7r dv4w== X-Gm-Message-State: AFeK/H3+pG4iAWN4fgi3D96b4uamBPUKi/FFMa6awG3Cfnd91fZFrnrYtBN7FI0cBvNxjd6mJrMckXUTSWNEkgCV X-Received: by 10.107.141.134 with SMTP id p128mr15712860iod.83.1491236515101; Mon, 03 Apr 2017 09:21:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.10.27 with HTTP; Mon, 3 Apr 2017 09:21:54 -0700 (PDT) In-Reply-To: <1eca3726-e92f-7fbb-d61f-f8026c0b4762@redhat.com> References: <559D2DF22BC9A3468B4FA1AA547F0EF102551554@shsmsx102.ccr.corp.intel.com> <1eca3726-e92f-7fbb-d61f-f8026c0b4762@redhat.com> From: Ard Biesheuvel Date: Mon, 3 Apr 2017 17:21:54 +0100 Message-ID: To: Laszlo Ersek Cc: "Song, BinX" , "edk2-devel@lists.01.org" , "Gao, Liming" Subject: Re: [PATCH] MdeModulePkg: Fix GCC48/GCC49 build error X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2017 16:21:56 -0000 Content-Type: text/plain; charset=UTF-8 On 3 April 2017 at 17:16, Laszlo Ersek wrote: > adding Ard > > On 04/01/17 10:38, Song, BinX wrote: >> - Fix GCC48/GCC49 build error >> >> Cc: Liming Gao >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Bell Song >> --- >> .../Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf >> index 578f97f..4c9aff5 100644 >> --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf >> +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf >> @@ -54,3 +54,6 @@ >> DebugLib >> BaseMemoryLib >> ExtractGuidedSectionLib >> + >> +[BuildOptions] >> + GCC:*_*_*_CC_FLAGS = -fno-builtin >> > > In "BaseTools/Conf/tools_def.template", we currently have: > > DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) [...] -fno-builtin [...] > DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) [...] -fno-builtin [...] > > DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -fno-builtin > DEFINE GCC5_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -fno-builtin > > Now, GCC5_IA32_CC_FLAGS goes back to GCC44_ALL_CC_FLAGS, via: > - GCC49_IA32_CC_FLAGS > - GCC48_IA32_CC_FLAGS > - GCC47_IA32_CC_FLAGS > - GCC46_IA32_CC_FLAGS > - GCC45_IA32_CC_FLAGS > - GCC44_IA32_CC_FLAGS > - GCC44_ALL_CC_FLAGS > > (similarly for GCC5_X64_CC_FLAGS.) > > So, instead of this patch for BrotliCustomDecompressLib, how about: > > - moving "-fno-builtin" from > GCC_ARM_CC_FLAGS and > GCC_AARCH64_CC_FLAGS > to > GCC_ALL_CC_FLAGS, and > > - moving "-fno-builtin" from > GCC5_IA32_CC_FLAGS and > GCC5_X64_CC_FLAGS > to > GCC44_ALL_CC_FLAGS? > > Do we have any reason for permitting builtins at all? > Well, one thing I noticed the other day is that GCC does not 'recognize' memcpy() and memset() when -fno-builtin is defined, which means trivial memcpys and memsets will not be inlined. I guess that argues for not permitting it at all, but it also means adding it unconditionally may affect how code is currently generated for some platforms.