Commit Graph

84 Commits

Author SHA1 Message Date
demin.han fecdae6f70 Fix --with-tune option
Similiar reason to --with-cmodel.

Signed-off-by: demin.han <demin.han@starfivetech.com>
2025-07-23 14:02:13 +02:00
demin.han 9cfb1a8675 Fix --with-cmodel option
When passed with `--without-cmodel`, cmodel will get value `no` which is
unexpected.

Signed-off-by: demin.han <demin.han@starfivetech.com>
2025-07-23 14:02:13 +02:00
demin.han 43ff3d088e Refactor --with-tune
Signed-off-by: demin.han <demin.han@starfivetech.com>
2025-07-23 14:02:13 +02:00
demin.han 8d4a9a6e80 Fix --disable/enable-xxx actually enable/disable xxx feature
For example, --disable-debug-info enables debug-info, this results in
confusion.

In AC_ARG_ENABLE, the last two parts are action-if-present and
action-if-not-present, but not are action-if-enabled and
action-if-disable.

We can utilize autoconf's default and simplify configure.ac.

Signed-off-by: demin.han <demin.han@starfivetech.com>
2025-07-23 14:02:13 +02:00
demin.han 2037a4c322 Remove unused disable-debug-info var
Signed-off-by: demin.han <demin.han@starfivetech.com>
2025-07-23 14:02:13 +02:00
demin.han da244b7cff Format configure.ac
space and tab mixed in macro.
just use tab.

Signed-off-by: demin.han <demin.han@starfivetech.com>
2025-07-23 14:02:13 +02:00
demin.han 99c9bec115 Add install strip support
Binutils and GCC have an install target 'install-strip' which can strips
debug symbols at install. This can reduce installed size largely.

LLVM has similar install target 'install/strip'.

Thanks for shenki's previous work

Signed-off-by: demin.han <demin.han@starfivetech.com>
2025-07-18 18:34:46 +02:00
TelGome b683d4dec3 Update configure
Since the patch "RISC-V: Add generic tune as default" has been commited into the trunk, the configure should also been updated. Here is the link:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=20f593018519fec1602dc39c08ba2e674a2d8a1c

Signed-off-by: TelGome <93700071+TelGome@users.noreply.github.com>
2025-07-15 09:56:01 +02:00
Jiawei 31bddd821e Using 'gc' replace 'imafdc' in multilib. 2025-01-17 20:00:39 +08:00
Jiawei 8281375ed9 Adjusts default multilib combinations. 2025-01-17 19:29:56 +08:00
Jiawei 2828cb1729 Remove redundant information in configure.ac. 2025-01-16 10:33:40 +01:00
Jiawei 7729e7f6d8 Update configure.ac and sync configure. 2025-01-16 10:33:40 +01:00
Jiawei 7044436bab Set rv64gc as default --with-arch option. 2024-10-25 17:30:58 +08:00
Ariel Xiong a340648ba6 Modify the enabled languages in stage2 builds to the macro @WITH_LANGUAGES@.
Use ./configure --with-languages=c,c++,fortran to adjust the enabled languages. This change only affects the GNU toolchain.
2024-10-10 17:58:09 +02:00
Tommy Murphy 902bd3ac2b Enable RV32 build of Linux/musl toolchain - effectively reverse the restrictions imposed by this commit: 629c67e0a9 2024-10-10 13:32:36 +02:00
Kito Cheng a504f73f40
Merge pull request #1475 from CARV-ICS-FORTH/uclibc
Add uClibc-ng support for NOMMU Linux builds
2024-08-27 14:49:50 +08:00
Kito Cheng 806c8b4ac6 Add --enable-default-pie option
`--enable-default-pie` is used to control the default PIE enablement for Linux
GCC, which is disabled by default.

NOTE: baremetal toolchain isn't affected by this option.
2024-07-17 15:35:36 +02:00
Kito Cheng 6d7b5b720f Fix typo in configure.ac: host_gcc -> host-gcc
I found this issue when I regen the configure script, but seems like configure
is right...
2024-05-16 21:27:08 +02:00
Nick Kossifidis 0a6fcf957c Add uClibc-ng support for NOMMU Linux builds
This adds support for building uClibc-ng toolchain so that we can play with
NOMMU Linux. This is still experimental (ABI is still WiP) but it works for
e.g. building busybox, and since crosstool-ng and others don't have support
for it yet, let's add it here so that people can play with it. I've tested
this on QEMU and real hardware (only busybox), it generates ELF (not FLAT)
binaries, and in order for the FDPIC loader to work, the static-pie loader
(/lib/ld-uClibc.so.0) should also be included in rootfs with busybox compiled
as dynamic/pie binary.

