riscv-collab / riscv-gnu-toolchain

GNU toolchain for RISC-V, including GCC
Other
3.53k stars 1.16k forks source link

Failing to build rv32em: "The riscv32 is not supported" #1312

Closed GlaireDaggers closed 1 year ago

GlaireDaggers commented 1 year ago

So for reference, I am attempting to build this toolchain on Linux Mint 21.1

I have followed the steps outlined in the readme. I first cloned the repository to my secondary drive, fetched the packages as given for Ubuntu, ran the following configure:

./configure --prefix=/opt/riscv --with-arch=rv32em --with-abi=ilp32e

And then did:

sudo make linux

The problem I'm running into is that this is failing in build-glibc-linux-rv32em-ilp32e, printing "checking sysdep dirs" before displaying the error "The riscv32 is not supported". The outputs of the config.log in this folder are as follows:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU C Library configure (see version.h), which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ /media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure --host=riscv32-unknown-linux-gnu --prefix=/usr --disable-werror --enable-shared --enable-obsolete-rpc --with-headers=/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/linux-headers/include --disable-multilib --enable-kernel=3.0.0 --libdir=/usr/lib libc_cv_slibdir=/lib libc_cv_rtlddir=/lib

## --------- ##
## Platform. ##
## --------- ##

hostname = hazel-Nitro-AN515-54
uname -m = x86_64
uname -r = 5.15.0-73-generic
uname -s = Linux
uname -v = #80-Ubuntu SMP Mon May 15 15:18:26 UTC 2023

