Thanks Jim.
I’m using riscv32-unknown-elf-gcc 8.2.0.
I have modified configure.ac and Makefile.in to add newlib config options (–enable-newlib-io-float and --enable-newlib-io-longdouble).
When run ‘configure --with-arch=rv32imafd --with-abi=ilp32d’ get error:
stat /home/deepa/work/RISCV/sifive_newlib_config_fix/riscv-gnu-toolchain/test/gcc-newlib/rv32imafd-ilp32d.log || exit 1
stat: cannot stat ‘/home/deepa/work/RISCV/sifive_newlib_config_fix/riscv-gnu-toolchain/test/gcc-newlib/rv32imafd-ilp32d.log’: No such file or directory
Makefile:784: recipe for target ‘report-gcc-newlib’ failed
make: *** [report-gcc-newlib] Error 1
Is something missing?Please advise.
However, when run ‘configure --with-arch=rv32imafc --with-abi=ilp32f’ ,the regression tests pass.
Source File changes:
diff --git a/Makefile.in b/Makefile.in
index f4d771c…edbc5a3 100644
— a/Makefile.in
+++ b/Makefile.in
@@ -44,6 +44,8 @@ MULTILIB_FLAGS := @multilib_flags@
NEWLIB_MULTILIB_NAMES := @newlib_multilib_names@
GLIBC_MULTILIB_NAMES := @glibc_multilib_names@
GCC_CHECKING_FLAGS := @gcc_checking@
+NEWLIB_IO_FLOAT_FLAG := @newlib_io_float@
+NEWLIB_IO_LONG_DOUBLE_FLAG := @newlib_io_long_double@
XLEN := $(shell echo $(WITH_ARCH) | tr A-Z a-z | sed ‘s/.rv([0-9]).*/\1/’)
ifneq ($(XLEN),32)
@@ -468,7 +470,8 @@ stamps/build-newlib: $(srcdir)/riscv-newlib stamps/build-gcc-newlib-stage1
–target=$(NEWLIB_TUPLE)
$(CONFIGURE_HOST)
–prefix=$(INSTALL_DIR) \
diff --git a/configure.ac b/configure.ac
index af3ee85…5e90f25 100644
— a/configure.ac
+++ b/configure.ac
@@ -166,4 +166,20 @@ AS_IF([test “x$enable_gdb” != xno],
[AC_SUBST(enable_gdb, --enable-gdb)],
[AC_SUBST(enable_gdb, --disable-gdb)])
+AC_ARG_ENABLE([newlib-io-float],
- AS_HELP_STRING([–enable-newlib-io-float], [enable float type support in IO functions printf/scanf]))
-
+AS_IF([test “x$enable_newlib_io_float” = “xyes”],
+)
+
+AC_ARG_ENABLE(newlib-io-long-double,
- [AS_HELP_STRING([–disable-newlib-io-long-double], [disable long double type support in IO functions printf/scanf])],
- [],
- [enable_newlib_io_long_double=yes]
+)
+AS_IF([test “x$enable_newlib_io_long_double” != “xno”],
-
[AC_SUBST(newlib_io_long_double, --enable-newlib-io-long-double=yes)],
-
[AC_SUBST(newlib_io_long_double, --enable-newlib-io-long-double=no)]
+)
AC_OUTPUT
(END)
Thanks!