All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kiper <daniel.kiper@oracle.com>
To: Fangrui Song <maskray@google.com>
Cc: grub-devel@gnu.org,
	Alex Burmashev <alexander.burmashev@oracle.com>,
	Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Subject: Re: [PATCH 2/2] configure: Check -falign-jumps=1 -falign-functions=1 beside -falign-loops=1
Date: Wed, 25 Aug 2021 15:24:08 +0200	[thread overview]
Message-ID: <20210825132408.owyrc2gm72zgg5s6@tomti.i.net-space.pl> (raw)
In-Reply-To: <20210824061838.3569412-3-maskray@google.com>

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 [-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"

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

Daniel


  parent reply	other threads:[~2021-08-25 13:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24  6:18 [PATCH 0/2] configure: Remove -malign-* and fix Clang 14 breakage Fangrui Song
2021-08-24  6:18 ` [PATCH 1/2] configure: Remove obsoleted -malign-{jumps, loops, functions} Fangrui Song
2021-08-24  6:24   ` Paul Menzel
2021-08-25 13:19     ` Daniel Kiper
2021-08-24  6:18 ` [PATCH 2/2] configure: Check -falign-jumps=1 -falign-functions=1 beside -falign-loops=1 Fangrui Song
2021-08-24  6:25   ` Paul Menzel
2021-08-25 13:24   ` Daniel Kiper [this message]
2021-08-25 16:34     ` Fangrui Song
2021-08-26 14:13       ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210825132408.owyrc2gm72zgg5s6@tomti.i.net-space.pl \
    --to=daniel.kiper@oracle.com \
    --cc=alexander.burmashev@oracle.com \
    --cc=grub-devel@gnu.org \
    --cc=maskray@google.com \
    --cc=phcoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.