From 3b0ef808dec98b3fc36faa4f6fd7ebe7143a2f19 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Sat, 29 Dec 2018 10:19:56 +0100 Subject: [PATCH] re-merge newlib --- gcc/newlib/configure.host | 10 ++++ gcc/newlib/libc/include/sys/config.h | 57 ++++++++++++++++++--- gcc/newlib/newlib/libc/sys/phoenix/config.h | 1 - 3 files changed, 59 insertions(+), 9 deletions(-) delete mode 100644 gcc/newlib/newlib/libc/sys/phoenix/config.h diff --git a/gcc/newlib/configure.host b/gcc/newlib/configure.host index eb645868b3..5392552c19 100644 --- a/gcc/newlib/configure.host +++ b/gcc/newlib/configure.host @@ -746,6 +746,11 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID newlib_cflags="${newlib_cflags} -DHAVE_RENAME -DHAVE_SYSTEM -DMISSING_SYSCALL_NAMES" syscall_dir= ;; + m68k-apple-macos) + newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DMALLOC_PROVIDED" + newlib_cflags="${newlib_cflags} -ffunction-sections" + syscall_dir=syscalls + ;; mcore-*-*) syscall_dir=syscalls ;; @@ -813,6 +818,11 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID riscv*-*-*) syscall_dir=syscalls ;; + powerpc-*-macos) + newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DMALLOC_PROVIDED" + newlib_cflags="${newlib_cflags} -ffunction-sections" + syscall_dir=syscalls + ;; sh*-*-*) default_newlib_io_long_long="yes" syscall_dir=syscalls diff --git a/gcc/newlib/libc/include/sys/config.h b/gcc/newlib/libc/include/sys/config.h index 7ebe289336..2082dfdb18 100644 --- a/gcc/newlib/libc/include/sys/config.h +++ b/gcc/newlib/libc/include/sys/config.h @@ -4,6 +4,10 @@ #include /* floating point macros */ #include /* POSIX defs */ +#ifdef __aarch64__ +#define MALLOC_ALIGNMENT 16 +#endif + /* exceptions first */ #if defined(__H8500__) || defined(__W65__) #define __SMALL_BITFIELDS @@ -71,6 +75,10 @@ #define _POINTER_INT short #endif +#if defined(__m68k__) || defined(__mc68000__) || defined(__riscv) +#define _READ_WRITE_RETURN_TYPE _ssize_t +#endif + #ifdef ___AM29K__ #define _FLOAT_RET double #endif @@ -84,7 +92,6 @@ /* we want the reentrancy structure to be returned by a function */ #define __DYNAMIC_REENT__ #define HAVE_GETDATE -#define _HAVE_SYSTYPES #define _READ_WRITE_RETURN_TYPE _ssize_t #define __LARGE64_FILES 1 /* we use some glibc header files so turn on glibc large file feature */ @@ -141,6 +148,22 @@ #define __BUFSIZ__ 16 #define _REENT_SMALL #endif + +#if defined __MSP430__ +#ifndef _REENT_SMALL +#define _REENT_SMALL +#endif + +#define __BUFSIZ__ 256 +#define __SMALL_BITFIELDS + +#ifdef __MSP430X_LARGE__ +#define _POINTER_INT long +#else +#define _POINTER_INT int +#endif +#endif + #ifdef __m32c__ #define __SMALL_BITFIELDS #undef INT_MAX @@ -162,6 +185,10 @@ #define __CUSTOM_FILE_IO__ #endif +#if defined(__or1k__) || defined(__or1knd__) +#define __DYNAMIC_REENT__ +#endif + /* This block should be kept in sync with GCC's limits.h. The point of having these definitions here is to not include limits.h, which would pollute the user namespace, while still using types of the @@ -205,20 +232,16 @@ #if defined(__CYGWIN__) #include -#if !defined (__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) -#define __USE_XOPEN2K 1 -#endif #endif #if defined(__rtems__) #define __FILENAME_MAX__ 255 #define _READ_WRITE_RETURN_TYPE _ssize_t +#define __DYNAMIC_REENT__ +#define _REENT_GLOBAL_ATEXIT +#define _REENT_GLOBAL_STDIO_STREAMS #endif - -#define _READ_WRITE_BUFSIZE_TYPE unsigned long -#define _READ_WRITE_RETURN_TYPE _ssize_t - #ifndef __EXPORT #define __EXPORT #endif @@ -233,6 +256,12 @@ #ifndef _READ_WRITE_RETURN_TYPE #define _READ_WRITE_RETURN_TYPE int #endif +/* Define `count' parameter of read/write routines. In POSIX, the `count' + parameter is "size_t" but legacy newlib code has been using "int" for some + time. If not specified, "int" is defaulted. */ +#ifndef _READ_WRITE_BUFSIZE_TYPE +#define _READ_WRITE_BUFSIZE_TYPE int +#endif #ifndef __WCHAR_MAX__ #if __INT_MAX__ == 32767 || defined (_WIN32) @@ -248,6 +277,18 @@ #endif #endif +#ifdef _WANT_REENT_GLOBAL_STDIO_STREAMS +#ifndef _REENT_GLOBAL_STDIO_STREAMS +#define _REENT_GLOBAL_STDIO_STREAMS +#endif +#endif + +#ifdef _WANT_USE_LONG_TIME_T +#ifndef _USE_LONG_TIME_T +#define _USE_LONG_TIME_T +#endif +#endif + /* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended charsets. The extended charsets add a few functions and a couple of tables of a few K each. */ diff --git a/gcc/newlib/newlib/libc/sys/phoenix/config.h b/gcc/newlib/newlib/libc/sys/phoenix/config.h deleted file mode 100644 index 431e26805c..0000000000 --- a/gcc/newlib/newlib/libc/sys/phoenix/config.h +++ /dev/null @@ -1 +0,0 @@ -/* Place holder for future configuration information. */