summaryrefslogtreecommitdiffstats
path: root/clang/docs/ReleaseNotes.rst
diff options
context:
space:
mode:
authorSam Elliott <selliott@lowrisc.org>2019-11-15 15:10:02 +0000
committerSam Elliott <selliott@lowrisc.org>2019-11-15 15:10:42 +0000
commite3d5ff5a0b102febcddd9d58f24f18b00d4ecb4e (patch)
tree631047179d3660f0612f9c10806cfad2591408b1 /clang/docs/ReleaseNotes.rst
parentfa3b87fbeb465c7ff9fd3c24b168d534d380af16 (diff)
downloadbcm5719-llvm-e3d5ff5a0b102febcddd9d58f24f18b00d4ecb4e.tar.gz
bcm5719-llvm-e3d5ff5a0b102febcddd9d58f24f18b00d4ecb4e.zip
[RISCV] Match GCC `-march`/`-mabi` driver defaults
Summary: Clang/LLVM is a cross-compiler, and so we don't have to make a choice about `-march`/`-mabi` at build-time, but we may have to compute a default `-march`/`-mabi` when compiling a program. Until now, each place that has needed a default `-march` has calculated one itself. This patch adds a single place where a default `-march` is calculated, in order to avoid calculating different defaults in different places. This patch adds a new function `riscv::getRISCVArch` which encapsulates this logic based on GCC's for computing a default `-march` value when none is provided. This patch also updates the logic in `riscv::getRISCVABI` to match the logic in GCC's build system for computing a default `-mabi`. This patch also updates anywhere that `-march` is used to now use the new function which can compute a default. In particular, we now explicitly pass a `-march` value down to the gnu assembler. GCC has convoluted logic in its build system to choose a default `-march`/`-mabi` based on build options, which would be good to match. This patch is based on the logic in GCC 9.2.0. This commit's logic is different to GCC's only for baremetal targets, where we default to rv32imac/ilp32 or rv64imac/lp64 depending on the target triple. Tests have been updated to match the new logic. Reviewers: asb, luismarques, rogfer01, kito-cheng, khchen Reviewed By: asb, luismarques Subscribers: sameer.abuasal, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69383
Diffstat (limited to 'clang/docs/ReleaseNotes.rst')
-rw-r--r--clang/docs/ReleaseNotes.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 1139116ed10..aa0d88db1c9 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -223,6 +223,15 @@ ABI Changes in Clang
element. Clang now matches the gcc behavior on Linux and NetBSD. You can
switch back to old API behavior with flag: -fclang-abi-compat=9.0.
+- RISC-V now chooses a default ``-march=`` and ``-mabi=`` to match (in almost
+ all cases) the GCC defaults. On baremetal targets, where neither ``-march=``
+ nor ``-mabi=`` are specified, Clang now differs from GCC by defaulting to
+ ``-march=rv32imac -mabi=ilp32`` or ``-march=rv64imac -mabi=lp64`` depending on
+ the architecture in the target triple. These do not always match the defaults
+ in Clang 9. We strongly suggest that you explicitly pass `-march=` and
+ `-mabi=` when compiling for RISC-V, due to how extensible this architecture
+ is.
+
OpenMP Support in Clang
-----------------------
OpenPOWER on IntegriCloud