/usr/bin/uname -p = x86_64
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/scripts/wrapper/sed
PATH: /opt/riscv/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /snap/bin

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2250: checking build system type
configure:2264: result: x86_64-pc-linux-gnu
configure:2284: checking host system type
configure:2297: result: riscv32-unknown-linux-gnu
configure:2326: checking for riscv32-unknown-linux-gnu-gcc
configure:2353: result: riscv32-unknown-linux-gnu-gcc 
configure:2622: checking for C compiler version
configure:2631: riscv32-unknown-linux-gnu-gcc  --version >&5
riscv32-unknown-linux-gnu-gcc (GCC) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2642: $? = 0
configure:2631: riscv32-unknown-linux-gnu-gcc  -v >&5
Using built-in specs.
COLLECT_GCC=riscv32-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/opt/riscv/libexec/gcc/riscv32-unknown-linux-gnu/12.2.0/lto-wrapper
Target: riscv32-unknown-linux-gnu
Configured with: '/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/gcc/configure' --target=riscv32-unknown-linux-gnu --prefix=/opt/riscv --with-sysroot=/opt/riscv/sysroot --with-newlib --without-headers --disable-shared --disable-threads --with-system-zlib --enable-tls --enable-languages=c --disable-libatomic --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-bootstrap --src=.././gcc --disable-multilib --with-abi=ilp32e --with-arch=rv32em --with-tune=rocket --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2    -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-O2    -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.2.0 (GCC) 
configure:2642: $? = 0
configure:2631: riscv32-unknown-linux-gnu-gcc  -V >&5
riscv32-unknown-linux-gnu-gcc: error: unrecognized command-line option '-V'
riscv32-unknown-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:2642: $? = 1
configure:2631: riscv32-unknown-linux-gnu-gcc  -qversion >&5
riscv32-unknown-linux-gnu-gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
riscv32-unknown-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:2642: $? = 1
configure:2647: checking for suffix of object files
configure:2669: riscv32-unknown-linux-gnu-gcc  -c    -mcmodel=medlow -O2   conftest.c >&5
configure:2673: $? = 0
configure:2694: result: o
configure:2698: checking whether we are using the GNU C compiler
configure:2717: riscv32-unknown-linux-gnu-gcc  -c    -mcmodel=medlow -O2   conftest.c >&5
configure:2717: $? = 0
configure:2726: result: yes
configure:2735: checking whether riscv32-unknown-linux-gnu-gcc  accepts -g
configure:2755: riscv32-unknown-linux-gnu-gcc  -c -g  conftest.c >&5
configure:2755: $? = 0
configure:2796: result: yes
configure:2825: checking for gcc
configure:2841: found /usr/bin/gcc
configure:2852: result: gcc
configure:2987: checking for C++ compiler version
configure:2996: this-is-not-the-compiler-youre-looking-for --version >&5
/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure: line 2998: this-is-not-the-compiler-youre-looking-for: command not found
configure:3007: $? = 127
configure:2996: this-is-not-the-compiler-youre-looking-for -v >&5
/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure: line 2998: this-is-not-the-compiler-youre-looking-for: command not found
configure:3007: $? = 127
configure:2996: this-is-not-the-compiler-youre-looking-for -V >&5
/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure: line 2998: this-is-not-the-compiler-youre-looking-for: command not found
configure:3007: $? = 127
configure:2996: this-is-not-the-compiler-youre-looking-for -qversion >&5
/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure: line 2998: this-is-not-the-compiler-youre-looking-for: command not found
configure:3007: $? = 127
configure:3011: checking whether we are using the GNU C++ compiler
configure:3030: this-is-not-the-compiler-youre-looking-for -c    -mcmodel=medlow -O2   conftest.cpp >&5
/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure: line 1633: this-is-not-the-compiler-youre-looking-for: command not found
configure:3030: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla/"
| #define PACKAGE_URL "https://www.gnu.org/software/glibc/"
| #define PKGVERSION "(GNU libc) "
| #define REPORT_BUGS_TO "<https://www.gnu.org/software/libc/bugs.html>"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| #ifndef __GNUC__
|        choke me
| #endif
| 
|   ;
|   return 0;
| }
configure:3039: result: no
configure:3048: checking whether this-is-not-the-compiler-youre-looking-for accepts -g
configure:3068: this-is-not-the-compiler-youre-looking-for -c -g  conftest.cpp >&5
/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure: line 1633: this-is-not-the-compiler-youre-looking-for: command not found
configure:3068: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla/"
| #define PACKAGE_URL "https://www.gnu.org/software/glibc/"
| #define PKGVERSION "(GNU libc) "
| #define REPORT_BUGS_TO "<https://www.gnu.org/software/libc/bugs.html>"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3083: this-is-not-the-compiler-youre-looking-for -c   conftest.cpp >&5
/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure: line 1633: this-is-not-the-compiler-youre-looking-for: command not found
configure:3083: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla/"
| #define PACKAGE_URL "https://www.gnu.org/software/glibc/"
| #define PKGVERSION "(GNU libc) "
| #define REPORT_BUGS_TO "<https://www.gnu.org/software/libc/bugs.html>"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3099: this-is-not-the-compiler-youre-looking-for -c -g  conftest.cpp >&5
/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure: line 1633: this-is-not-the-compiler-youre-looking-for: command not found
configure:3099: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla/"
| #define PACKAGE_URL "https://www.gnu.org/software/glibc/"
| #define PKGVERSION "(GNU libc) "
| #define REPORT_BUGS_TO "<https://www.gnu.org/software/libc/bugs.html>"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3109: result: no
configure:3134: checking whether this-is-not-the-compiler-youre-looking-for can link programs
configure:3157: this-is-not-the-compiler-youre-looking-for -o conftest    -mcmodel=medlow -O2    conftest.cpp  >&5
/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure: line 1671: this-is-not-the-compiler-youre-looking-for: command not found
configure:3157: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla/"
| #define PACKAGE_URL "https://www.gnu.org/software/glibc/"
| #define PKGVERSION "(GNU libc) "
| #define REPORT_BUGS_TO "<https://www.gnu.org/software/libc/bugs.html>"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3180: this-is-not-the-compiler-youre-looking-for -o conftest    -mcmodel=medlow -O2    -static conftest.cpp  >&5
/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/glibc/configure: line 1671: this-is-not-the-compiler-youre-looking-for: command not found
configure:3180: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla/"
| #define PACKAGE_URL "https://www.gnu.org/software/glibc/"
| #define PKGVERSION "(GNU libc) "
| #define REPORT_BUGS_TO "<https://www.gnu.org/software/libc/bugs.html>"
| /* end confdefs.h.  */
| 
| #include <iostream>
| 
| int
| main()
| {
|   std::cout << "Hello, world!";
|   return 0;
| }
| 
configure:3195: result: no
configure:3735: riscv32-unknown-linux-gnu-gcc  -E  conftest.c
conftest.c:19:3: error: #error no CET compiler support
   19 | # error no CET compiler support
      |   ^~~~~
