[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: Fri, 11 Mar 2022 15:55:57 +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=FM3xGw8zm03xEVgPT9CjAZ8cHLezv+jMMRWO3OocsiA=; b=H/mf3XVgLk5V2IK8xVWtE6l1szfxGM7mvL9rleR1jMZFMmKnNrPQC7F9KK0TmcnXrGWfv5M8ZI0h2cFxhaJ44AhfknEq4oFD8gDqAgF+Gs3Xn+p0K4Dd6gTCwWpnf01WsZfcIy7nDTJgHOxSJ7wRS5TCuXnH1eGCQTqIArsHebTkYwkebn5gGkOv8VBUwMb8++Ilca3M0k13CbkzeWNsHLwLBnw97lQCszsw7xMePQEHHuRxebwgtvhkA3F2B+b802A9rf8T9IJkZ1vNYdb6u60XEd53WPi0HstuVeKWZnmX1bcdJ1WHRR5S3WHlD7H44lLiTyoIkxS8I83R5QjgSA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CB1Bci/tReIG3N1gOnxtvXQmLKqEKAVpriDOAzAF0IAquQpayAR9SI2SOPbApB/bVUbsVbR127bsTc5YW8MsvgciyrCC/1jJOc5BJQcFXUGhNhvVEPrtKnu/6Dj6uuQgW3QKy4IPDHhOP41J7ch0UsCc114HQCpve2OS6GvUGegFzWpYRF5duaH5uSIcR2xnYpS7PSH+OzGq99UFpTC8M6STcoYgKBwqmN3+6XwPHw/PGMjP5Vpzjn8bkQGQx1dz95V4h1HUd8GA6ohBP3VGCI9NhCqB0p+ixnNYPA8Kw9jRCuo+eTAAw3QwVQjmYw1S34Yb+dwa3ZYrG/g12Cb/Ng==
  • 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: Fri, 11 Mar 2022 14:56:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 ...

Jan




 


Rackspace

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