From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.12156.1590151362101824387 for ; Fri, 22 May 2020 05:42:42 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BA13E55D; Fri, 22 May 2020 05:42:41 -0700 (PDT) Received: from [192.168.1.81] (unknown [10.37.8.250]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D836E3F68F; Fri, 22 May 2020 05:42:38 -0700 (PDT) Subject: Re: [PATCH] MdePkg/Include: AARCH64: disable outline atomics on GCC 10.2+ To: Leif Lindholm Cc: devel@edk2.groups.io, liming.gao@intel.com, lersek@redhat.com, philmd@redhat.com, mliska@suse.cz References: <20200522101202.15016-1-ard.biesheuvel@arm.com> <20200522114101.GA1923@vanye> <628c2f09-207c-3146-df98-30ee2426899b@arm.com> <20200522121413.GC1923@vanye> From: "Ard Biesheuvel" Message-ID: Date: Fri, 22 May 2020 14:42:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200522121413.GC1923@vanye> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 5/22/20 2:14 PM, Leif Lindholm wrote: > On Fri, May 22, 2020 at 14:05:02 +0200, Ard Biesheuvel wrote: >> On 5/22/20 1:41 PM, Leif Lindholm wrote: >>> On Fri, May 22, 2020 at 12:12:02 +0200, Ard Biesheuvel wrote: >>>> GCC 10 enabled a feature by default that was introduced in GCC 9, >>>> which results in atomic operations to be emitted as function calls >>>> to intrinsics provided by a runtime library. >>>> >>>> Atomics are hardly used in EDK2, which runs on a single CPU anyway, >>>> and any benefit that would result from reusing library code that >>>> implements these operations is defeated by the fact that every EDK2 >>>> module will need to have its own copy anyway. >>>> >>>> So let's disable this feature on GCC versions that support the >>>> pragma to do so (GCC 10.2 and up) >>>> >>>> Link: https://bugzilla.tianocore.org/show_bug.cgi?id=2723 >>>> Signed-off-by: Ard Biesheuvel >>>> >>>> --- >>>> The GCC support for this pragma has already been pulled into the 10.2 >>>> release branch. I think we should consider adding this to the stable >>>> tag, so that the issue can easily be resolved by upgrading the compiler. >>>> Whether we add the intrinsics too is a separate matter, but we can >>>> revisit that later. >>> >>> Hmm. I am just slightly concerned over referencing GCC 10.2 before GCC >>> 10.2 is released. >>> Presumably, there will be no ill effects if that pragma is enabled also >>> on 10.2, we just won't need it? If so ... >>> >> >> No the pragma is only enabled on 10.2 and later. Older GCCs will choke on >> it. > > Urgh, right. I guess I'm having a "can't read" day. > > Still. That means that if the pragma gets pulled last second from > 10.2, we now explicitly break builds for 10.2. > No matter how low the risk of that happening, this doesn't make me > comfortable. > Indeed. So assuming that we won't take the atomics patch for the stable tag, we already know it will be broken for all GCC 10 and up.