grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Paul Menzel
Subject: Re: [PATCH 2/2] configure: Check -falign-jumps=1 -falign-functions=1 beside -falign-loops=1
Date: Tue, 24 Aug 2021 08:25:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Dear Fāng-ruì,


Am 24.08.21 um 08:18 schrieb 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 compiled with older Clang, the alignment options are not added, so
just avoid the complexity for each option.

Signed-off-by: Fangrui Song <maskray@google.com>
---
  configure.ac | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9a12151bd..8625e6776 100644
--- a/configure.ac
+++ b/configure.ac
@@ -798,8 +798,9 @@ fi
# Force no alignment to save space on i386.
  if test "x$target_cpu" = xi386; then
-  AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
-    CFLAGS="$TARGET_CFLAGS -falign-loops=1 -Werror"
+  AC_CACHE_CHECK([whether -falign-jumps=1 -falign-loops=1 -falign-functions=1 
works],
+    [grub_cv_cc_falign_loop], [
+    CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1 
-Werror"
      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
          [grub_cv_cc_falign_loop=yes],
        [grub_cv_cc_falign_loop=no])


Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]