aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in17
-rwxr-xr-xconfigure11
-rw-r--r--configure.ac3
3 files changed, 27 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in
index 8d89184..470f306 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -50,14 +50,23 @@ else
project_ver:=@PACKAGE_VERSION@
endif
-# If --with-arch is not specified, it defaults to whatever the compiler's
-# default is. The -with-abi is not necessary for this project. Unconditionally
-# compile it with a no-float ABI. i.e., ilp32 for 32-bit and lp64 for 64-bit.
+# The user may specify the host ISA (--with-arch) or host ABI (--with-abi).
+# *** If neither are given, they use the compiler's defaults.
+# *** If --with-arch is given but --with-abi is not, then the ABI defaults to
+# ilp32 or lp64, as appropriate for the ISA.
+# *** If --with-abi is given but --with-arch is not, then the ISA uses the
+# compiler's default.
ifneq (@WITH_ARCH@,)
march := -march=@WITH_ARCH@
is_32bit := $(findstring 32,$(march))
- mabi := -mabi=$(if $(is_32bit),ilp32,lp64)
+ ifeq (@WITH_ABI@,)
+ mabi := -mabi=$(if $(is_32bit),ilp32,lp64)
+ endif
+endif
+
+ifneq (@WITH_ABI@,)
+ mabi := -mabi=@WITH_ABI@
endif
# Installation directories
diff --git a/configure b/configure
index b81acb5..587f1f6 100755
--- a/configure
+++ b/configure
@@ -594,6 +594,7 @@ BBL_LOGO_FILE
BBL_PAYLOAD
BBL_ENABLE_LOGO
MEM_START
+WITH_ABI
WITH_ARCH
RISCV
EGREP
@@ -671,6 +672,7 @@ ac_user_opts='
enable_option_checking
enable_stow
with_arch
+with_abi
enable_print_device_tree
with_mem_start
enable_optional_subprojects
@@ -1323,6 +1325,7 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-arch Set the RISC-V architecture
+ --with-abi Set the RISC-V ABI
--with-mem-start Set physical memory start address
--with-payload Set ELF payload for bbl
--with-logo Specify a better logo
@@ -4073,6 +4076,14 @@ if test "${with_arch+set}" = set; then :
fi
+
+# Check whether --with-abi was given.
+if test "${with_abi+set}" = set; then :
+ withval=$with_abi; WITH_ABI=$with_abi
+
+fi
+
+
# Check whether --enable-print-device-tree was given.
if test "${enable_print_device_tree+set}" = set; then :
enableval=$enable_print_device_tree;
diff --git a/configure.ac b/configure.ac
index 033c7f9..1653f2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,9 @@ AC_ARG_VAR(RISCV, [top-level RISC-V install directory])
AC_ARG_WITH([arch], AS_HELP_STRING([--with-arch], [Set the RISC-V architecture]),
[AC_SUBST([WITH_ARCH], $with_arch, [Specify architecture to build the project])])
+AC_ARG_WITH([abi], AS_HELP_STRING([--with-abi], [Set the RISC-V ABI]),
+ [AC_SUBST([WITH_ABI], $with_abi, [Specify ABI to build the project])])
+
AC_ARG_ENABLE([print-device-tree], AS_HELP_STRING([--enable-print-device-tree], [Print DTS when booting]))
AS_IF([test "x$enable_print_device_tree" = "xyes"], [
AC_DEFINE([PK_PRINT_DEVICE_TREE],,[Define if the DTS is to be displayed])