Re: [sw-dev] Digest for sw-dev@groups.riscv.org - 23 updates in 1 topic

87 views
Skip to first unread message

Robert Lipe

unread,
Feb 6, 2024, 2:03:30 AM2/6/24
to sw-...@groups.riscv.org
> I guess that GCC 4.8.5 is simply too old to build the toolchain these days?
> I'm not sure what the minimum GCC version might be.

https://gcc.gnu.org/install/prerequisites.html says 4.8.3, but I think you just produced compelling evidence that it's 4.8.5.

It looks like there's PROBABLY an issue that should have been cleaned up by fixincludes (or whatever it's called in this century - my maintainership was long ago) but as a maintainer, there's not exactly anything actionable you're going to be able make in either 4.8.x, Centos from 2009, or whatever release of GCC you're now trying to build. That speeds you right past 'bargaining' (one could conceivably hand-fix the namespace and signature of log2() - but it's likely that if you were comfortable doing that, we wouldn't be here now) and right into 'acceptance' that 4.8.5 worked and 4.8.3 doesn't.

If I were still a GCC dev and tasked with reproing/fixing an issue exposed on cross development in a ten year old release (for a chip that, in a practical didn't even exist then, though this is blowing up on the native bootstrapping stage) vs. changing the doc and scooching that from 4.8.3 to 4.8.5 after that report, I would 100% take the lazy path.

GCC 13.2 is a pretty happy place to be for RISC-V development of any kind. Probably the happiest, in fact - and doubly so for modern C++ dev if that's in your future.

For prebuilt kits, https://xpack.github.io/dev-tools/riscv-none-elf-gcc/  is handy and on MacOS, the version from Homebrew is only slightly lagging.

SiFive used to provide a really nice collection for all three hosts that was meant for their cores. Since their cores default to a super-compatible, "real" RISC-V collection of opcodes, they were really nice on other platforms when compliance and conformance mattered. Looking now, it looks like they stopped releasing those in about 2020. Perhaps https://github.com/sifive/freedom-u-sdk is a replacement. (Don't be uncool and generate work for them if you're not using SiFive cores, of course...)

On Mon, Feb 5, 2024 at 7:25 PM <sw-...@groups.riscv.org> wrote:
Ahmed Juba <ahmed.j...@gmail.com>: Feb 05 12:22AM -0800

Hello everyone,
I'm trying to setting up the gcc compiler toolchain on CentOS, but there's
some error keeps showing up, i tried alot to solve it but i could't
 
```
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc: In function
‘std::string same_ratio_eew_type(unsigned int, int, unsigned int, bool,
bool)’:
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:118:30: error: ‘log2’
is not a member of ‘std’
elmul_log2 = lmul_log2 - std::log2 (sew / eew);
^
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:118:30: note:
suggested alternative:
In file included from /usr/include/features.h:375:0,
from /usr/include/stdio.h:27,
from ../../../gcc/gcc/system.h:46,
from
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:18:
/usr/include/bits/mathcalls.h:145:1: note: ‘log2’
__MATHCALL (log2,, (_Mdouble_ __x));
^
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:120:30: error: ‘log2’
is not a member of ‘std’
elmul_log2 = lmul_log2 + std::log2 (eew / sew);
^
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:120:30: note:
suggested alternative:
In file included from /usr/include/features.h:375:0,
from /usr/include/stdio.h:27,
from ../../../gcc/gcc/system.h:46,
from
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:18:
/usr/include/bits/mathcalls.h:145:1: note: ‘log2’
__MATHCALL (log2,, (_Mdouble_ __x));
^
make[2]: *** [build/genrvv-type-indexer.o] Error 1
make[2]: Leaving directory
`/home/ICer/CHIPSAlliance/riscv-dv/gcc-demo/build/build-gcc-newlib-stage1/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory
`/home/ICer/CHIPSAlliance/riscv-dv/gcc-demo/build/build-gcc-newlib-stage1'
make: *** [stamps/build-gcc-newlib-stage1] Error 2
[ICer@IC_EDA /home/ICer/CHIPSAlliance/riscv-dv/gcc-demo/build]$
```
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 09:13AM

Same issue as mentioned here perhaps?
 
* https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/OGAtlT4zVPg
Ahmed Juba <ahmed.j...@gmail.com>: Feb 05 01:38AM -0800

Yes, i think so but it's a different situation.
I was trying to setup RISC-V GNU Compiler Toolchain from here: riscv-collab/riscv-gnu-toolchain:
GNU toolchain for RISC-V, including GCC (github.com)
<https://github.com/riscv-collab/riscv-gnu-toolchain>
 
by the following commands:
```
git clone https://github.com/riscv-collab/riscv-gnu-toolchain.git gcc-demo
sudo yum install autoconf automake python3 libmpc-devel mpfr-devel
gmp-devel \ gawk bison flex texinfo patchutils gcc gcc-c++ zlib-devel
expat-devel
cd gcc-demo/ mkdir build cd build/
../configure --prefix=/home/ICer/riscv-demo export
PATH="$HOME/riscv-demo/bin:$PATH"
sudo make
```
this error shows up after sudo make, and ` riscv64-unknown-elf-gcc` isn't
installed due to the errors.
So exactly, what should i do?
 
On Monday, February 5, 2024 at 11:13:32 AM UTC+2 tommy_...@hotmail.com
wrote:
 
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 01:50AM -0800

I'm pretty sure that this works fine for me - at least on WSL2/Ubuntu 20.04.
I'm just trying again now to check.
 
What CentOS version are you using?
What is your build log (e.g. `make 2>&1 | tee build.log`)?
"Christoph Müllner" <christoph...@vrull.eu>: Feb 05 10:50AM +0100

> cd gcc-demo/ mkdir build cd build/
> ../configure --prefix=/home/ICer/riscv-demo export PATH="$HOME/riscv-demo/bin:$PATH"
> sudo make
 
Independent of the actual issue: please, never use "sudo make".
Only install into directories where you have the necessary permissions
(ensure this before calling make).
 
I'm not sure if out of tree builds (mkdir build; cd build;
../configure) work with that repository.
So, instead of out of tree building, I suggest using git worktree (if
multiple builds are needed) and
in-tree builds.
 
