[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 14 Mar 2022 10:05:27 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=o/K3+KEk8psRZATLFl+Eews4VxIIWVr363BhTaQLETI=; b=YwZEBzLeiwJnzgMwWJdtchAQI2HI6/PzWtDTLqJDKK4R7R2KwPPcuj+bGJtMbDbIpamrS0Yjj26u2Sf8bgkU0snzVbekPp4/07v/wNin+WAhC0eNjwPIfdi/G/L9sNPNgyLtwmTT8gtmbYsBQ9RQ/6zKaeXnWK7DWbjY60yikQP7VK+sBJTM752W2LF8VMqUxB2OeQvkhNn4l9O5TGS0zshhmtn2+bST/hlZQ/EOcXQuFADQodVIkED7mz1BbLYKceptAYM8fX/VHvqt8+li42cwV5gyJRIH7PXVJag5o3WvOB+YLXrnucEwk/XaNb6zmN3VY4f7WdtZxYXyvUiRXg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a1bVnN9sI5r3xddNXZ0v8fWj24Lcb8W7Fi4kqkBzuyA2KX0yAMNADbSkKjgFRwTnIu8DoZMeNRKyxii4oPpdApIsiOIczJcASLswrQTL3vX6BVH2MT/NDaqIHtkHlkAlDKopI9ufDU3PDctpeZS/v/X6zUe2YU7PlwHOKI2pv/aprckMTUvM1K6hcUsVZ+GmetMATjm7Qh18hgVGOZ+HKkFZ1AQvxB0SLIQQfmrS+zcLk9+ICdu3Mll3Bf5I/eTbJwORyTp2R5dAYUbC8+v+4sK5tY/ay+5Zj6fTrDS5I9N5tF4c6WR6qeaupXlFxxqiuYhMt87Z7lXeFN441g74bA==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 14 Mar 2022 09:05:43 +0000
  • Ironport-data: A9a23:ohbssK79ImKvACswGUMDpQxRtDvHchMFZxGqfqrLsTDasY5as4F+v mEZXjvTOfaLa2rwftt0PI6+8hlV7cCBzdVjGwdqqy9gHi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuVGuG96yE6j8lkf5KkYAL+EnkZqTRMFWFw0XqPp8Zj2tQy2YPgX1vU0 T/Pi5a31GGNimYc3l08s8pvmDs31BglkGpF1rCWTakjUG72zxH5PrpGTU2CByKQrr1vNvy7X 47+IISRpQs1yfuP5uSNyd4XemVSKlLb0JPnZnB+A8BOiTAazsA+PzpS2FPxpi67hh3Q9+2dx umhurSVWCE0A7XDmdgGcDkCEQR/BvZ24JD+dC3XXcy7lyUqclPpyvRqSko3IZcZ6qB8BmQmG f4wcW5XKErZ3qTvnez9GrIEascLdaEHOKsFvX5t13fBBOsOSpHfWaTao9Rf2V/cg+gQQ6uDO 5tGMVKDajziPidfHWodFK40leX1iECvSy1nk2288P9fD2/7k1UqjemF3MDuUsOObdVYmACfv G2u13T0BFQWOcKSzRKB82mwnanfkCXjQoUQGbaksPlwjzW7xGYeFRkXXluTuuSihwi1XNc3F qAP0nNw9+5orhXtF4SjGU3jyJKZgvICc/9BNfAH8A6M9rH3w1ybI2k/FQ5ZR+Vz4afaWgcW/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  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

While I can agree to test for features in Makefiles closer to the
place where they are used, I don't like doing the version checks in
Makefiles, much less arch-specific ones.

Thanks, Roger.



 


Rackspace

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