mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 16:49:23 +00:00
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>
This commit is contained in:
1 parent
5e10be48e5
commit
b16257b51b
5 files changed
+17
-17
No files matched your search
+3
-3
@@ -85,9 +85,9 @@ fi
|
||||
|
||||
# Enable support for "restrict" keyword and other
|
||||
# features from gnu99 C language standard.
|
||||
BUILD_CFLAGS="-std=gnu99 $BUILD_CFLAGS"
|
||||
HOST_CFLAGS="-std=gnu99 $HOST_CFLAGS"
|
||||
TARGET_CFLAGS="-std=gnu99 $TARGET_CFLAGS"
|
||||
BUILD_CFLAGS="-std=gnu99 -fno-common $BUILD_CFLAGS"
|
||||
HOST_CFLAGS="-std=gnu99 -fno-common $HOST_CFLAGS"
|
||||
TARGET_CFLAGS="-std=gnu99 -fno-common $TARGET_CFLAGS"
|
||||
|
||||
# Default HOST_CPPFLAGS
|
||||
HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W"
|
||||
|
||||
Reference in new issue
Block a user