Also note that " cd gcc-demo/ mkdir build cd build/ " (copied from
your instruction list) will not even enter the directory gcc-demo,
because you are missing semicolons (';') between the commands.
Given your build started, it seems you did not put the instructions in
the email that were actually used to build the toolchain.
 
Further, I don't understand why you are setting PATH.
 
BR
Christoph
 
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 01:59AM -0800

On Monday 5 February 2024 at 09:51:05 UTC christoph...@vrull.eu wrote:
 
Independent of the actual issue: please, never use "sudo make".
Only install into directories where you have the necessary permissions
(ensure this before calling make).
 
 
This keeps cropping up because the default install location is `/opt/riscv`
and this leads people to think that they need `sudo`.
Well, they generally do if they leave don't override the default install
location of `/opt/riscv` using `configure --prefix=...`.
But some keep doing it even when they're using a "local" directory.
 
* https://github.com/riscv-collab/riscv-gnu-toolchain?tab=readme-ov-file#installation-newlib

 
I'm not sure if out of tree builds (mkdir build; cd build;
../configure) work with that repository.
So, instead of out of tree building, I suggest using git worktree (if
multiple builds are needed) and
in-tree builds.
 
 
I'm a bit confused - I don't see any out of tree building above.
Where do you see it?
 
* https://github.com/riscv-collab/riscv-gnu-toolchain?tab=readme-ov-file#use-source-tree-other-than-riscv-gnu-toolchain

 
Also note that " cd gcc-demo/ mkdir build cd build/ " (copied from
your instruction list) will not even enter the directory gcc-demo,
because you are missing semicolons (';') between the commands.
 
 
I assumed that these were copy/paste errors and line breaks were lost?

 
Given your build started, it seems you did not put the instructions in
the email that were actually used to build the toolchain.
 
 
Agreed.

 
Further, I don't understand why you are setting PATH.
 
 
Me neither.
"Christoph Müllner" <christoph...@vrull.eu>: Feb 05 11:11AM +0100


> I'm a bit confused - I don't see any out of tree building above.
> Where do you see it?
 
> * https://github.com/riscv-collab/riscv-gnu-toolchain?tab=readme-ov-file#use-source-tree-other-than-riscv-gnu-toolchain
 
We are talking about different things:
* sources of toolchain components (GCC, QEMU, etc) are out of tree
-> we override the sources to some local path (documented in the
link that you have provided)
* building riscv-gnu-toolchain out of tree itself in an empty build directory
 
Ahmed stated that he did the following:
git clone https://github.com/riscv-collab/riscv-gnu-toolchain.git gcc-demo
cd gcc-demo/
mkdir build
cd build/
../configure --prefix=/home/ICer/riscv-demo export
PATH="$HOME/riscv-demo/bin:$PATH"
 
So he creates a build directory and from there executes "../configure
... ; make ...".
Since the source directory of riscv-gnu-toolchain and the build
directory are different he does an out of tree build of the
riscv-gnu-toolchain repo.
 
> your instruction list) will not even enter the directory gcc-demo,
> because you are missing semicolons (';') between the commands.
 
> I assumed that these were copy/paste errors and line breaks were lost?
 
Possible, but I don't want to guess/assume.
If so, then it was an out-of-tree build and likely the source of the
build error.
 
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 02:15AM -0800

On Monday 5 February 2024 at 10:11:29 UTC christoph...@vrull.eu wrote:
 
We are talking about different things:
* sources of toolchain components (GCC, QEMU, etc) are out of tree
-> we override the sources to some local path (documented in the
link that you have provided)
* building riscv-gnu-toolchain out of tree itself in an empty build
directory
 
Ahmed stated that he did the following:
git clone https://github.com/riscv-collab/riscv-gnu-toolchain.git gcc-demo
cd gcc-demo/
mkdir build
cd build/
../configure --prefix=/home/ICer/riscv-demo export
PATH="$HOME/riscv-demo/bin:$PATH"
 
So he creates a build directory and from there executes "../configure
... ; make ...".
Since the source directory of riscv-gnu-toolchain and the build
directory are different he does an out of tree build of the
riscv-gnu-toolchain repo.
 
 
Ah - OK - I understand what you're referring to now.
I've done builds like that recently (a few weeks ago) and they worked fine.
E.g.
```
git clone https://github.com/riscv-collab/riscv-gnu-toolchain.git test
cd test
mkdir mybuilddir
cd mybuilddir
../configure ...
make
```
I normally just build in the root directory of the cloned repo though.
"Christoph Müllner" <christoph...@vrull.eu>: Feb 05 11:17AM +0100