configure:3735: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla/"
| #define PACKAGE_URL "https://www.gnu.org/software/glibc/"
| #define PKGVERSION "(GNU libc) "
| #define REPORT_BUGS_TO "<https://www.gnu.org/software/libc/bugs.html>"
| #define TIMEOUTFACTOR 1
| #define HAVE_TUNABLES 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
| #ifndef __CET__
| # error no CET compiler support
| #endif
|   ;
|   return 0;
| }
configure:3859: checking for a BSD-compatible install
configure:3927: result: /usr/bin/install -c
configure:3942: checking whether ln -s works
configure:3946: result: yes
configure:4134: checking for /opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/ld
configure:4161: result: /opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/ld
configure:4176: checking version of /opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/ld
configure:4186: result: 2.40.0.20230214, ok
configure:4203: checking for gnumake
configure:4233: result: no
configure:4203: checking for gmake
configure:4219: found /usr/bin/gmake
configure:4230: result: gmake
configure:4245: checking version of gmake
configure:4255: result: 4.3, ok
configure:4267: checking for gnumsgfmt
configure:4297: result: no
configure:4267: checking for gmsgfmt
configure:4297: result: no
configure:4267: checking for msgfmt
configure:4283: found /usr/bin/msgfmt
configure:4294: result: msgfmt
configure:4309: checking version of msgfmt
configure:4319: result: 0.21, ok
configure:4330: checking for makeinfo
configure:4346: found /usr/bin/makeinfo
configure:4357: result: makeinfo
configure:4372: checking version of makeinfo
configure:4382: result: 6.8, ok
configure:4393: checking for sed
configure:4420: result: /usr/bin/sed
configure:4435: checking version of /usr/bin/sed
configure:4445: result: 4.8, ok
configure:4456: checking for gawk
configure:4483: result: /usr/bin/gawk
configure:4498: checking version of /usr/bin/gawk
configure:4508: result: 5.1.0, ok
configure:4519: checking for bison
configure:4535: found /usr/bin/bison
configure:4546: result: bison
configure:4561: checking version of bison
configure:4571: result: 3.8.2, ok
configure:4579: checking if riscv32-unknown-linux-gnu-gcc  is sufficient to build libc
configure:4599: riscv32-unknown-linux-gnu-gcc  -E  conftest.c
configure:4599: $? = 0
configure:4606: result: yes
configure:4687: checking for python3
configure:4703: found /usr/bin/python3
configure:4714: result: python3
configure:4729: checking version of python3
configure:4739: result: 3.10.12, ok
configure:4764: checking for use of fpu sysdeps directories
configure:4783: result: yes
configure:4787: checking for -fstack-protector
configure:4793: riscv32-unknown-linux-gnu-gcc     -mcmodel=medlow -O2   -Werror -fstack-protector -xc /dev/null -S -o /dev/null
configure:4796: $? = 0
configure:4804: result: yes
configure:4807: checking for -fstack-protector-strong
configure:4813: riscv32-unknown-linux-gnu-gcc     -mcmodel=medlow -O2   -Werror -fstack-protector-strong -xc /dev/null -S -o /dev/null
configure:4816: $? = 0
configure:4824: result: yes
configure:4827: checking for -fstack-protector-all
configure:4833: riscv32-unknown-linux-gnu-gcc     -mcmodel=medlow -O2   -Werror -fstack-protector-all -xc /dev/null -S -o /dev/null
configure:4836: $? = 0
configure:4844: result: yes
configure:4887: checking for assembler and linker STT_GNU_IFUNC support

