Skip to content

Commit df6ecbe

Browse files
authored
Merge pull request #1054 from riscv-collab/with-isa-spec
Add --with-isa-spec option to configure
2 parents 372e33e + 44fedc5 commit df6ecbe

File tree

4 files changed

+52
-5
lines changed

4 files changed

+52
-5
lines changed

Makefile.in

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ endif
3333
WITH_ARCH ?= @WITH_ARCH@
3434
WITH_ABI ?= @WITH_ABI@
3535
WITH_TUNE ?= @WITH_TUNE@
36+
WITH_ISA_SPEC ?= @WITH_ISA_SPEC@
3637
SYSROOT := $(INSTALL_DIR)/sysroot
3738

3839
SHELL := /bin/sh
@@ -288,7 +289,8 @@ stamps/build-binutils-linux: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamps/check
288289
--disable-gdb \
289290
--disable-sim \
290291
--disable-libdecnumber \
291-
--disable-readline
292+
--disable-readline \
293+
$(WITH_ISA_SPEC)
292294
$(MAKE) -C $(notdir $@)
293295
$(MAKE) -C $(notdir $@) install
294296
mkdir -p $(dir $@) && touch $@
@@ -395,6 +397,7 @@ stamps/build-gcc-linux-stage1: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-binutil
395397
$(WITH_ABI) \
396398
$(WITH_ARCH) \
397399
$(WITH_TUNE) \
400+
$(WITH_ISA_SPEC) \
398401
CFLAGS_FOR_TARGET="-O2 $(CFLAGS_FOR_TARGET)" \
399402
CXXFLAGS_FOR_TARGET="-O2 $(CXXFLAGS_FOR_TARGET)"
400403
$(MAKE) -C $(notdir $@) inhibit-libc=true all-gcc
@@ -432,6 +435,7 @@ stamps/build-gcc-linux-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) $(addprefix stamps/b
432435
$(WITH_ABI) \
433436
$(WITH_ARCH) \
434437
$(WITH_TUNE) \
438+
$(WITH_ISA_SPEC) \
435439
CFLAGS_FOR_TARGET="-O2 $(CFLAGS_FOR_TARGET)" \
436440
CXXFLAGS_FOR_TARGET="-O2 $(CXXFLAGS_FOR_TARGET)"
437441
$(MAKE) -C $(notdir $@)
@@ -455,7 +459,8 @@ stamps/build-binutils-linux-native: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamp
455459
--disable-gdb \
456460
--disable-sim \
457461
--disable-libdecnumber \
458-
--disable-readline
462+
--disable-readline \
463+
$(WITH_ISA_SPEC)
459464
$(MAKE) -C $(notdir $@)
460465
$(MAKE) -C $(notdir $@) install
461466
mkdir -p $(dir $@) && touch $@
@@ -483,7 +488,8 @@ stamps/build-gcc-linux-native: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-gcc-lin
483488
$(MULTILIB_FLAGS) \
484489
$(WITH_ABI) \
485490
$(WITH_ARCH) \
486-
$(WITH_TUNE)
491+
$(WITH_TUNE) \
492+
$(WITH_ISA_SPEC) \
487493
$(MAKE) -C $(notdir $@)
488494
$(MAKE) -C $(notdir $@) install
489495
cp -a $(INSTALL_DIR)/$(LINUX_TUPLE)/lib* $(SYSROOT)
@@ -507,7 +513,8 @@ stamps/build-binutils-newlib: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamps/chec
507513
--disable-gdb \
508514
--disable-sim \
509515
--disable-libdecnumber \
510-
--disable-readline
516+
--disable-readline \
517+
$(WITH_ISA_SPEC)
511518
$(MAKE) -C $(notdir $@)
512519
$(MAKE) -C $(notdir $@) install
513520
mkdir -p $(dir $@) && touch $@
@@ -560,6 +567,7 @@ stamps/build-gcc-newlib-stage1: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-binuti
560567
$(WITH_ABI) \
561568
$(WITH_ARCH) \
562569
$(WITH_TUNE) \
570+
$(WITH_ISA_SPEC) \
563571
CFLAGS_FOR_TARGET="-Os $(CFLAGS_FOR_TARGET)" \
564572
CXXFLAGS_FOR_TARGET="-Os $(CXXFLAGS_FOR_TARGET)"
565573
$(MAKE) -C $(notdir $@) all-gcc
@@ -659,6 +667,7 @@ stamps/build-gcc-newlib-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-newlib
659667
$(WITH_ABI) \
660668
$(WITH_ARCH) \
661669
$(WITH_TUNE) \
670+
$(WITH_ISA_SPEC) \
662671
CFLAGS_FOR_TARGET="-Os $(CFLAGS_FOR_TARGET)" \
663672
CXXFLAGS_FOR_TARGET="-Os $(CXXFLAGS_FOR_TARGET)"
664673
$(MAKE) -C $(notdir $@)
@@ -686,7 +695,8 @@ stamps/build-binutils-musl: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamps/check-
686695
--disable-gdb \
687696
--disable-sim \
688697
--disable-libdecnumber \
689-
--disable-readline
698+
--disable-readline \
699+
$(WITH_ISA_SPEC)
690700
$(MAKE) -C $(notdir $@)
691701
$(MAKE) -C $(notdir $@) install
692702
mkdir -p $(dir $@) && touch $@
@@ -719,6 +729,7 @@ stamps/build-gcc-musl-stage1: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-binutils
719729
$(WITH_ABI) \
720730
$(WITH_ARCH) \
721731
$(WITH_TUNE) \
732+
$(WITH_ISA_SPEC) \
722733
CFLAGS_FOR_TARGET="-O2 $(CFLAGS_FOR_TARGET)" \
723734
CXXFLAGS_FOR_TARGET="-O2 $(CXXFLAGS_FOR_TARGET)"
724735
$(MAKE) -C $(notdir $@) inhibit-libc=true all-gcc
@@ -786,6 +797,7 @@ stamps/build-gcc-musl-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-musl-lin
786797
$(WITH_ABI) \
787798
$(WITH_ARCH) \
788799
$(WITH_TUNE) \
800+
$(WITH_ISA_SPEC) \
789801
CFLAGS_FOR_TARGET="-O2 $(CFLAGS_FOR_TARGET)" \
790802
CXXFLAGS_FOR_TARGET="-O2 $(CXXFLAGS_FOR_TARGET)"
791803
$(MAKE) -C $(notdir $@)

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@ devtoolset-7 works.
137137
There are a number of additional options that may be passed to
138138
configure. See './configure --help' for more details.
139139

140+
#### Set default ISA spec version
141+
142+
`--with-isa-spec=` can specify the default version of the RISC-V Unprivileged
143+
(formerly User-Level) ISA specification.
144+
145+
Possible options are: `2.2`, `20190608` and `20191213`.
146+
147+
The default version is `2.2`.
148+
149+
More details about this option you can refer this post [RISC-V GNU toolchain bumping default ISA spec to 20191213](https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/aE1ZeHHCYf4).
150+
140151
#### Build with customized multi-lib configure.
141152

142153
`--with-multilib-generator=` can specify what multilibs to build. The argument

configure

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ newlib_multilib_names
604604
glibc_multilib_names
605605
multilib_flags
606606
multilib_gen
607+
WITH_ISA_SPEC
607608
WITH_TUNE
608609
WITH_ABI
609610
WITH_ARCH
@@ -671,6 +672,7 @@ enable_linux
671672
with_arch
672673
with_abi
673674
with_tune
675+
with_isa_spec
674676
enable_multilib
675677
with_multilib_generator
676678
enable_gcc_checking
@@ -1333,6 +1335,8 @@ Optional Packages:
13331335
--with-arch=rv64imafdc Sets the base RISC-V ISA, defaults to rv64imafdc
13341336
--with-abi=lp64d Sets the base RISC-V ABI, defaults to lp64d
13351337
--with-tune=rocket Set the base RISC-V CPU, defaults to rocket
1338+
--with-isa-spec=2.2 Set the default ISA spec version, default to 2.2,
1339+
available options: 2.2, 20190608, 20191213
13361340
--with-multilib-generator
13371341
Multi-libs configuration string, only supported for
13381342
bare-metal/elf toolchaih, this option implied
@@ -3301,6 +3305,16 @@ else
33013305
fi
33023306
33033307
3308+
3309+
# Check whether --with-isa-spec was given.
3310+
if test "${with_isa_spec+set}" = set; then :
3311+
withval=$with_isa_spec;
3312+
else
3313+
with_isa_spec=2.2
3314+
3315+
fi
3316+
3317+
33043318
if test "x$with_abi" = xdefault; then :
33053319
case $with_arch in #(
33063320
*rv64g* | *rv64*d*) :
@@ -3329,6 +3343,8 @@ WITH_ABI=--with-abi=$with_abi
33293343
33303344
WITH_TUNE=--with-tune=$with_tune
33313345
3346+
WITH_ISA_SPEC=--with-isa-spec=$with_isa_spec
3347+
33323348
33333349
# Check whether --enable-multilib was given.
33343350
if test "${enable_multilib+set}" = set; then :

configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ AC_ARG_WITH(tune,
7171
[with_tune=rocket]
7272
)
7373

74+
AC_ARG_WITH(isa-spec,
75+
[AS_HELP_STRING([--with-isa-spec=2.2],
76+
[Set the default ISA spec version, default to 2.2, available options: 2.2, 20190608, 20191213])],
77+
[],
78+
[with_isa_spec=2.2]
79+
)
80+
7481
AS_IF([test "x$with_abi" = xdefault],
7582
[AS_CASE([$with_arch],
7683
[*rv64g* | *rv64*d*], [with_abi=lp64d],
@@ -86,6 +93,7 @@ AS_IF([test "x$with_abi" = xdefault],
8693
AC_SUBST(WITH_ARCH, --with-arch=$with_arch)
8794
AC_SUBST(WITH_ABI, --with-abi=$with_abi)
8895
AC_SUBST(WITH_TUNE, --with-tune=$with_tune)
96+
AC_SUBST(WITH_ISA_SPEC, --with-isa-spec=$with_isa_spec)
8997

9098
AC_ARG_ENABLE(multilib,
9199
[AS_HELP_STRING([--enable-multilib],

0 commit comments

Comments
 (0)