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

Re: [PATCH] x86: conditionalize workaround for build issue with GNU ld 2.37

  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Sep 2021 16:05:15 +0200
  • 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; bh=NqcZ/JCvhiTM7eTgRBPnzioJbrgL+70KR0DQ93eXPLc=; b=nTQvQkDCT6BLQ1QZLsWu01fdqg1ycmI9vaCKIWvkS/WhRAGqCLJCb+5FubZi9sy45oGJ1a20+ORFEB8meFvYrGxmqsvO54HyLRZMchJIoYUlTVXbo5oXny8lDd4Wg+VgZJMU2Ax/52lqX0xxrsJHc6WpLExTMSmJcPZHE6DhGZYKl0pXIQUL7idC5WFnHVzWDJY+lRYpUD0HoicvPaD9MPEz5mk06OvOjGxuA3du5/FWC3xDsd4YUIDMVgE/EDZ67l010bTO8E4f+KBMFmNw/fPeSHK4BsHjkYaa2uDORcCzrWZqXHt7revLUPb7rETn/1v5UHEoOb/WNQxmZiII8g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TugzH6qATNlpLlNU4WLuiHgTup/rxjpFpdxlO857h+z/L/eLn7JIzrCWWI/FfJndNoeim90X1mHF5iHvmRmVd6Mw+axlW0aQ6aQDH3LPTQDFlSAEFAwiuBn7EsFi5TSAHs9tTPdSC2kOQ8IV5Mx3AMpuoyFQXRy8hfLw/wwzDmone1sMVehZrk8GzkbtHQSiQHX30qVHUz/TqJl1t+BKFERp9GJR6M1U5HSpWEZYH6j8nsEIuXceSqnbnfCN2xVbTgd+o54vZH5PT5V32O9kQC01eByQoXE6g9FtmKIteQT0bVB0x5nWqitkqW3NyTPPkBTnnK68c2jE61i+pOEECw==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; 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, 13 Sep 2021 14:05:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.09.2021 15:37, Roger Pau Monné wrote:
> On Thu, Sep 09, 2021 at 04:35:49PM +0200, Jan Beulich wrote:
>> I haven't been able to find an environment where I could actually try
>> with lld (ld.lld); all testing was with GNU ld (ld.bfd).
> Thanks for fixing this. I've been able to test with LLVM ld and the
> workaround is fine.

Oh, good, thanks for trying this out.

>> --- a/xen/arch/x86/Makefile
>> +++ b/xen/arch/x86/Makefile
>> @@ -92,10 +92,16 @@ efi-$(CONFIG_PV_SHIM_EXCLUSIVE) :=
>>  ifneq ($(build_id_linker),)
>>  notes_phdrs = --notes
>> +# Determine whether to engage a workaround for GNU ld 2.37.
>> +build-id-ld-good = $(shell echo 'void test(void) {}' \
>> +                           | $(CC) $(XEN_CFLAGS) -o .check.o -c -x c - 
>> 2>.check.err \
>> +                           && $(LD) -T check.lds -o .check.elf .check.o 
>> 2>>.check.err \
>> +                           && echo y)
> Do we want to make this a Kconfig option (ie: LD_UNQUOTED_DASH) and
> then use is here?
> We already have compiler and assembler checks in x86/Kconfig, so it
> would seem more natural to place it there.

The question of whether to record tool chain capabilities in .config
is still pending. I'm not convinced this is a good idea, Andrew keeps
shouting me out for that, and an actual discussion doesn't really
happen. Yet unlike back at the time when I first raised my concern,
Anthony meanwhile supports me in at least the question (to Andrew) of
when such a discussion would have happened: Neither of us is aware,
yet Andrew claims it did happen, but so far didn't point out where
one could read about what was discussed and decided there.

For the few uses we've accumulated I gave (if at all) an ack for
things happening under some sort of pressure, with the request that
aformentioned discussion would happen subsequently (and, depending on
outcome, these would be converted to another approach if need be). I
have meanwhile realized that it was a mistake to allow such things in
on this basis - the more of them we gain, the more I'm hearing "we've
already got some".

>>  else
>>  ifeq ($(CONFIG_PVH_GUEST),y)
>>  notes_phdrs = --notes
>>  endif
>> +build-id-ld-good := y
>>  endif
> I also wonder whether we need to make the quoting tied to the usage of
> build-id. I guess we don't add sections with dashes and instead
> use underscores, but it might be prudent to always quote to be on the
> safe side if dashes are not supported.

If quoting was uniformly supported, I might have considered that. But
it not being uniformly supported is the reason for this change in the
first place. Hence I'd prefer to generalize this only if really needed.

>> --- /dev/null
>> +++ b/xen/arch/x86/check.lds
> I would maybe name this check-dash.lds, in case we need to add more ld
> build tests.

I sincerely hope it was a one-off that a binutils release got cut with
this sort of a supposedly prominent bug. Considering that the dash is
merely what we're after in this specific case, but breakage was wider
(presumably about any printable char that's not alnum or underscore),
I'd consider check-dash too specific a name. You only say "maybe"; if
you were sufficiently convinced, this is an adjustment I'd be willing
to make. Yet even better would be if I / we could just be done with




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