No multilib for now, but we can add it in the future if you think it would
be useful.

Signed-off-by: Nick Kossifidis  <mick@ics.forth.gr>
2024-05-11 21:45:31 +03:00
Christoph Müllner 19464804ad Add support to build a host GCC for building the toolchain
A significant amount of users of this project are using it for toolchain
development. These users need to ensure that their code is warning free
before submitting it upstream. Let's support this use case by adding a
configure flag '--enable-host-gcc', which does exactly that:
* build a host GCC before building other components
* setting PATH such that this new GCC is used to build the cross
  toolchain
* enable -Werror for the GCC build

This patch was tested on a Fedora 39 machine (GCC 13),
with the following modification in a GCC source file:
  #if __GNUC__ == 13
  #error Host compiler in use!
  #endif
This fails when building without the new flag and does not fail
when building with latest upstream/master (GCC 14 prerelease).

The '--enable-werror-always' was tested with a warning that showed
up recently in upstream GCC.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
2024-02-29 08:33:56 +01:00
Kito Cheng ffb5968884
Merge pull request #1293 from riscv-collab/extra-multi-lib-test
Add --with-extra-multilib-test option
2023-09-25 21:12:41 +01:00
Jeremy Bennett f58c21db40 Fix bug in configure.ac and regenerate configure
* configure: Regenerated.
	* configure.ac: Remove redundant AS_HELP_STRING when testing
	enable_debug_info; add comment to use Autoconf 2.69.

Signed-off-by: Jeremy Bennett <jeremy.bennett@embecosm.com>
2023-08-08 17:37:00 +01:00
Kito Cheng 3b13360cef Add --with-extra-multilib-test option
NOTE: This is toolchain developer facing feature.

This allow user to add extra testing multi-lib arch, it's useful when
develop and/or testing new extensions.

Usage:

--with-extra-multilib-test="arch-abi[;arch-abi]"

e.g.

linux enable enabled multilib, so default will build with follwoing
configuration:

lib32/ilp32;@march=rv32imac@mabi=ilp32
lib32/ilp32d;@march=rv32imafdc@mabi=ilp32d
lib64/lp64;@march=rv64imac@mabi=lp64
lib64/lp64d;@march=rv64imafdc@mabi=lp64d

But you want to testing more on vector stuffs like rv32gcv and rv64gcv,
then you can configure with `--with-extra-multilib-test="rv32gcv-ilp32d;rv64gcv;lp64d"`

Then the testing will run rv32imac-ilp32 rv32imafdc-ilp32d
rv64imac-lp64 rv64imafdc-lp64d and rv32gcv-ilp32d;rv64gcv;lp64d!

NOTE: Extra multilib test settings still require existing
multilib has support those extra settings, e.g. you can't add
rv32imafc_zbb-ilp32f on above example since no compatible multilib has
provided.
2023-07-11 22:45:53 +08:00
Alex Chiang bb74af5a87 Enable riscv llvm & qemu build flow
Update readme about llvm & qemu examples