Relocation section '.rela.plt' at offset 0x94 contains 1 entry:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
000110a0  0000003a R_RISCV_IRELATIVE            100a0
configure:4918: result: yes
configure:4922: checking for gcc attribute ifunc support
configure:4948: result: yes
configure:4953: checking whether the linker supports textrels along with ifunc
configure:4983: riscv32-unknown-linux-gnu-gcc     -mcmodel=medlow -O2    -nostartfiles -nostdlib -fno-stack-protector -pie -o conftest conftest.S
/opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/ld: warning: GNU indirect functions with DT_TEXTREL may result in a segfault at runtime; recompile with -fPIE
configure:4986: $? = 0
configure:4993: result: yes
configure:4998: checking for GNU attribute retain support
configure:5013: result: yes
configure:5023: checking if compiler warns about alias for function with incompatible types
conftest.c:9:34: error: 'foo_alias' alias between functions of incompatible types 'int(const void *, int)' and 'int (*(void))(const void *, int)' [-Werror=attribute-alias=]
    9 | extern __typeof (__redirect_foo) foo_alias __attribute__ ((alias ("foo")));
      |                                  ^~~~~~~~~
conftest.c:4:28: note: aliased declaration here
    4 | __typeof (__redirect_foo) *foo_impl (void)
      |                            ^~~~~~~~
