Go to file
Romain Naour d479264b34 arch/Config.in.riscv: enable Zicsr and Zifencei standalone extensions with gcc >= 12
Since gcc 12, the default RISC-V ISA spec version was bump to 20191213 [1].

This bump introduces a major compatibility issue: support for the csr read/write
(csrr*/csrw*) instructions and fence.i instruction has been separated
from the "I" extension, becoming two standalone extensions: Zicsr and
Zifencei. gcc now has specific -march suffixes to enable those
extensions (_zicsr and _zifencei). If they are not used and code that
uses these instructions is built, one would get errors such as
unrecognized opcode "csrr" (or "fence.i").

For example, without Zifencei we can't build the opensbi
bootloader[2]:

opensbi-1.0/lib/sbi/sbi_tlb.c: Assembler messages:
opensbi-1.0/lib/sbi/sbi_tlb.c:190: Error: unrecognized opcode `fence.i', extension `zifencei' required

As a workaround, the opensbi build system has been patched [3] to use
-march=rv64imafdc_zicsr_zifencei when needed.  This workaround doesn't
work in Buildroot due to the local patch
0001-Makefile-Don-t-specify-mabi-or-march.patch which removes -march
from CFLAGS.

In the context of Buildroot, we have decided for now to assume that
all RISC-V cores that are Linux capable will implement the Zicsr and
Zifencei extensions: it is in fact the case today ase these extensions
were part of the I extension, that all cores support. OpenSBI and
Linux are making the same assumption (see [5]).

Therefore, when gcc >= 12, the -march value gets appended with
_zicsr_zifencei.

[1] https://gcc.gnu.org/gcc-12/changes.html
[2] https://github.com/riscv-software-src/opensbi/blob/v0.9/lib/sbi/sbi_tlb.c#L173
[3] 5d53b55aa7
[4] https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/aE1ZeHHCYf4
[5] http://lists.busybox.net/pipermail/buildroot/2022-July/646698.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Mark Corbin <mark@dibsco.co.uk>
[Thomas: add comment in .mk file, rework commit log]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-23 17:31:27 +02:00
arch arch/Config.in.riscv: enable Zicsr and Zifencei standalone extensions with gcc >= 12 2022-07-23 17:31:27 +02:00
board board: Add Canaan KD233 board support 2022-07-23 16:38:55 +02:00
boot boot/grub2: update to 2.06 2022-07-23 16:06:41 +02:00
configs board: Add Canaan KD233 board support 2022-07-23 16:38:55 +02:00
docs utils/get-developers: implement a -v action for DEVELOPERS file validation 2022-07-23 16:32:58 +02:00
fs fs/squashfs: fix BR2_TARGET_ROOTFS_SQUASHFS_BS_8K 2022-05-29 22:28:21 +02:00
linux {linux, linux-headers}: bump 4.{9, 14, 19}.x / 5.{4, 10, 15, 17}.x series 2022-07-11 18:38:46 +02:00
package package/python3: use the provided pyc compiler 2022-07-23 17:23:57 +02:00
support package/python3: use the provided pyc compiler 2022-07-23 17:23:57 +02:00
system package/systemd: add setting for systemd default.target 2022-05-02 22:58:44 +02:00
toolchain package/elf2flt: Remove Config.in.host 2022-07-23 16:38:54 +02:00
utils utils/get-developers: add -d option for custom DEVELOPERS file 2022-07-23 16:32:58 +02:00
.clang-format .clang-format: initial import from Linux 5.15.6 2022-01-01 15:01:13 +01:00
.defconfig
.flake8
.gitignore
.gitlab-ci.yml utils/checkpackagelib/lib_sysv: run shellcheck 2022-02-06 18:27:03 +01:00
CHANGES Update for 2022.02.3 2022-06-19 12:53:35 +02:00
Config.in package/elf2flt: Remove Config.in.host 2022-07-23 16:38:54 +02:00
Config.in.legacy package/rtl8723bs: drop package 2022-06-20 21:36:54 +02:00
COPYING
DEVELOPERS DEVELOPERS: add Sen Hastings for systemd and pkg-stats 2022-07-23 17:00:39 +02:00
Makefile Kickoff 2022.08 cycle 2022-06-07 21:06:39 +02:00
Makefile.legacy
README docs: move the IRC channel away from Freenode 2021-05-29 22:16:23 +02:00

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches