URL
https://opencores.org/ocsvn/hf-risc/hf-risc/trunk
Subversion Repositories hf-risc
[/] [hf-risc/] [trunk/] [tools/] [riscv-gnu-toolchain-master/] [patches/] [newlib] - Rev 13
Compare with Previous | Blame | View Log
--- original-newlib/libgloss/configure
+++ newlib/libgloss/configure
@@ -678,6 +678,7 @@ sparc_leon
sparc
wince
mips
+riscv
rs6000
mn10200
mn10300
@@ -2449,6 +2450,10 @@ case "${target}" in
subdirs="$subdirs mips"
;;
+ riscv*-*-*)
+ subdirs="$subdirs riscv"
+
+ ;;
powerpc-*-*|powerpcle-*-*)
subdirs="$subdirs rs6000"
--- original-newlib/libgloss/configure.in
+++ newlib/libgloss/configure.in
@@ -75,6 +75,9 @@ case "${target}" in
mips*-*-*)
AC_CONFIG_SUBDIRS([mips])
;;
+ riscv*-*-*)
+ AC_CONFIG_SUBDIRS([riscv])
+ ;;
powerpc-*-*|powerpcle-*-*)
AC_CONFIG_SUBDIRS([rs6000])
;;
--- original-newlib/newlib/configure.host
+++ newlib/newlib/configure.host
@@ -210,6 +210,10 @@ case "${host_cpu}" in
mep)
machine_dir=mep
;;
+ riscv*)
+ machine_dir=riscv
+ newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED"
+ ;;
mips*)
machine_dir=mips
;;
--- original-newlib/newlib/libc/include/machine/ieeefp.h
+++ newlib/newlib/libc/include/machine/ieeefp.h
@@ -170,6 +170,14 @@
#define __IEEE_LITTLE_ENDIAN
#endif
+#ifdef __riscv__
+# ifdef _RISCVEL
+# define __IEEE_LITTLE_ENDIAN
+# else
+# define __IEEE_BIG_ENDIAN
+# endif
+#endif
+
#ifdef __i960__
#define __IEEE_LITTLE_ENDIAN
#endif
--- original-newlib/newlib/libc/include/machine/setjmp.h
+++ newlib/newlib/libc/include/machine/setjmp.h
@@ -338,6 +338,11 @@ _BEGIN_STD_C
#define _JBLEN 0x44
#endif
+#ifdef __riscv__
+#define _JBTYPE long
+#define _JBLEN ((16*sizeof(long) + 12*sizeof(double))/sizeof(long))
+#endif
+
#ifdef _JBLEN
#ifdef _JBTYPE
typedef _JBTYPE jmp_buf[_JBLEN];
--- original-newlib/newlib/libc/include/sys/config.h
+++ newlib/newlib/libc/include/sys/config.h
@@ -75,7 +75,7 @@
#define _POINTER_INT short
#endif
-#if defined(__m68k__) || defined(__mc68000__)
+#if defined(__m68k__) || defined(__mc68000__) || defined(__riscv__)
#define _READ_WRITE_RETURN_TYPE _ssize_t
#endif
--- original-newlib/newlib/libc/include/sys/types.h
+++ newlib/newlib/libc/include/sys/types.h
@@ -147,6 +147,9 @@ typedef char * caddr_t;
#define __caddr_t_defined
#endif
+#ifdef __ino_t_defined
+typedef __ino_t ino_t;
+#else
#ifndef __CYGWIN__
#if defined(__MS_types__) || defined(__rtems__) || \
defined(__sparc__) || defined(__SPU__)
@@ -155,6 +158,7 @@ typedef unsigned long ino_t;
typedef unsigned short ino_t;
#endif
#endif /*__CYGWIN__*/
+#endif /*__ino_t_defined*/
#ifdef __MS_types__
typedef unsigned long vm_offset_t;
@@ -197,6 +201,9 @@ typedef int pid_t;
typedef _mode_t mode_t;
#endif
+#ifdef __mode_t_defined
+typedef __mode_t mode_t;
+#else
#ifndef __CYGWIN__
typedef long key_t;
#endif
@@ -218,8 +225,13 @@ typedef unsigned int mode_t _ST_INT32;
#endif
#endif /* ! __MS_types__ */
#endif /*__CYGWIN__*/
+#endif /*__mode_t_defined*/
+#ifdef __nlink_t_defined
+typedef __nlink_t nlink_t;
+#else
typedef unsigned short nlink_t;
+#endif /*__nlink_t_defined*/
/* We don't define fd_set and friends if we are compiling POSIX
source, or if we have included (or may include as indicated
--- original-newlib/newlib/libc/machine/configure
+++ newlib/newlib/libc/machine/configure
@@ -811,6 +811,7 @@ m88k
mep
microblaze
mips
+riscv
mn10200
mn10300
moxie
@@ -11882,6 +11883,8 @@ subdirs="$subdirs a29k"
;;
mips) subdirs="$subdirs mips"
;;
+ riscv) subdirs="$subdirs riscv"
+ ;;
mn10200) subdirs="$subdirs mn10200"
;;
mn10300) subdirs="$subdirs mn10300"
--- original-newlib/newlib/libc/machine/configure.in
+++ newlib/newlib/libc/machine/configure.in
@@ -50,6 +50,7 @@ if test -n "${machine_dir}"; then
mep ) AC_CONFIG_SUBDIRS(mep) ;;
microblaze ) AC_CONFIG_SUBDIRS(microblaze) ;;
mips) AC_CONFIG_SUBDIRS(mips) ;;
+ riscv) AC_CONFIG_SUBDIRS(riscv) ;;
mn10200) AC_CONFIG_SUBDIRS(mn10200) ;;
mn10300) AC_CONFIG_SUBDIRS(mn10300) ;;
moxie) AC_CONFIG_SUBDIRS(moxie) ;;