cc1: all warnings being treated as errors
configure:5045: result: yes
configure:5083: checking sysdep dirs
configure:5192: error: The riscv32 is not supported.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=no
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value='riscv32-unknown-linux-gnu-gcc '
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='   -mcmodel=medlow -O2 '
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value='   -mcmodel=medlow -O2 '
ac_cv_env_CXX_set=set
ac_cv_env_CXX_value=this-is-not-the-compiler-youre-looking-for
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=riscv32-unknown-linux-gnu
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=riscv32-unknown-linux-gnu
ac_cv_objext=o
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=/usr/bin/gawk
ac_cv_prog_BISON=bison
ac_cv_prog_BUILD_CC=gcc
ac_cv_prog_CC='riscv32-unknown-linux-gnu-gcc '
ac_cv_prog_LD=/opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/ld
ac_cv_prog_MAKE=gmake
ac_cv_prog_MAKEINFO=makeinfo
ac_cv_prog_MSGFMT=msgfmt
ac_cv_prog_PYTHON_PROG=python3
ac_cv_prog_SED=/usr/bin/sed
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=no
libc_cv_compiler_default_cet=no
libc_cv_compiler_ok=yes
libc_cv_cxx_link_ok=no
libc_cv_gcc_incompatible_alias=yes
libc_cv_gcc_indirect_function=yes
libc_cv_gnu_retain=yes
libc_cv_ld_gnu_indirect_function=yes
libc_cv_nss_crypt=no
libc_cv_rtlddir=/lib
libc_cv_slibdir=/lib
libc_cv_ssp=yes
libc_cv_ssp_all=yes
libc_cv_ssp_strong=yes
libc_cv_static_nss_crypt=no
libc_cv_textrel_ifunc=yes
libc_cv_with_fp=yes
libc_cv_with_lld=no

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='/opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/ar'
ASFLAGS_config=''
AUTOCONF='no'
AWK='/usr/bin/gawk'
BASH_SHELL=''
BISON='bison'
BUILD_CC='gcc'
CC='riscv32-unknown-linux-gnu-gcc '
CFLAGS='   -mcmodel=medlow -O2 '
CPP='riscv32-unknown-linux-gnu-gcc  -E'
CPPFLAGS=''
CPPUNDEFS=''
CXX=''
CXXFLAGS='   -mcmodel=medlow -O2 '
CXX_BITS_STD_ABS_H=''
CXX_CMATH_HEADER=''
CXX_CSTDLIB_HEADER=''
CXX_SYSINCLUDES=''
DEFINES=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
GPROF='gprof'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_INFO=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD='/opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/ld'
LDFLAGS=''
LIBGD=''
LIBOBJS=''
LIBS=''
LN_S='ln -s'
LTLIBOBJS=''
MAKE='gmake'
MAKEINFO='makeinfo'
MSGFMT='msgfmt'
NM='/opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/nm'
OBJCOPY='/opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/objcopy'
OBJDUMP='/opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/objdump'
OBJEXT='o'
PACKAGE_BUGREPORT='https://sourceware.org/bugzilla/'
PACKAGE_NAME='GNU C Library'
PACKAGE_STRING='GNU C Library (see version.h)'
PACKAGE_TARNAME='glibc'
PACKAGE_URL='https://www.gnu.org/software/glibc/'
PACKAGE_VERSION='(see version.h)'
PATH_SEPARATOR=':'
PERL=''
PKGVERSION='(GNU libc) '
PKGVERSION_TEXI='(GNU libc) '
PYTHON='python3 -B'
PYTHON_PROG='python3'
READELF='/opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/12.2.0/../../../../riscv32-unknown-linux-gnu/bin/readelf'
RELEASE=''
REPORT_BUGS_TEXI='@uref{https://www.gnu.org/software/libc/bugs.html}'
REPORT_BUGS_TO='<https://www.gnu.org/software/libc/bugs.html>'
SED='/usr/bin/sed'
SHELL='/bin/bash'
SYSINCLUDES=''
VERSION=''
ac_ct_CC=''
ac_ct_CXX=''
all_warnings=''
base_machine='riscv32'
bindir='${exec_prefix}/bin'
bindnow='no'
build='x86_64-pc-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_crypt='yes'
build_nscd='default'
build_os='linux-gnu'
build_pt_chown='no'
build_vendor='pc'
cross_compiling='maybe'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
enable_timezone_tools='yes'
enable_werror='no'
exec_prefix='NONE'
experimental_malloc='yes'
extra_nonshared_cflags=''
force_install='yes'
hardcoded_path_in_tests='no'
have_libaudit=''
have_libcap=''
have_selinux=''
have_tunables='yes'
host='riscv32-unknown-linux-gnu'
host_alias='riscv32-unknown-linux-gnu'
host_cpu='riscv32'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
ldd_rewrite_script=''
libc_cv_cc_loop_to_function=''
libc_cv_cc_nofma=''
libc_cv_cc_submachine=''
libc_cv_cc_with_libunwind=''
libc_cv_complocaledir=''
libc_cv_cxx_thread_local=''
libc_cv_fpie=''
libc_cv_gcc_unwind_find_fde=''
libc_cv_has_glob_dat=''
libc_cv_insert=''
libc_cv_localstatedir=''
libc_cv_mtls_dialect_gnu2=''
libc_cv_multidir=''
libc_cv_nss_crypt='no'
libc_cv_protected_data=''
libc_cv_rootsbindir=''
libc_cv_rtlddir='/lib'
libc_cv_slibdir='/lib'
libc_cv_ssp='yes'
libc_cv_static_nss_crypt='no'
libc_cv_sysconfdir=''
libc_cv_textrel_ifunc='yes'
libc_cv_with_fp='yes'
libc_cv_z_execstack=''
libc_extra_cflags=''
libc_extra_cppflags=''
libdir='/usr/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mach_interface_list=''
mandir='${datarootdir}/man'
memory_tagging='no'
multi_arch='no'
no_stack_protector='-fno-stack-protector -DSTACK_PROTECTOR_LEVEL=0'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr'
profile='no'
program_transform_name='s,x,x,'
psdir='${docdir}'
pthread_in_libc=''
rtld_early_cflags=''
sbindir='${exec_prefix}/sbin'
shared='yes'
sharedstatedir='${prefix}/com'
stack_protector='-fno-stack-protector'
static=''
static_nss='no'
subdirs=' '
submachine=''
sysconfdir='${prefix}/etc'
sysheaders='/media/hazel/DATA[HDD]/Projects/riscv-gnu-toolchain/linux-headers/include'
sysnames=' sysdeps/unix/sysv/linux sysdeps/unix/sysv sysdeps/unix'
target_alias=''
use_default_link='no'
use_ldconfig=''
use_nscd='yes'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "GNU C Library"
#define PACKAGE_TARNAME "glibc"
#define PACKAGE_VERSION "(see version.h)"
#define PACKAGE_STRING "GNU C Library (see version.h)"
#define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla/"
#define PACKAGE_URL "https://www.gnu.org/software/glibc/"
#define PKGVERSION "(GNU libc) "
#define REPORT_BUGS_TO "<https://www.gnu.org/software/libc/bugs.html>"
#define TIMEOUTFACTOR 1
#define HAVE_TUNABLES 1
#define USE_PPC_SCV 1
#define HAVE_CC_NO_STACK_PROTECTOR 1
#define STACK_PROTECTOR_LEVEL 0
#define HAVE_GNU_RETAIN 1

