Skip to content

Fully support standalone Clang/LLVM toolchains

Jessica Clarke opensbi 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Makefile: Support building with Clang and LLVM binutilsMakefile+47 -123 replies
1/2Makefile: Support building with Clang and LLVM binutils+0 -01 reply
1/2Makefile: Support building with Clang and LLVM binutils+0 -01 reply
1/2Makefile: Support building with Clang and LLVM binutils+0 -00 replies
1/2Makefile: Support building with Clang and LLVM binutils+0 -00 replies
2/2Drop dependency on libgcc by importing part of FreeBSD's libquadMakefile lib/utils/libquad/divdi3.c lib/utils/libquad/include/limits.h +8 more+683 -13 replies
2/2Drop dependency on libgcc by importing part of FreeBSD's libquad+0 -00 replies
2/2Drop dependency on libgcc by importing part of FreeBSD's libquad+0 -00 replies
2/2Drop dependency on libgcc by importing part of FreeBSD's libquad+0 -00 replies

Reviews trailers per patch

4 of 9 patches have a Reviewed-by or Acked-by.

PatchAnup Patel
1/2
1/2
1/2
1/2
1/2
2/2R-b
2/2R-b
2/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] Fully support standalone Clang/LLVM toolchains

This patch series is comprised of two parts.

The first patch adds build system support for using Clang and LLVM binutils, provided your Clang is able to locate a libgcc.a in its search path.

However, pure LLVM toolchains do not use libgcc, they use compiler-rt (libclang_rt.builtins.<arch>.a). We could change the Makefile to not hard-code -lgcc and instead use -print-libgcc-file-name, but that still requires a bare metal compiler-rt built for the right -march/-mabi to be present, which is often not the case. Moreover, we need very little from libgcc/compiler-rt; RV64 needs nothing, and RV32 only needs 64-bit division. Thus, the second patch vendors part of FreeBSD's libquad and stops linking against libgcc entirely, allowing OpenSBI to be built with just a cross-compiler. This means that building with any distro-provided LLVM just works, as does compiling with the system Clang compiler and LLD linker on FreeBSD without any external packages needed (beyond GNU make).

Jessica Clarke (2):
Makefile: Support building with Clang and LLVM binutils Drop dependency on libgcc by importing part of FreeBSD's libquad

 Makefile                              |  59 ++++--
 lib/utils/libquad/divdi3.c            |  64 ++++++
 lib/utils/libquad/include/limits.h    |  12 ++
 lib/utils/libquad/include/sys/cdefs.h |  12 ++
 lib/utils/libquad/include/sys/types.h |  25 +++
 lib/utils/libquad/moddi3.c            |  66 ++++++
 lib/utils/libquad/objects.mk          |  14 ++
 lib/utils/libquad/qdivrem.c           | 278 ++++++++++++++++++++++++++
 lib/utils/libquad/quad.h              | 105 ++++++++++
 lib/utils/libquad/udivdi3.c           |  52 +++++
 lib/utils/libquad/umoddi3.c           |  54 +++++
 11 files changed, 729 insertions(+), 12 deletions(-)
 create mode 100644 lib/utils/libquad/divdi3.c
 create mode 100644 lib/utils/libquad/include/limits.h
 create mode 100644 lib/utils/libquad/include/sys/cdefs.h
 create mode 100644 lib/utils/libquad/include/sys/types.h
 create mode 100644 lib/utils/libquad/moddi3.c
 create mode 100644 lib/utils/libquad/objects.mk
 create mode 100644 lib/utils/libquad/qdivrem.c
 create mode 100644 lib/utils/libquad/quad.h
 create mode 100644 lib/utils/libquad/udivdi3.c
 create mode 100644 lib/utils/libquad/umoddi3.c
Signature · 1 line
2.31.0