Forum | Documentation | Website | Blog

Skip to content
  • Nathan Chancellor's avatar
    scripts/lld-version.sh: Rewrite based on upstream ld-version.sh · df58fb43
    Nathan Chancellor authored
    
    
    This patch is for linux-5.10.y only.
    
    When scripts/lld-version.sh was initially written, it did not account
    for the LLD_VENDOR cmake flag, which changes the output of ld.lld's
    --version flag slightly.
    
    Without LLD_VENDOR:
    
    $ ld.lld --version
    LLD 14.0.0 (compatible with GNU linkers)
    
    With LLD_VENDOR:
    
    $ ld.lld --version
    Debian LLD 14.0.0 (compatible with GNU linkers)
    
    As a result, CONFIG_LLD_VERSION is messed up and configuration values
    that are dependent on it cannot be selected:
    
    scripts/lld-version.sh: 20: printf: LLD: expected numeric value
    scripts/lld-version.sh: 20: printf: LLD: expected numeric value
    scripts/lld-version.sh: 20: printf: LLD: expected numeric value
    init/Kconfig:52:warning: 'LLD_VERSION': number is invalid
    .config:11:warning: symbol value '00000' invalid for LLD_VERSION
    .config:8800:warning: override: CPU_BIG_ENDIAN changes choice state
    
    This was fixed upstream by commit 1f09af06 ("kbuild: Fix
    ld-version.sh script if LLD was built with LLD_VENDOR") in 5.12 but that
    was done to ld-version.sh after it was massively rewritten in
    commit 02aff859 ("kbuild: check the minimum linker version in
    Kconfig").
    
    To avoid bringing in that change plus its prerequisites and fixes, just
    modify lld-version.sh to make it similar to the upstream ld-version.sh,
    which handles ld.lld with or without LLD_VENDOR and ld.bfd without any
    errors.
    
    Signed-off-by: default avatarNathan Chancellor <[email protected]>
    Reviewed-by: default avatarNick Desaulniers <[email protected]>
    Tested-by: default avatarNick Desaulniers <[email protected]>
    Signed-off-by: default avatarGreg Kroah-Hartman <[email protected]>
    df58fb43
Loading