> make
> ```
> I normally just build in the root directory of the cloned repo though.
 
Ok, I never did this before.
Good to know this actually works.
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 10:24AM

I'm just double checking such a build on WSL2/Ubuntu 20.04 to be sure.
I'm pretty sure it'll work.
 
Ahmed should maybe clarify what version of CentOS is being used and provide the build log for a clean build. E.g.
 
```
make distclean
rm -rf /home/ICer/riscv-demo
make 2>&1 | tee build.log
```
 
I've never done builds on CentOS so maybe there's something odd there?
Ahmed Juba <ahmed.j...@gmail.com>: Feb 05 03:15AM -0800

[ICer@IC_EDA /home/ICer/gcc-demo/build]$../configure --prefix=/opt/riscv
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for fgrep... /usr/bin/grep -F
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for bash... /bin/sh
checking for __gmpz_init in -lgmp... yes
checking for mpfr_init in -lmpfr... yes
checking for mpc_init2 in -lmpc... yes
checking for curl... /usr/bin/curl
checking for wget... /usr/bin/wget
checking for ftp... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating scripts/wrapper/awk/awk
config.status: creating scripts/wrapper/sed/sed
[ICer@IC_EDA /home/ICer/gcc-demo/build]$export PATH="$HOME/opt/riscv/bin:$PATH"
[ICer@IC_EDA /home/ICer/gcc-demo/build]$sudo make
[sudo] password for ICer:
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
if test -f /home/ICer/gcc-demo/build/../gcc/contrib/download_prerequisites && test "false" = "true"; then cd /home/ICer/gcc-demo/build/../gcc && ./contrib/download_prerequisites; fi
rm -rf stamps/build-gcc-newlib-stage1 build-gcc-newlib-stage1
mkdir build-gcc-newlib-stage1
cd build-gcc-newlib-stage1 && /home/ICer/gcc-demo/build/../gcc/configure \
--target=riscv64-unknown-elf \
\
--prefix=/opt/riscv \
--disable-shared \
--disable-threads \
--disable-tls \
--enable-languages=c,c++ \
--with-system-zlib \
--with-newlib \
--with-sysroot=/opt/riscv/riscv64-unknown-elf \
--disable-libmudflap \
--disable-libssp \
--disable-libquadmath \
--disable-libgomp \
--disable-nls \
--disable-tm-clone-registry \
--src=../../gcc \
\
--disable-multilib \
--with-abi=lp64d \
--with-arch=rv64imafdc \
--with-tune=rocket \
--with-isa-spec=20191213 \
\
CFLAGS_FOR_TARGET="-Os -mcmodel=medlow" \
CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow"
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... riscv64-unknown-elf
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... /usr/bin/gawk
checking for libatomic support... no
checking for libitm support... no
checking for libsanitizer support... no
checking for libvtv support... no
checking for libphobos support... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gcc option to accept ISO C99... -std=gnu99
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada and is recent enough... no
checking for gdc... no
checking whether the D compiler works... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=gnu++11... yes
checking for objdir... .libs
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... buggy but acceptable
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr libraries... yes
checking for the correct version of the mpc libraries... yes
checking for isl 0.15 or later... no
required isl version is 0.15 or later
*** This configuration is not supported in the following subdirectories:
zlib target-libquadmath target-libatomic target-libitm target-libsanitizer target-libvtv target-libphobos gnattools gotools target-libada target-zlib target-libbacktrace target-libgfortran target-libgo target-libffi target-libgm2 target-libobjc target-libgomp target-libssp
(Any other directories should still work fine.)
checking for default BUILD_CONFIG...
checking for --enable-vtable-verify... no
checking for bison... bison -y
checking for bison... bison
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for expect... no
checking for runtest... no
checking for ar... ar
checking for as... as
checking for dlltool... no
checking for dsymutil... no
checking for ld... ld
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... no
checking for windmc... no
checking for objcopy... objcopy
checking for objdump... objdump
checking for otool... no
checking for readelf... readelf
checking for riscv64-unknown-elf-cc... no
checking for riscv64-unknown-elf-gcc... no
checking for riscv64-unknown-elf-c++... no
checking for riscv64-unknown-elf-g++... no
checking for riscv64-unknown-elf-cxx... no
checking for riscv64-unknown-elf-gxx... no
checking for riscv64-unknown-elf-gcc... no
checking for riscv64-unknown-elf-gfortran... no
checking for riscv64-unknown-elf-gccgo... no
checking for riscv64-unknown-elf-gdc... no
checking for riscv64-unknown-elf-gm2... no
checking for ar... /opt/riscv/riscv64-unknown-elf/bin/ar
checking for as... /opt/riscv/riscv64-unknown-elf/bin/as
checking for dlltool... no
checking for riscv64-unknown-elf-dlltool... no
checking for dsymutil... no
checking for riscv64-unknown-elf-dsymutil... no
checking for ld... /opt/riscv/riscv64-unknown-elf/bin/ld
checking for lipo... no
checking for riscv64-unknown-elf-lipo... no
checking for nm... /opt/riscv/riscv64-unknown-elf/bin/nm
checking for objcopy... /opt/riscv/riscv64-unknown-elf/bin/objcopy
checking for objdump... /opt/riscv/riscv64-unknown-elf/bin/objdump
checking for otool... no
checking for riscv64-unknown-elf-otool... no
checking for ranlib... /opt/riscv/riscv64-unknown-elf/bin/ranlib
checking for readelf... /opt/riscv/riscv64-unknown-elf/bin/readelf
checking for strip... /opt/riscv/riscv64-unknown-elf/bin/strip
checking for windres... no
checking for riscv64-unknown-elf-windres... no
checking for windmc... no
checking for riscv64-unknown-elf-windmc... no
checking where to find the target ar... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target as... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target cc... just compiled
checking where to find the target c++... just compiled
checking where to find the target c++ for libstdc++... just compiled
checking where to find the target dlltool... pre-installed
checking where to find the target dsymutil... pre-installed
checking where to find the target gcc... just compiled
checking where to find the target gfortran... pre-installed
checking where to find the target gccgo... pre-installed
checking where to find the target gdc... pre-installed
checking where to find the target gm2... pre-installed
checking where to find the target ld... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target lipo... pre-installed
checking where to find the target nm... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target objcopy... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target objdump... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target otool... pre-installed
checking where to find the target ranlib... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target readelf... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target strip... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target windres... pre-installed
checking where to find the target windmc... pre-installed
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
config.status: creating Makefile
make -C build-gcc-newlib-stage1 all-gcc
make[1]: Entering directory `/home/ICer/gcc-demo/build/build-gcc-newlib-stage1'
mkdir -p -- ./intl
Configuring in ./intl
configure: creating cache ./config.cache
checking for x86_64-pc-linux-gnu-gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /bin/install -c
checking whether NLS is requested... no
checking for msgfmt... /bin/msgfmt
checking for gmsgfmt... /bin/msgfmt
checking for xgettext... /bin/xgettext
checking for msgmerge... /bin/msgmerge
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for x86_64-pc-linux-gnu-ranlib... ranlib
checking for library containing strerror... none required
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for off_t... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking whether we are using the GNU C Library 2.1 or newer... yes
checking whether integer division by zero raises SIGFPE... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unsigned long long... yes
checking for inttypes.h... yes
checking whether the inttypes.h PRIxNN macros are broken... no
checking for ld used by GCC... ld
checking if the linker (ld) is GNU ld... yes
checking for shared library run path origin... done
checking argz.h usability... yes
checking argz.h presence... yes
checking for argz.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking nl_types.h usability... yes
checking nl_types.h presence... yes
checking for nl_types.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for feof_unlocked... yes
checking for fgets_unlocked... yes
checking for getc_unlocked... yes
checking for getcwd... yes
checking for getegid... yes
checking for geteuid... yes
checking for getgid... yes
checking for getuid... yes
checking for mempcpy... yes
checking for munmap... yes
checking for putenv... yes
checking for setenv... yes
checking for setlocale... yes
checking for stpcpy... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strtoul... yes
checking for tsearch... yes
checking for __argz_count... yes
checking for __argz_stringify... yes
checking for __argz_next... yes
checking for __fsetlocking... yes
checking for iconv... yes
checking for iconv declaration...
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for nl_langinfo and CODESET... yes
checking for LC_MESSAGES... yes
checking for bison... bison
checking version of bison... 3.0.4, ok
checking whether NLS is requested... no
checking whether to use NLS... no
checking for aclocal... aclocal
checking for autoconf... autoconf
checking for autoheader... autoheader
checking bison 3 or later... 3.0.4, bison3
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.intl
config.status: creating config.h
config.status: executing default-1 commands
mkdir -p -- ./lto-plugin
Configuring in ./lto-plugin
configure: creating cache ./config.cache
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... riscv64-unknown-elf
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... /usr/bin/gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for x86_64-pc-linux-gnu-gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking whether gcc -std=gnu99 understands -c and -o together... yes
checking dependency style of gcc -std=gnu99... gcc3
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for x86_64-pc-linux-gnu-gcc...
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 03:37AM -0800

