[PATCH] configure: Replace -Wl,-r,-d with -Wl,-r and add -fno-common

2022-02-11 Thread Fangrui Song via Grub-devel
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. grub does not do this. See https://github.com/llvm/llvm-project/issues/53660 -d

[PATCH] configure: Replace -Wl,-r,-d with -Wl,-r

2022-02-08 Thread Fangrui Song via Grub-devel
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. grub does not do this. See https://github.com/llvm/llvm-project/issues/53660 -d

[PATCH v3 2/2] configure: Check -falign-jumps=1 beside -falign-loops=1

2021-08-26 Thread Fangrui Song via Grub-devel
Clang does not support -falign-jumps and only recently gained support for -falign-loops. -falign-jumps=1 should be tested beside -fliang-loops=1 to avoid passing unrecognized options to Clang: clang-14: error: optimization flag '-falign-jumps=1' is not supported [-Werror,-Wignored-optimizatio

[PATCH v3 0/2] configure: Remove -malign-* and fix Clang 14 breakage

2021-08-26 Thread Fangrui Song via Grub-devel
Replaces https://lists.gnu.org/archive/html/grub-devel/2021-08/msg00094.html ("[PATCH 0/2] configure: Remove -malign-* and fix Clang 14 breakage") Changes from v2: Split -falign-jumps=1 -falign-loops=1 checks Change a tab to spaces Fangrui Song (2): configure: Remove obsoleted -malign-{jump

[PATCH v3 1/2] configure: Remove obsoleted -malign-{jumps, loops, functions}

2021-08-26 Thread Fangrui Song via Grub-devel
GCC warns `cc1: warning: ‘-malign-loops’ is obsolete, use ‘-falign-loops’`. Clang silently ignores -malign-{jumps,loops,functions}. The preferred -falign-* forms have been supported since GCC 3.2, so just remove -malign-{jumps,loops,functions}. Acked-by: Paul Menzel Reviewed-by: Daniel Kiper Si

Re: [PATCH 2/2] configure: Check -falign-jumps=1 -falign-functions=1 beside -falign-loops=1

2021-08-25 Thread Fangrui Song via Grub-devel
On 2021-08-25, Daniel Kiper wrote: On Mon, Aug 23, 2021 at 11:18:38PM -0700, Fangrui Song wrote: Clang does not support -falign-jumps and only recently gained support for -falign-loops. Test all the alignment options to avoid passing unrecognized options to Clang: clang-14: error: optimizat

[PATCH 2/2] configure: Check -falign-jumps=1 -falign-functions=1 beside -falign-loops=1

2021-08-23 Thread Fangrui Song via Grub-devel
Clang does not support -falign-jumps and only recently gained support for -falign-loops. Test all the alignment options to avoid passing unrecognized options to Clang: clang-14: error: optimization flag '-falign-jumps=1' is not supported [-Werror,-Wignored-optimization-argument] When compile

[PATCH 1/2] configure: Remove obsoleted -malign-{jumps, loops, functions}

2021-08-23 Thread Fangrui Song via Grub-devel
GCC warns `cc1: warning: ‘-malign-loops’ is obsolete, use ‘-falign-loops’`. Clang silently ignores -malign-{jumps,loops,functions}. The preferred -falign-* forms have been supported since GCC 3.2, so just remove -malign-{jumps,loops,functions}. Signed-off-by: Fangrui Song --- configure.ac | 9 -

[PATCH 0/2] configure: Remove -malign-* and fix Clang 14 breakage

2021-08-23 Thread Fangrui Song via Grub-devel
This replaces https://lists.gnu.org/archive/html/grub-devel/2021-08/threads.html ("[PATCH v2] configure: Check -falign-jumps=1 -falign-functions=1 beside -") Fangrui Song (2): configure: Remove obsoleted -malign-{jumps,loops,functions} configure: Check -falign-jumps=1 -falign-functions=1 besid

Re: [PATCH] configure: Check -falign-jumps=1 -falign-functions=1 beside -falign-loops=1

2021-08-23 Thread Fangrui Song via Grub-devel
Hi Paul, Thank you for your suggestions. I just sent v2 https://lists.gnu.org/archive/html/grub-devel/2021-08/msg00091.html with a further cleanup. On 2021-08-24, Paul Menzel wrote: Dear Fangrui, Am 16.08.21 um 21:06 schrieb Fangrui Song via Grub-devel: Clang 14.0.0 has implemented -falign

[PATCH v2] configure: Check -falign-jumps=1 -falign-functions=1 beside -falign-loops=1

2021-08-23 Thread Fangrui Song via Grub-devel
Clang does not support -falign-jumps and only recently gained support for -falign-loops. Test all the alignment options to avoid passing unrecognized options to Clang: clang-14: error: optimization flag '-falign-jumps=1' is not supported [-Werror,-Wignored-optimization-argument] When compile

[PATCH] configure: Check -falign-jumps=1 -falign-functions=1 beside -falign-loops=1

2021-08-16 Thread Fangrui Song via Grub-devel
Clang 14.0.0 has implemented -falign-loops=1 but -falign-jumps=1 is still unsupported. The check should test all flags which may be added into CFLAGS. Signed-off-by: Fangrui Song --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac