[Top][All Lists]

[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: Fangrui Song
Subject: Re: [PATCH 2/2] configure: Check -falign-jumps=1 -falign-functions=1 beside -falign-loops=1
Date: Wed, 25 Aug 2021 09:34:41 -0700

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: optimization flag '-falign-jumps=1' is not supported 

When compiled with older Clang, the alignment options are not added, so
just avoid the complexity for each option.

Signed-off-by: Fangrui Song <>
--- | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ b/
index 9a12151bd..8625e6776 100644
--- a/
+++ b/
@@ -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 
+    [grub_cv_cc_falign_loop], [
+    CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1 

I would prefer if you add a separate check for every -falign-* option.


The attached patch checks both -falign-jumps=1 and -falign-loops=1

Attachment: 0001-configure-Check-falign-jumps-1-beside-falign-loops-1.patch
Description: Text Data

reply via email to

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