Can you modify your build commands to omit the `export
PATH="$HOME/riscv-demo/bin:$PATH"` and see if that makes any difference?
Just in case having the toolchain that you're trying to build on the PATH
at build time causes problems?
Basically:
```
git clone https://github.com/riscv-collab/riscv-gnu-toolchain.git gcc-demo
cd gcc-demo/
mkdir build
cd build/
../configure --prefix=/home/ICer/riscv-demo
make distclean
rm -rf /home/ICer/riscv-demo
make 2>&1 | tee build.log
```
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 03:57AM -0800

FWIW I did a test build on my WSL2/Ubuntu 20.04 machine as follows and it
worked fine.
```
cd ~/Downloads
git clone https://github.com/riscv-collab/riscv-gnu-toolchain mailing-list
cd mailing-list
mkdir mybuild
cd mybuild
../configure --prefix=`pwd`/installed-tools
make 2>&1 | tee build.log
```
Compressed `build.log` attached.
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 04:01AM -0800

I also tried this:
```
../configure --prefix=$HOME/Downloads/mailing-list/installed-tools export
PATH=$HOME/Downloads/mailing-list/installed-tools/bin:$PATH
```
but got lots of wanings:
```
configure: WARNING: you should use --build, --host, --target
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/dotnet/:/mnt/c/Program
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/Meld/:/mnt/c/Program
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/nodejs/:/mnt/c/Program
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/Git/cmd:/mnt/c/Program
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/Crucial/Crucial
configure: WARNING: you should use --build, --host, --target
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Executive:/mnt/c/Program
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/PuTTY/:/mnt/c/Program
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/usbipd-win/:/mnt/c/Users/Tommy
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Murphy/scoop/shims:/mnt/c/Users/Tommy
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type:
Murphy/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Tommy
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type:
Murphy/AppData/Roaming/npm:/mnt/c/Users/Tommy
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type:
Murphy/AppData/Local/Programs/Microsoft
configure: WARNING: you should use --build, --host, --target
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Code/bin:/snap/bin
checking for export-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for fgrep... /usr/bin/grep -F
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for bash... /bin/bash
checking for __gmpz_init in -lgmp... yes
checking for mpfr_init in -lmpfr... yes
checking for mpc_init2 in -lmpc... yes
checking for curl... /usr/bin/curl
checking for wget... /usr/bin/wget
checking for ftp... /usr/bin/ftp
configure: creating ./config.status
config.status: creating Makefile
config.status: creating scripts/wrapper/awk/awk
config.status: creating scripts/wrapper/sed/sed
```
Do you get those or should the commands actually executed separately?
```
../configure --prefix=$HOME/Downloads/mailing-list/installed-tools
export PATH=$HOME/Downloads/mailing-list/installed-tools/bin:$PATH
make
```
Ahmed Juba <ahmed.j...@gmail.com>: Feb 05 04:15AM -0800

