All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darren Kenny <darren.kenny@oracle.com>
To: grub-devel@gnu.org
Cc: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>,
	Robbie Harwood <rharwood@redhat.com>,
	Glenn Washburn <development@efficientek.com>,
	daniel.kiper@oracle.com, darren.kenny@oracle.com
Subject: [PATCH v2 0/3] Fix building with clang
Date: Fri, 21 Oct 2022 13:32:58 +0000	[thread overview]
Message-ID: <cover.1666358457.git.darren.kenny@oracle.com> (raw)

The abiltiy to build with clang was broken in the last release after the
upgrade of gnulib, but it would also appear to have been broken too with
versions of clang prior to 8.0.0.

There were two main issues:

- The use of __builtin_trap in the abort() macro.

  This builtin doesn't exist for clang builds

  After some discussion between Daniel and Vladimir, it was requested that I
  should revert some past changes in this area, and re-introduce the use of
  grub_abort().

- The is some use of variable length arrays (vla) in gnulib's code, and when
  an attempt was made to resolve this in gnulib itself, I was informed that we
  shouldn't be building gnulib with -Werror.

  Rather than totally disabling -Werror, it seemed better to just limit it for
  the specific case that is causing problems, i.e. vla.

- Attempts to build clang with versions prior to 8.0.0 are also failing due to
  the use of the previously introduced safematch function usage. So we're also
  bumping the minimum version of clang in the INSTALL file and safemath.h
  where the test is done for the requisite version.

Thanks,

Darren.

v1 -> v2
--------
- Update with changes to INSTALL and safemath.h after testing various clang
  versions from 3.8 and up.

Darren Kenny (3):
  gnulib: Provide abort() implementation for gnulib
  configure: Fix building with clang
  build: Update to reflect minimum clang version 8.0

 INSTALL                           |  2 +-
 config.h.in                       | 10 ----------
 configure.ac                      |  4 ++++
 grub-core/kern/compiler-rt.c      |  9 ---------
 grub-core/kern/misc.c             |  2 +-
 grub-core/lib/posix_wrap/stdlib.h |  6 ++++++
 include/grub/misc.h               |  5 +----
 include/grub/safemath.h           |  6 +++---
 8 files changed, 16 insertions(+), 28 deletions(-)

-- 
2.31.1



             reply	other threads:[~2022-10-21 13:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 13:32 Darren Kenny [this message]
2022-10-21 13:32 ` [PATCH v2 1/3] gnulib: Provide abort() implementation for gnulib Darren Kenny
2022-10-21 13:33 ` [PATCH v2 2/3] configure: Fix building with clang Darren Kenny
2022-10-21 13:33 ` [PATCH v2 3/3] build: Update to reflect minimum clang version 8.0 Darren Kenny
2022-10-21 13:53 ` [PATCH v2 0/3] Fix building with clang 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=cover.1666358457.git.darren.kenny@oracle.com \
    --to=darren.kenny@oracle.com \
    --cc=daniel.kiper@oracle.com \
    --cc=development@efficientek.com \
    --cc=grub-devel@gnu.org \
    --cc=phcoder@gmail.com \
    --cc=rharwood@redhat.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.