Bug 212105
Summary: | Building kernel with a language different from english will fails with LD error on 5.12.x | ||
---|---|---|---|
Product: | Other | Reporter: | Marco Scardovi (scardracs) (mscardovi) |
Component: | Configuration | Assignee: | other_configuration (other_configuration) |
Status: | RESOLVED CODE_FIX | ||
Severity: | blocking | CC: | andy.shevchenko, mscardovi, nicolas.werner |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 5.12.x | Subsystem: | |
Regression: | Yes | Bisected commit-id: |
Description
Marco Scardovi (scardracs)
2021-03-07 14:07:30 UTC
I'm building this on Gentoo. If I set LANG="en_US" then it works without any problem Just to be clear: if x86_64-pc-linux-gnu-ld --version is ld GNU it will works if x86_64-pc-linux-gnu-ld --version is ld di GNU it will not works I'd add to the issue that the issue is caused by (binutils) ld with localization like Italian (the one above is Italian), Finnish and Gaelic which differ from the English "GNU ld" output in `x86_64-pc-linux-gnu-ld --version`. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/ld-version.sh?h=v5.12-rc2#n38 ``` if [ "$1" = GNU -a "$2" = ld ]; then shift $(($# - 1)) version=$1 min_version=$bfd_min_version name=BFD disp_name="GNU ld" elif [ "$1" = GNU -a "$2" = gold ]; then echo "gold linker is not supported as it is not capable of linking the kernel proper." >&2 exit 1 elif [ "$1" = LLD ]; then version=$2 min_version=$lld_min_version name=LLD disp_name=LLD else echo "$orig_args: unknown linker" >&2 exit 1 fi ``` Which leads to this code to fail on output like ``` ld di GNU (Gentoo 2.35.2 p1) 2.35.2 Copyright (C) 2020 Free Software Foundation, Inc. Questo programma è software libero; siete liberi di ridistribuirlo secondo i termini della GNU General Public License versione 3 o (a scelta) una versione più recente. Questo programma non ha assolutamente alcuna garanzia. ``` but not ``` GNU ld (Gentoo 2.35.1 p2) 2.35.1 Copyright (C) 2020 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. ``` This issue didnt come up because the linker checking code was like this: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/scripts/Kconfig.include?h=v5.11.4#n42 ``` # Fail if the linker is gold as it's not capable of linking the kernel proper $(error-if,$(success, $(LD) -v | grep -q gold), gold linker '$(LD)' not supported) ``` The commit that changed the linker checking behavior: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/scripts/ld-version.sh?h=v5.12-rc2&id=02aff85922043cf175ebbe5fc3430acfeaeb8393 Specifically the problem here is that 02aff85922043cf175ebbe5fc3430acfeaeb8393 changed the linker matching logic from checking for not being "gold" to it having to include "GNU ld". This does not work on all locales (most notably Finnish, Gaelic and Italien, I think), so the linker is marked as unsupported. The check should probably set the C locale or don't check for the string "GNU ld" at least. Upstream has been informed: https://lore.kernel.org/lkml/CAHp75Vfn0Ub5Z0PpDiCB0sMPpNCwziqK-TL2RUwRCPc8dczRLw@mail.gmail.com/T/#u (In reply to Andy Shevchenko from comment #6) > https://git.kernel.org/pub/masahiroy/linux-kbuild/c/bcbcf50f5218 This link does not actually works (In reply to Marco Scardovi from comment #7) > (In reply to Andy Shevchenko from comment #6) > > https://git.kernel.org/pub/masahiroy/linux-kbuild/c/bcbcf50f5218 > > This link does not actually works https://git.kernel.org/masahiroy/linux-kbuild/c/bcbcf50f5218 (In reply to Andy Shevchenko from comment #8) > (In reply to Marco Scardovi from comment #7) > > (In reply to Andy Shevchenko from comment #6) > > > https://git.kernel.org/pub/masahiroy/linux-kbuild/c/bcbcf50f5218 > > > > This link does not actually works > > https://git.kernel.org/masahiroy/linux-kbuild/c/bcbcf50f5218 Thanks |