[ICer@IC_EDA /home/ICer/gcc-demo/build]$../configure --prefix=/opt/riscv
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for fgrep... /usr/bin/grep -F
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for bash... /bin/sh
checking for __gmpz_init in -lgmp... yes
checking for mpfr_init in -lmpfr... yes
checking for mpc_init2 in -lmpc... yes
checking for curl... /usr/bin/curl
checking for wget... /usr/bin/wget
checking for ftp... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating scripts/wrapper/awk/awk
config.status: creating scripts/wrapper/sed/sed
[ICer@IC_EDA /home/ICer/gcc-demo/build]$export PATH="$HOME/opt/riscv/bin:$PATH"
[ICer@IC_EDA /home/ICer/gcc-demo/build]$sudo make
[sudo] password for ICer:
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
if test -f /home/ICer/gcc-demo/build/../gcc/contrib/download_prerequisites && test "false" = "true"; then cd /home/ICer/gcc-demo/build/../gcc && ./contrib/download_prerequisites; fi
rm -rf stamps/build-gcc-newlib-stage1 build-gcc-newlib-stage1
mkdir build-gcc-newlib-stage1
cd build-gcc-newlib-stage1 && /home/ICer/gcc-demo/build/../gcc/configure \
--target=riscv64-unknown-elf \
\
--prefix=/opt/riscv \
--disable-shared \
--disable-threads \
--disable-tls \
--enable-languages=c,c++ \
--with-system-zlib \
--with-newlib \
--with-sysroot=/opt/riscv/riscv64-unknown-elf \
--disable-libmudflap \
--disable-libssp \
--disable-libquadmath \
--disable-libgomp \
--disable-nls \
--disable-tm-clone-registry \
--src=../../gcc \
\
--disable-multilib \
--with-abi=lp64d \
--with-arch=rv64imafdc \
--with-tune=rocket \
--with-isa-spec=20191213 \
\
CFLAGS_FOR_TARGET="-Os -mcmodel=medlow" \
CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow"
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... riscv64-unknown-elf
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... /usr/bin/gawk
checking for libatomic support... no
checking for libitm support... no
checking for libsanitizer support... no
checking for libvtv support... no
checking for libphobos support... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gcc option to accept ISO C99... -std=gnu99
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada and is recent enough... no
checking for gdc... no
checking whether the D compiler works... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=gnu++11... yes
checking for objdir... .libs
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... buggy but acceptable
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr libraries... yes
checking for the correct version of the mpc libraries... yes
checking for isl 0.15 or later... no
required isl version is 0.15 or later
*** This configuration is not supported in the following subdirectories:
zlib target-libquadmath target-libatomic target-libitm target-libsanitizer target-libvtv target-libphobos gnattools gotools target-libada target-zlib target-libbacktrace target-libgfortran target-libgo target-libffi target-libgm2 target-libobjc target-libgomp target-libssp
(Any other directories should still work fine.)
checking for default BUILD_CONFIG...
checking for --enable-vtable-verify... no
checking for bison... bison -y
checking for bison... bison
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for expect... no
checking for runtest... no
checking for ar... ar
checking for as... as
checking for dlltool... no
checking for dsymutil... no
checking for ld... ld
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... no
checking for windmc... no
checking for objcopy... objcopy
checking for objdump... objdump
checking for otool... no
checking for readelf... readelf
checking for riscv64-unknown-elf-cc... no
checking for riscv64-unknown-elf-gcc... no
checking for riscv64-unknown-elf-c++... no
checking for riscv64-unknown-elf-g++... no
checking for riscv64-unknown-elf-cxx... no
checking for riscv64-unknown-elf-gxx... no
checking for riscv64-unknown-elf-gcc... no
checking for riscv64-unknown-elf-gfortran... no
checking for riscv64-unknown-elf-gccgo... no
checking for riscv64-unknown-elf-gdc... no
checking for riscv64-unknown-elf-gm2... no
checking for ar... /opt/riscv/riscv64-unknown-elf/bin/ar
checking for as... /opt/riscv/riscv64-unknown-elf/bin/as
checking for dlltool... no
checking for riscv64-unknown-elf-dlltool... no
checking for dsymutil... no
checking for riscv64-unknown-elf-dsymutil... no
checking for ld... /opt/riscv/riscv64-unknown-elf/bin/ld
checking for lipo... no
checking for riscv64-unknown-elf-lipo... no
checking for nm... /opt/riscv/riscv64-unknown-elf/bin/nm
checking for objcopy... /opt/riscv/riscv64-unknown-elf/bin/objcopy
checking for objdump... /opt/riscv/riscv64-unknown-elf/bin/objdump
checking for otool... no
checking for riscv64-unknown-elf-otool... no
checking for ranlib... /opt/riscv/riscv64-unknown-elf/bin/ranlib
checking for readelf... /opt/riscv/riscv64-unknown-elf/bin/readelf
checking for strip... /opt/riscv/riscv64-unknown-elf/bin/strip
checking for windres... no
checking for riscv64-unknown-elf-windres... no
checking for windmc... no
checking for riscv64-unknown-elf-windmc... no
checking where to find the target ar... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target as... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target cc... just compiled
checking where to find the target c++... just compiled
checking where to find the target c++ for libstdc++... just compiled
checking where to find the target dlltool... pre-installed
checking where to find the target dsymutil... pre-installed
checking where to find the target gcc... just compiled
checking where to find the target gfortran... pre-installed
checking where to find the target gccgo... pre-installed
checking where to find the target gdc... pre-installed
checking where to find the target gm2... pre-installed
checking where to find the target ld... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target lipo... pre-installed
checking where to find the target nm... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target objcopy... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target objdump... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target otool... pre-installed
checking where to find the target ranlib... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target readelf... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target strip... pre-installed in /opt/riscv/riscv64-unknown-elf/bin
checking where to find the target windres... pre-installed
checking where to find the target windmc... pre-installed
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
config.status: creating Makefile
make -C build-gcc-newlib-stage1 all-gcc
make[1]: Entering directory `/home/ICer/gcc-demo/build/build-gcc-newlib-stage1'
mkdir -p -- ./intl
Configuring in ./intl
configure: creating cache ./config.cache
checking for x86_64-pc-linux-gnu-gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /bin/install -c
checking whether NLS is requested... no
checking for msgfmt... /bin/msgfmt
checking for gmsgfmt... /bin/msgfmt
checking for xgettext... /bin/xgettext
checking for msgmerge... /bin/msgmerge
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for x86_64-pc-linux-gnu-ranlib... ranlib
checking for library containing strerror... none required
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for off_t... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking whether we are using the GNU C Library 2.1 or newer... yes
checking whether integer division by zero raises SIGFPE... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unsigned long long... yes
checking for inttypes.h... yes
checking whether the inttypes.h PRIxNN macros are broken... no
checking for ld used by GCC... ld
checking if the linker (ld) is GNU ld... yes
checking for shared library run path origin... done
checking argz.h usability... yes
checking argz.h presence... yes
checking for argz.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking nl_types.h usability... yes
checking nl_types.h presence... yes
checking for nl_types.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for feof_unlocked... yes
checking for fgets_unlocked... yes
checking for getc_unlocked... yes
checking for getcwd... yes
checking for getegid... yes
checking for geteuid... yes
checking for getgid... yes
checking for getuid... yes
checking for mempcpy... yes
checking for munmap... yes
checking for putenv... yes
checking for setenv... yes
checking for setlocale... yes
checking for stpcpy... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strtoul... yes
checking for tsearch... yes
checking for __argz_count... yes
checking for __argz_stringify... yes
checking for __argz_next... yes
checking for __fsetlocking... yes
checking for iconv... yes
checking for iconv declaration...
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for nl_langinfo and CODESET... yes
checking for LC_MESSAGES... yes
checking for bison... bison
checking version of bison... 3.0.4, ok
checking whether NLS is requested... no
checking whether to use NLS... no
checking for aclocal... aclocal
checking for autoconf... autoconf
checking for autoheader... autoheader
checking bison 3 or later... 3.0.4, bison3
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.intl
config.status: creating config.h
config.status: executing default-1 commands
mkdir -p -- ./lto-plugin
Configuring in ./lto-plugin
configure: creating cache ./config.cache
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... riscv64-unknown-elf
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... /usr/bin/gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for x86_64-pc-linux-gnu-gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking whether gcc -std=gnu99 understands -c and -o together... yes
checking dependency style of gcc -std=gnu99... gcc3
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for x86_64-pc-linux-gnu-gcc...
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 12:20PM

I will try a test build on a CentOS 7 VM but at this stage I think that you should probably consider trying a clean (virtual or physical) machine installation to eliminate the possibility of something on your work machine causing problems.
Ahmed Juba <ahmed.j...@gmail.com>: Feb 05 04:21AM -0800

thank you for trying harder.
can you provide me with the commands to do so?
 
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 12:29PM

> can you provide me with the commands to do so?
 
I don't understand - to do what?
If you mean how to install a VM then you'll need to research that yourself.
I generally use VirtualBox or WSL2.
Both are fairly simple to use to get a VM up and running.
Ahmed Juba <ahmed.j...@gmail.com>: Feb 05 04:31AM -0800

oh my bad, i misunderstood you. i will use another VM which's:
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
 
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 05:54AM -0800

Ok - I can reproduce the problem on a VirtualBox VM installation of CentOS
7.9 2009.
The build fails with the same errors:
```
g++ -std=gnu++11 -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild
-I../../../gcc/gcc -I../../../gcc/gcc/build -I../../../gcc/gcc/../include
-I../../../gcc/gcc/../libcpp/include \
-o build/genrvv-type-indexer.o
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc: In function
‘std::string same_ratio_eew_type(unsigned int, int, unsigned int, bool,
bool)’:
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:118:30: error: ‘log2’
is not a member of ‘std’
elmul_log2 = lmul_log2 - std::log2 (sew / eew);
^
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:118:30: note:
suggested alternative:
In file included from /usr/include/features.h:375:0,
from /usr/include/stdio.h:27,
from ../../../gcc/gcc/system.h:46,
from
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:18:
/usr/include/bits/mathcalls.h:145:1: note: ‘log2’
__MATHCALL (log2,, (_Mdouble_ __x));
^
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:120:30: error: ‘log2’
is not a member of ‘std’
elmul_log2 = lmul_log2 + std::log2 (eew / sew);
^
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:120:30: note:
suggested alternative:
In file included from /usr/include/features.h:375:0,
from /usr/include/stdio.h:27,
from ../../../gcc/gcc/system.h:46,
from
../../../gcc/gcc/config/riscv/genrvv-type-indexer.cc:18:
/usr/include/bits/mathcalls.h:145:1: note: ‘log2’
__MATHCALL (log2,, (_Mdouble_ __x));
^
make[2]: *** [build/genrvv-type-indexer.o] Error 1
make[2]: Leaving directory
`/home/user/Downloads/riscv-gnu-toolchain/build/build-gcc-newlib-stage1/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory
`/home/user/Downloads/riscv-gnu-toolchain/build/build-gcc-newlib-stage1'
make: *** [stamps/build-gcc-newlib-stage1] Error 2
```
The default GCC installed on CentOS 7 is 4.8.5 which is quite old:
```
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto
--enable-plugin --enable-initfini-array --disable-libgcj
--with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install
--enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
```
I wonder if that's too old to build the toolchain these days?
Let's try a later one (the latest that I can find at a glance is GCC 11):
```
# https://forums.centos.org/viewtopic.php?t=71219
sudo yum install centos-release-scl-rh
sudo yum install devtoolset-11-toolchain
scl enable devtoolset-11 bash
 
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,lto
--prefix=/opt/rh/devtoolset-11/root/usr
--mandir=/opt/rh/devtoolset-11/root/usr/share/man
--infodir=/opt/rh/devtoolset-11/root/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --with-linker-hash-style=gnu
--with-default-libstdcxx-abi=gcc4-compatible --enable-plugin
--enable-initfini-array
--with-isl=/builddir/build/BUILD/gcc-11.2.1-20220127/obj-x86_64-redhat-linux/isl-install
--enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64
--build=x86_64-redhat-linux
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20220127 (Red Hat 11.2.1-9) (GCC)

