]> git.ipfire.org Git - thirdparty/grub.git/commit
configure: Replace -Wl,-r,-d with -Wl,-r and add -fno-common
authorFangrui Song <maskray@google.com>
Fri, 11 Feb 2022 18:13:23 +0000 (10:13 -0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 7 Mar 2022 14:05:22 +0000 (15:05 +0100)
commitb16257b51bc6b58b47b016d3f88f6bd1c6b39dcd
tree37d9f37d1221b03e42cef65be7d6077a9f53b38f
parent5e10be48e5bac5f2e7a20a88a3782d4c37681b3c
configure: Replace -Wl,-r,-d with -Wl,-r and add -fno-common

In GNU ld and ld.lld, -d is used with -r to allocate space to COMMON symbols.
This behavior is presumably to work around legacy projects which inspect
relocatable output by themselves and do not handle COMMON symbols. The GRUB
does not do this.

See https://github.com/llvm/llvm-project/issues/53660
-d is quite useless and ld.lld 15.0.0 will make -d no-op.

COMMON symbols have special symbol resolution semantics which can cause surprise
(see https://maskray.me/blog/2022-02-06-all-about-common-symbols). GCC<10 and
Clang<11 defaulted to -fcommon. Just use -fno-common to avoid COMMON symbols.

Signed-off-by: Fangrui Song <maskray@google.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
acinclude.m4
conf/Makefile.common
configure.ac
grub-core/Makefile.core.def
grub-core/genmod.sh.in