Co-authored-by: Kito Cheng <kito.cheng@sifive.com>
2023-06-01 02:12:22 -07:00
Christoph Müllner ea26fd6cb8 Add support to build LLVM/clang with C and C++ support
We currently have a stale "llvm" branch, that does not build.
However, there is clear demand in the RISC-V toolchain community
for a working LLVM on top of a recent GNU toolchain.
In order to build such a toolchain, quite some LLVM and clang know-how is
required to avoid path issues at LLVM build time or later when using clang.
The main purpose of this commit is to demonstrate a way to combine
the RISC-V GNU toolchain repo with LLVM, with the intent to save
others hours of frustration, debugging time or support time.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
2023-05-17 14:01:44 +08:00
Christoph Müllner b2f50de3b7
gdb: Bump GDB version to 12.1 (#1132)
GDB still defaults to 10.1 from the (already archived)
riscv-binutils-gdb repo. Let's bump the version to 12.1
and use the upstream git repo instead.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
2022-09-29 14:23:41 +08:00
Jiawei a8a98fa6ef Switch gcc to upstream and update binutils commits 2022-08-18 10:31:41 +08:00
Kito Cheng 3a5a9bfec1 Switch binutils to upstream 2.39 branch 2022-08-17 18:25:13 +08:00
Liaoshihua 5a2b88b528 Add option '--with-sim' to set simulator 2022-05-23 10:06:50 +08:00
Palmer Dabbelt 29a0ca8972
Allow users to build QEMU with system-mode emulation
I'm trying to clean up some of my test scripts, and one issue is that
I've got two QEMU builds: one for user-mode emulation and one for
system-mode emulation.  This adds an autoconf flag that allows me to
avoid the duplication.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-05-12 08:37:28 -07:00
Palmer Dabbelt ace389df26
Put the linux-headers bits together
These got split up by my libsanitizer patch.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-05-11 16:17:26 -07:00
Palmer Dabbelt a939758dd0
Add an "--enable-libsanitizer" configure-time argument
This lets users select whether or not to build libsanitizer, which
currently does not support rv32 and thus can't be enabled by default.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-04-21 08:46:30 -07:00
Ken Takusagawa 694b011edf fix spelling 2022-04-20 11:47:26 -04:00
Kito Cheng df6ecbe4dd
Merge pull request #1054 from riscv-collab/with-isa-spec
Add --with-isa-spec option to configure
2022-04-12 08:55:32 +08:00
Kito Cheng 44fedc5e1a Add --with-isa-spec option to configure
Set the default version to 2.2 for now, and once we bump to GCC 12 we
will bump that to 20191213.
2022-04-11 23:07:36 +08:00
Florian Hofhammer 629c67e0a9
Prevent musl riscv32 builds
The upstream musl libc does not support 32bit RISC-V builds.
We therefore only allow building the 64bit version (i.e.,
riscv64-unknown-linux-musl-).

Signed-off-by: Florian Hofhammer <florian.hofhammer@fhofhammer.de>
2022-02-24 14:31:52 +01:00
Florian Hofhammer f2caeb4d5a
Add musl libc submodule
Since musl is already incorporated into the build system (see for
example configure.ac, Makefile.in), this patch adds a submodule for
musl based on the current v1.2.2 release.
The GitHub Actions configurations have also been updated to include
the musl based toolchain.

Signed-off-by: Florian Hofhammer <florian.hofhammer@fhofhammer.de>
2022-02-24 10:07:58 +01:00
Florian Hofhammer 7c07a876c4
Update glibc and newlib paths
Both the glibc and newlib submodules are already pointing to the
upstream repositories where development happens.
Since they are therefore not referring to RISC-V specific forks,
this patch unifies the directory naming by only prepending the
"riscv-" prefix to submodules that point to repositories in the
riscv-collab Github organization.

Signed-off-by: Florian Hofhammer <florian.hofhammer@fhofhammer.de>
2022-02-24 09:48:00 +01:00
Palmer Dabbelt f485974e49
Use "qemu", not "riscv-qemu", as the default QEMU source
The recent addition of an override for the QEMU source directory left
the default pointing to the wrong submodule.

Fixes: b83ee52 ("Allow source-override for QEMU")
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-02-24 08:50:13 +01:00
Christoph Muellner b83ee522a7 Allow source-override for QEMU
This patch introduces a configure-time source-dir override for QEMU
similar to the existing overrides for the other toolchain sources.

Signed-off-by: Christoph Muellner <cmuellner@linux.com>
2022-02-10 17:37:03 +01:00
Kito Cheng 2220a4ca0b Add --with-multilib-generator option 2020-11-06 11:14:12 +08:00
Jim Wilson b468107e70 Correct previous configure fix. Edit configure.ac and regenerate. 2020-02-07 15:01:45 -08:00
Jim Wilson 8b4b8dbb35 Don't enable gcc checking by default.
Also, support all gcc checking options instead of just yes and release.
Also, fix copy-and-paste error in cmodel support refering to gcc checking.
2019-11-05 19:03:47 -08:00
Jim Wilson ddb445a8c8 Add configure options to set target C and C++ compiler flags.
This is a partial fix for pull request #530, allowing people to use
-mno-fdiv for library compiles.
2019-11-01 11:03:16 -07:00
Albert Ou c7158c976d Fix default LINUX_HEADERS_SRCDIR path
The --with-headers argument must point to the `include' subdirectory.
2019-09-29 03:58:11 -07:00
Kito Cheng 44316f6eb1
Merge pull request #513 from riscv/with-src
Add option to specify source tree of each component
2019-09-28 22:53:51 +08:00
Kito Cheng e708c77687 Add option to specify source tree of each component 2019-09-27 11:25:32 +08:00
Albert Ou aa44df5294 Fix awk/sed wrapper paths
These wrappers are still necessary on non-GNU platforms; glibc
makefile rules invoke `sed' directly with GNU extensions.
2019-09-26 19:07:30 -07:00
Jim Wilson 379a9c2078 Add toplevel --with-tune= configure option. 2019-02-15 12:34:00 -08:00
Jim Wilson a4ecf47660 Remove --disable-atomic option, which stopped working about 2 years ago. 2018-10-10 16:14:38 -07:00