cd ~/Downloads/riscv-gnu-toolchain
rm -rf build
mkdir build
cd build
../configure --prefix=`pwd`/installed-tools
make 2>&1 | tee build.log
```
I'll post back with results ASAP.
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 08:20AM -0800

Quick update - CentOS 7.9 2009 build using GCC 11 (via
devtoolset-11-toolchain) completed successfully.
I guess that GCC 4.8.5 is simply too old to build the toolchain these days?
I'm not sure what the minimum GCC version might be.
Ahmed Juba <ahmed.j...@gmail.com>: Feb 05 06:58PM +0200

Thank you for the great effort, really appreciate it.
Does this GCC 11 toolchain will be suitable for RISC-V DV by CHIPS Alliance?
 
On Mon, Feb 5, 2024 at 6:20 PM Tommy Murphy <tommy_...@hotmail.com>
wrote:
 
Tommy Murphy <tommy_...@hotmail.com>: Feb 05 09:32AM -0800

On Monday 5 February 2024 at 16:59:02 UTC ahmed.j...@gmail.com wrote:
 
Thank you for the great effort, really appreciate it.
 
 
You're welcome.

 
Does this GCC 11 toolchain will be suitable for RISC-V DV by CHIPS Alliance?
 
 
Just to clarify - I used GCC 11 on CentOS 7 to build the GCC 13.2 RISC-V
toolchain - i.e. a RISC-V cross compiler toolchain that runs on Linux
x86_64.
So the RISC-V GCC is 13.2 not 11.
 
I would expect that this is fine but can't say for sure as I know nothing
about CHIPS Alliance RISC-V DV.
I would expect that this sort of application just needs a working toolchain
and how it's built doesn't really matter (as long as it has been built
successfully obviously).
Maybe ask over at the RISC-V DV community?
Maybe they have more specific guidelines for how to build the RISC-V
toolchain and other relevant tools?
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to sw-dev+un...@groups.riscv.org.
Reply all
Reply to author
Forward
0 new messages