grub-devel
[Top][All Lists]
Advanced

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

[PATCH v2 0/3] Fix building with clang


From: Darren Kenny
Subject: [PATCH v2 0/3] Fix building with clang
Date: Fri, 21 Oct 2022 13:32:58 +0000

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 via email to

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