[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: Fri, 11 Mar 2022 16:07:47 +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=eD9ALPhI+NUwjBofo27V0gTeE07oK0WA6/Hq2mZEOCM=; b=J8hj1EBh7eVe9PRN7XUAHv216d0HUbh5rrwlhBYawIG2yANykyLF/GIV/EsTUGvrcItj2usbxZaYLFnPEX9ymz9xQmKLW/ol902rRucinZu3LPxO/2m/sIiqb+r5RFyv+aJT+SGouFP85/GeTDG3duX8iAZVrMHQoHOIYU123ZiM7WHfUEDOLOqp16MravTu7QYp9tgWHiByY7oZ9xAh7SdKdF+Zan31l8pl61axS7yvpgCRBI4hncbpfws3yIQTcGD9DFxcvfIlvG4cx4H57QWhi6TIVHeYzzWf0ErA/cS7uTlLwr2akn3bx9Lj/Qo82HfMTnNRxlIdDZhgja8hfg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L5T/kyE0eDLHhnXeZFbQUAhancDx0OGsaxXtgnlwWSH6tKZIsHTYneHwLDGaSV9DDHDPQBGoTEf2deCnJHZop67dBBbXvjktItayXj6HBBDXulfg4sHf+ThrFCuJjUrgHhY8gX1gj7YK6P+KKCt3uHV9/eh9y6ctXtd7fGyBE2f7l5UoA+NsomaRshT4NBqh+bN2t1LbKCd5ZqM/oJvNfXAa+8CEjH29pzqCTfHcSUhBrWWhNDROIcCY1n5QCmh1XSSINqXzM4FzgIo0Czj4WM0uZwD4H8y2ns35T5m/STuV5rRAPHH2tcRJQXyghgvJGOzkm54T2rfXHM6VdqBfgw==
  • Authentication-results: esa2.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: Fri, 11 Mar 2022 15:08:07 +0000
  • Ironport-data: A9a23:wyuqoKMW4icj2MXvrR2zl8FynXyQoLVcMsEvi/4bfWQNrUol1DIOz GIWUWzTbP2CNmDwLdB/b9zkoBsD7MTQm95jHQto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH1dOKJQUBUjclkfJKlYAL/En03FFcMpBsJ00o5wbZi29cw27BVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Zx N99i6GqeT0SGajCqPY4dUlBDwohMvgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALNs7kMZlZonh95TrYEewnUdbIRKCiCdpwgmlo3ZgWQay2i 8wxdCBEdir7cgV0Yg0WB4wR3/+TjFy8WmgNwL6SjfVuuDWCpOBr65DyNPLFd9rMQt9a9m6Iq 2SD82nnDxUyMN2E1SHD4n+qnvXIny7wRMQVDrLQ3vxgjUCXx2cTIAYLTlb9qv684nNSQPoGd RZSoHB36/Fvqgr7FbERQiFUvlaItC4iZsBgKdYd7Q+92I/ysx+FLTcLG2sphMMdiOc6Qjkj1 1msltzvBCByvLD9dU9x5ot4vhvpZ3FLcDZqiTssCFJcvoK9+N1bYgfnE447eJNZmOEZDt0ZL 9qiiCElz4segscQv0lQ1QCW2mn8znQlo+Nc2+k2Yo5Hxl8oDGJGT9bxgbQ+0RqmBN/IJrVml CJY8/VyFMhUUfmweNWlGY3h5o2B6fefKyH7ilVyBZQn/DnF0yf9Id4Bu24hdB8xa5hsldrVj Kn74FI5CHh7ZibCUEOKS9jpV5RCIVbISbwJqcw4nvIRO8MsJWdrDQllZFKK3nCFraTfufpXB HtvSu71VSxyIf0+lFKeHr5BuZd2lnFW7T6CHvjTkkX4uYdykVbIEN/pxnPVNbtnhE5FyS2Im +ti2zyikEwODrehPnGJreb+7zkidBAGOHw/kOQOHsarKQt6AmAxTfjXxLIqYYt+mKpJ0OzP+ xmAtoVwkjITWVWvxd22V01e
  • Ironport-hdrordr: A9a23:qsBPLKPcQ1IvzMBcTjujsMiBIKoaSvp037BK7S1MoNJuEvBw9v re+MjzsCWftN9/Yh4dcLy7VpVoIkmskKKdg7NhXotKNTOO0AeVxelZhrcKqAeQeREWmNQ96U 9hGZIOdeEZDzJB/LrHCN/TKade/DGFmprY+9s31x1WPGZXgzkL1XYDNu6ceHcGIjVuNN4CO7 e3wNFInDakcWR/VLXAOpFUN9Kz3uEijfjdEGY7OyI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

Thanks, Roger.



 


Rackspace

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