configure: exit 1

I'm really not sure what I'm missing here, is there some step I skipped? Any help would be appreciated.

TommyMurphyTM1234 commented 1 year ago

Anything relevant here?

GlaireDaggers commented 1 year ago

I'm seeing reference to the fact that this could happen if I somehow had the wrong glibc version checked out, but I'm not sure how that could be the case if I cloned this repo directly from master. Just in case I tried to update the glibc submodule, which had no effect. I'm currently doing a full submodule update --init --recursive as a last ditch effort to see if that helps, but ofc it's going to take a little while.

Possibly a red flag that according to one of those I'm supposed to be seeing some kind of checking for sysdeps preconfigure fragments... line, but I see nothing of the sort in the log.

TommyMurphyTM1234 commented 1 year ago

I did this on a WSL2/Ubuntu 22.04.3 installation on which I have done several toolchain builds recently:

git clone https://github.com/riscv-collab/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=`pwd`/installed-tools --with-arch=rv32em --with-abi=ilp32e

and I got this config.log without the error that you mention: config.log

Can you try with a new/clean Virtual Machine or other installation?

In the meantime, I've kicked off a build here:

git clone https://github.com/riscv-collab/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=`pwd`/installed-tools --with-arch=rv32em --with-abi=ilp32e
make linux 2>&1 | tee build.log

Possibly a red flag that according to one of those I'm supposed to be seeing some kind of checking for sysdeps preconfigure fragments... line, but I see nothing of the sort in the log.

I don't get that either so it may be outdated info.

GlaireDaggers commented 1 year ago

Hmm, strange. I guess I can try deleting it and checking it out from scratch, and then trying the same steps on my Windows box in WSL. If the latter works I guess I'll chalk it up to Linux Mint being weird.

TommyMurphyTM1234 commented 1 year ago

I can try a Linux Mint installation/build but it might be tomorrow morning (Irish time) at this stage...

kito-cheng commented 1 year ago

Linux toolchain does not support rv32e, only bare metal toolchain support that

TommyMurphyTM1234 commented 1 year ago

Linux toolchain does not support rv32e, only bare metal toolchain support that

Ok - but the "riscv32 is not supported" issue is arising at configuration and not make/build time.

TommyMurphyTM1234 commented 1 year ago

Ah - I misunderstood this:

The problem I'm running into is that this is failing in build-glibc-linux-rv32em-ilp32e, printing "checking sysdep dirs" before displaying the error "The riscv32 is not supported". The outputs of the config.log in this folder are as follows:

I assumed that this meant the "top level" config.log. But it seems to be a lower level config.log for glibc? In that case @kito-cheng's comment is apposite. The Linux toolchain does not suport rv32e and also requires the A (Atomic) extension.

GlaireDaggers commented 1 year ago

oooh, I see! I think I misunderstood the instructions, I do believe what I actually want is a baremetal toolchain. Sorry for the misunderstanding!

TommyMurphyTM1234 commented 1 year ago

I tried a bare-metal toolchain build and it succeeded.

git clone https://github.com/riscv-collab/riscv-gnu-toolchain issue-1312
cd issue-1312
./configure --prefix=`pwd`/installed-tools --with-arch=rv32em --with-abi=ilp32e
make 2>&1 | tee build.log