aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorChristoph Müllner <christoph.muellner@vrull.eu>2022-09-28 00:14:41 +0200
committerKito Cheng <kito.cheng@sifive.com>2023-05-17 14:01:44 +0800
commitea26fd6cb82aaa8e7fc95adc704442dc466dac9e (patch)
treea9edf205efb85f89dbb0509a5ccfa9e3212adf65 /configure
parentee1bb922707b53b479552b4aa8fb009b35ce8d22 (diff)
downloadriscv-gnu-toolchain-ea26fd6cb82aaa8e7fc95adc704442dc466dac9e.zip
riscv-gnu-toolchain-ea26fd6cb82aaa8e7fc95adc704442dc466dac9e.tar.gz
riscv-gnu-toolchain-ea26fd6cb82aaa8e7fc95adc704442dc466dac9e.tar.bz2
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>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure53
1 files changed, 40 insertions, 13 deletions
diff --git a/configure b/configure
index 6b73555..5afcc61 100755
--- a/configure
+++ b/configure
@@ -587,6 +587,7 @@ LIBOBJS
qemu_targets
enable_libsanitizer
with_linux_headers_src
+with_llvm_src
with_pk_src
with_spike_src
with_qemu_src
@@ -596,6 +597,7 @@ with_glibc_src
with_newlib_src
with_binutils_src
with_gcc_src
+enable_llvm
enable_gdb
with_guile
with_system_zlib
@@ -651,7 +653,6 @@ infodir
docdir
oldincludedir
includedir
-runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -690,6 +691,7 @@ with_host
with_system_zlib
with_guile
enable_gdb
+enable_llvm
with_gcc_src
with_binutils_src
with_newlib_src
@@ -699,6 +701,7 @@ with_gdb_src
with_qemu_src
with_spike_src
with_pk_src
+with_llvm_src
with_linux_headers_src
enable_libsanitizer
enable_qemu_system
@@ -749,7 +752,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1002,15 +1004,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
- -runstatedir | --runstatedir | --runstatedi | --runstated \
- | --runstate | --runstat | --runsta | --runst | --runs \
- | --run | --ru | --r)
- ac_prev=runstatedir ;;
- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
- | --run=* | --ru=* | --r=*)
- runstatedir=$ac_optarg ;;
-
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1148,7 +1141,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir runstatedir
+ libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1301,7 +1294,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1339,6 +1331,7 @@ Optional Features:
slow, only enable it when developing gcc
[--disable-gcc-checking]
--disable-gdb Don't build GDB, as it's not upstream
+ --enable-llvm Build LLVM (clang)
--enable-libsanitizer Build libsanitizer, which only supports rv64
--enable-qemu-system Build qemu with system-mode emulation
@@ -1375,6 +1368,7 @@ Optional Packages:
--with-qemu-src Set qemu source path, use builtin source by default
--with-spike-src Set spike source path, use builtin source by default
--with-pk-src Set pk source path, use builtin source by default
+ --with-llvm-src Set llvm source path, use builtin source by default
--with-linux-headers-src
Set linux-headers source path, use builtin source by
default
@@ -3556,6 +3550,20 @@ else
fi
+# Check whether --enable-llvm was given.
+if test "${enable_llvm+set}" = set; then :
+ enableval=$enable_llvm; enable_llvm=yes
+fi
+
+
+if test "x$enable_llvm" != xyes; then :
+ enable_llvm=--disable-llvm
+
+else
+ enable_llvm=--enable-llvm
+
+fi
+
{
@@ -3729,6 +3737,25 @@ else
fi
}
+{
+
+# Check whether --with-llvm-src was given.
+if test "${with_llvm_src+set}" = set; then :
+ withval=$with_llvm_src;
+else
+ with_llvm_src=default
+
+fi
+
+ if test "x$with_llvm_src" != xdefault; then :
+ with_llvm_src=$with_llvm_src
+
+else
+ with_llvm_src="\$(srcdir)/llvm"
+
+fi
+
+ }
# Check whether --with-linux-headers-src was given.