Skip to content

Commit 44fedc5

Browse files
committed
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.
1 parent cc1075c commit 44fedc5

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
@@ -282,7 +283,8 @@ stamps/build-binutils-linux: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamps/check
282283
--disable-gdb \
283284
--disable-sim \
284285
--disable-libdecnumber \
285-
--disable-readline
286+
--disable-readline \
287+
$(WITH_ISA_SPEC)
286288
$(MAKE) -C $(notdir $@)
287289
$(MAKE) -C $(notdir $@) install
288290
mkdir -p $(dir $@) && touch $@
@@ -389,6 +391,7 @@ stamps/build-gcc-linux-stage1: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-binutil
389391
$(WITH_ABI) \
390392
$(WITH_ARCH) \
391393
$(WITH_TUNE) \
394+
$(WITH_ISA_SPEC) \
392395
CFLAGS_FOR_TARGET="-O2 $(CFLAGS_FOR_TARGET)" \
393396
CXXFLAGS_FOR_TARGET="-O2 $(CXXFLAGS_FOR_TARGET)"
394397
$(MAKE) -C $(notdir $@) inhibit-libc=true all-gcc
@@ -426,6 +429,7 @@ stamps/build-gcc-linux-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) $(addprefix stamps/b
426429
$(WITH_ABI) \
427430
$(WITH_ARCH) \
428431
$(WITH_TUNE) \
432+
$(WITH_ISA_SPEC) \
429433
CFLAGS_FOR_TARGET="-O2 $(CFLAGS_FOR_TARGET)" \
430434
CXXFLAGS_FOR_TARGET="-O2 $(CXXFLAGS_FOR_TARGET)"
431435
$(MAKE) -C $(notdir $@)
@@ -449,7 +453,8 @@ stamps/build-binutils-linux-native: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamp
449453
--disable-gdb \
450454
--disable-sim \
451455
--disable-libdecnumber \
452-
--disable-readline
456+
--disable-readline \
457+
$(WITH_ISA_SPEC)
453458
$(MAKE) -C $(notdir $@)
454459
$(MAKE) -C $(notdir $@) install
455460
mkdir -p $(dir $@) && touch $@
@@ -477,7 +482,8 @@ stamps/build-gcc-linux-native: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-gcc-lin
477482
$(MULTILIB_FLAGS) \
478483
$(WITH_ABI) \
479484
$(WITH_ARCH) \
480-
$(WITH_TUNE)
485+
$(WITH_TUNE) \
486+
$(WITH_ISA_SPEC) \
481487
$(MAKE) -C $(notdir $@)
482488
$(MAKE) -C $(notdir $@) install
483489
cp -a $(INSTALL_DIR)/$(LINUX_TUPLE)/lib* $(SYSROOT)
@@ -501,7 +507,8 @@ stamps/build-binutils-newlib: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamps/chec
501507
--disable-gdb \
502508
--disable-sim \
503509
--disable-libdecnumber \
504-
--disable-readline
510+
--disable-readline \
511+
$(WITH_ISA_SPEC)
505512
$(MAKE) -C $(notdir $@)
506513
$(MAKE) -C $(notdir $@) install
507514
mkdir -p $(dir $@) && touch $@
@@ -554,6 +561,7 @@ stamps/build-gcc-newlib-stage1: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-binuti
554561
$(WITH_ABI) \
555562
$(WITH_ARCH) \
556563
$(WITH_TUNE) \
564+
$(WITH_ISA_SPEC) \
557565
CFLAGS_FOR_TARGET="-Os $(CFLAGS_FOR_TARGET)" \
558566
CXXFLAGS_FOR_TARGET="-Os $(CXXFLAGS_FOR_TARGET)"
559567
$(MAKE) -C $(notdir $@) all-gcc
@@ -653,6 +661,7 @@ stamps/build-gcc-newlib-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-newlib
653661
$(WITH_ABI) \
654662
$(WITH_ARCH) \
655663
$(WITH_TUNE) \
664+
$(WITH_ISA_SPEC) \
656665
CFLAGS_FOR_TARGET="-Os $(CFLAGS_FOR_TARGET)" \
657666
CXXFLAGS_FOR_TARGET="-Os $(CXXFLAGS_FOR_TARGET)"
658667
$(MAKE) -C $(notdir $@)
@@ -680,7 +689,8 @@ stamps/build-binutils-musl: $(BINUTILS_SRCDIR) $(BINUTILS_SRC_GIT) stamps/check-
680689
--disable-gdb \
681690
--disable-sim \
682691
--disable-libdecnumber \
683-
--disable-readline
692+
--disable-readline \
693+
$(WITH_ISA_SPEC)
684694
$(MAKE) -C $(notdir $@)
685695
$(MAKE) -C $(notdir $@) install
686696
mkdir -p $(dir $@) && touch $@
@@ -713,6 +723,7 @@ stamps/build-gcc-musl-stage1: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-binutils
713723
$(WITH_ABI) \
714724
$(WITH_ARCH) \
715725
$(WITH_TUNE) \
726+
$(WITH_ISA_SPEC) \
716727
CFLAGS_FOR_TARGET="-O2 $(CFLAGS_FOR_TARGET)" \
717728
CXXFLAGS_FOR_TARGET="-O2 $(CXXFLAGS_FOR_TARGET)"
718729
$(MAKE) -C $(notdir $@) inhibit-libc=true all-gcc
@@ -780,6 +791,7 @@ stamps/build-gcc-musl-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-musl-lin
780791
$(WITH_ABI) \
781792
$(WITH_ARCH) \
782793
$(WITH_TUNE) \
794+
$(WITH_ISA_SPEC) \
783795
CFLAGS_FOR_TARGET="-O2 $(CFLAGS_FOR_TARGET)" \
784796
CXXFLAGS_FOR_TARGET="-O2 $(CXXFLAGS_FOR_TARGET)"
785797
$(MAKE) -C $(notdir $@)

README.md

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

129+
#### Set default ISA spec version
130+
131+
`--with-isa-spec=` can specify the default version of the RISC-V Unprivileged
132+
(formerly User-Level) ISA specification.
133+
134+
Possible options are: `2.2`, `20190608` and `20191213`.
135+
136+
The default version is `2.2`.
137+
138+
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).
139+
129140
#### Build with customized multi-lib configure.
130141

131142
`--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)