[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] x86: avoid SORT_BY_INIT_PRIORITY with old GNU ld


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 14 Mar 2022 10:38:00 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VG69AyWawrszyq0Ct22IOp+yjoHIItGki86NOBH86TE=; b=OAygGi19ThS1SMXlm6JKZva/Z0BFMuAM0b9vfHGg9WYt8Kr4aLpa8jaNkOFFucj1dld2cowYHr5qBhou1uOz6mH+cA+mEwBpy5MM1REEIazAai4ZbV6i3vv268TGiCuQOVRGBjFhBI04ZTlEE5ZtRH+bhKMeb8kg3A0VbaYnLBdbLuPRoRuDSIEF3VfJjeYLczXENdygUgxJ2XpJG3Jxx5hh60QxG8SfMgnTSf74EdfuYeUCYMmg/FRA4K0IHyi3iJzaUsWZvkC7oUvNh0+70mdPgMwH/POavdkO6LzzcEkl8KpX8AOBKdnVecZU+gvuZYk5pyFnOotfHZhDPi20IA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZzfHCCggBUOCGkZMOkrI5KC5qIwZAF4sPPzObvcv8qnchd1A9oQTc0TiIVziXem4zV11VjTfWQZUxG91189h7GhgIsiUVp1epGi7oU447sscni7WGtCTwYeyBrUSSk8Htxzj3hE1k0c45MxzYxPaOOJU/4ZPPRz6WoQfNkMGneD9lTaW0TEoEXk3UEmAYDyBsNBT4c8e1Z6+CXYOQLezlVgjmeRa7f9hRbuTknoLabRzslpOumaHciYdSytebw1+oNEW7+5B6Mq+OjaM4bxnWzTFXMWgeCpufBj3YrhMHOS8zcPo//2x70t4i3tlyejiJNQUeLPEY9siDauFZqkN1A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 14 Mar 2022 09:38:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.03.2022 10:05, Roger Pau Monné wrote:
> On Mon, Mar 14, 2022 at 08:38:52AM +0100, Jan Beulich wrote:
>> On 11.03.2022 16:07, Roger Pau Monné wrote:
>>> On Fri, Mar 11, 2022 at 03:55:57PM +0100, Jan Beulich wrote:
>>>> On 11.03.2022 15:34, Roger Pau Monné wrote:
>>>>> On Fri, Mar 11, 2022 at 02:28:40PM +0100, Jan Beulich wrote:
>>>>>> Support for this construct was added in 2.22 only. Avoid the need to
>>>>>> introduce logic to probe for linker script capabilities by (ab)using the
>>>>>> probe for a command line option having appeared at about the same time.
>>>>>>
>>>>>> Fixes: 4b7fd8153ddf ("x86: fold sections in final binaries")
>>>>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>>>>> ---
>>>>>> v2: Always define HAVE_LD_SORT_BY_INIT_PRIORITY when using LLVM ld.
>>>>>>
>>>>>> --- a/xen/arch/x86/arch.mk
>>>>>> +++ b/xen/arch/x86/arch.mk
>>>>>> @@ -73,6 +73,16 @@ ifeq ($(CONFIG_UBSAN),y)
>>>>>>  $(call cc-option-add,CFLAGS_UBSAN,CC,-fno-sanitize=alignment)
>>>>>>  endif
>>>>>>  
>>>>>> +ifeq ($(call success,$(LD) --version | head -n 1 | grep -q "GNU ld"),y)
>>>>>
>>>>> You are not going to like this, but I think this should live in
>>>>> xen/Kconfig together with CC_IS_{GCC,CLANG}, ie: LD_IS_GNU or similar.
>>>>>
>>>>> It's possible we will need this in the future in other places, so
>>>>> having it in Kconfig makes sense.
>>>>
>>>> Despite me not liking this (until, as said elsewhere, we've properly
>>>> settled on either approach) I did actually consider doing like you
>>>> suggest. But: I would have to introduce there more than I need here,
>>>> just for consistency's sake, and I wouldn't have a way to test the
>>>> LLD part of it (I did check - none of the distros where I chose to
>>>> install Clang offer the linker). I realize I could ask you to help
>>>> with the testing, but then the first point would remain. I'd prefer
>>>> if for this simple build fix it was okay to go the old fashioned
>>>> route ...
>>>
>>> I would be fine with you just introducing LD_IS_GNU. That's all we
>>> need so far. We can introduce LD_IS_LLVM if/when required. I prefer
>>> that asymmetry rather than doing the detection here.
>>
>> Yet I'm not happy to go this route. I'm only willing to do this
>> consistently, but that in turn not without us having formally sat down
>> and discussed the overall model to use. The only short term alternative
>> I see is to go back to SORT() unilaterally, hoping that for now
>> different priorities won't be encountered.
> 
> Would you be fine if it was a patch of mine that introduces
> LD_IS_{GNU,LLVM} to xen/Kconfig (Acked by someone else) and then you
> use it here?
> 
> I realize this is tricking you, but I would rather get this unblocked
> if possible.

Well, yes, if the construct had been there, I certainly would have used it
(somewhat hesitantly maybe).

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.