Commit Graph

177 Commits

Author SHA1 Message Date
Giacomo Tesio b674052101 Merge of upstream-master 2019-08-12 01:41:02 +02:00
Jeff Johnston 007bc1923c Add gfortran support for AMD GCN
From: Kwok Cheung Yeung <kcy@codesourcery.com>

This patch adds enough support for constructors/destructors and OS functions
to be able to link and run gfortran programs on AMD GCN.

There's no actual ability to do I/O operations on this targets, besides
"write" to stdout and stderr, so most of the functions are just stubs.
2019-06-07 13:55:43 -04:00
Jeff Johnston 1787e9d033 AMD GCN Port contributed by Andrew Stubbs <ams@codesourcery.com>
Add support for the AMD GCN GPU architecture.  This is primarily intended for
use with OpenMP and OpenACC offloading.  It can also be used for stand-alone
programs, but this is intended mostly for testing the compiler and is not
expected to be useful in general.

The GPU architecture is highly parallel, and therefore Newlib must be
configured to use dynamic re-entrancy, and thread-safe malloc.

The only I/O available is a via a shared-memory interface provided by libgomp
and the gcn-run tool included with GCC.  At this time this is limited to
stdout, argc/argv, and the return code.
2019-01-15 10:48:08 -05:00
Giacomo Tesio a000564873 jehanne: merge upstream changes 2018-11-26 16:27:49 +01:00
Stafford Horne 8ac94ca7bb newlib/configure.host: Set have_init_fini to no for OpenRISC
The new GCC port for OpenRISC will use the init_fini_array only and not
provide the init() and fini() functions.  Disable the function usage by
default as its no longer needed.

Signed-off-by: Stafford Horne <shorne@gmail.com>
2018-11-05 10:02:20 +01:00
Sebastian Huber 5835688440 RTEMS: Use function and data sections
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-10-22 11:26:39 +02:00
Christophe Lyon f53ce01125 Define _COMPILING_NEWLIB on aarch64 to define function prototypes from unistd.h.
2018-10-01  Christophe Lyon  <christophe.lyon@linaro.org>

    	* newlib/configure.host: Define _COMPILING_NEWLIB for aarch64.
2018-10-05 13:27:34 +01:00
Hans-Peter Nilsson e3ddbeb84c Committed, CRIS port: fix fallout from time_t defaulting to 64 bits, part 2
It's been a while...  I see the CRIS port broke with the
time_t-default-to-64-bit change, observable by a few test-cases in the gcc
fortran(!) tests failing, regressing when trying a recent newlib.

This is a two-part belt-and-suspenders change: adjust the CRIS port
gettimeofday syscall (the only one in newlib/CRIS passing a time_t or
struct timeval) to handle a userspace 64-bit time_t and secondly default
time_t to 32-bit long anyway.  I considered making the local
"kernel_timeval" copy in _gettimeofday conditional on (userspace) time_t
being 64 bits, but thought it not worth bothering with the few move insns.
The effect of a 64-bit time_t is however observable as longer simulation
time when running the gcc testsuite and as bigger binaries without any
actual upside from the larger time_t size, so I thought better make the
default for this port go back to being a "long" again.

Tested by running the gcc testsuite over the three combinations of two
parts of the patch and observing the expected changes.  Committed.

newlib:
	* configure.host (cris, crisv32): Default to "long" time_t.

Signed-off-by: Hans-Peter Nilsson <hp@axis.com>
2018-09-13 17:58:01 +02:00
Jon Beniston a9cfb33b6c Add --disable-newlib-fno-builtin to allow compilation without -fno-builtin for smaller and faster code. 2018-08-31 15:40:42 -04:00
Sebastian Huber 6158b30e3e RISC-V: Do not use _init/_fini
Introduce new host configuration variable "have_init_fini" which is set
to "yes" by default.  Override it for RISC-V to "no".

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-07-30 10:47:57 +02:00
Jeff Johnston cd31fbb2ae Add nvptx port.
- From: Cesar Philippidis <cesar@codesourcery.com>
  Date: Tue, 10 Apr 2018 14:43:42 -0700
  Subject: [PATCH] nvptx port

  This port adds support for Nvidia GPU's, which are primarily used as
  offload accelerators in OpenACC and OpenMP.
2018-04-13 15:42:37 -04:00
Jaap de Wolff fdc5f52808 Add define _COMPILING_NEWLIB for arm to configure.host, as it is obviously needed
Signed-off-by: Jaap de Wolff <jaap@stretch.de-wolff.org>
2018-02-16 12:16:07 +01:00
Jim Wilson a6633677b9 RISC-V: Add nanosleep functionality 2017-12-26 12:24:45 -08:00
Joel Sherrill b1a388799d newlib/.../getreent.c: Allow to be provided by host and do so for RTEMS
RTEMS provides the option to have a global or per-thread reentrancy
as part of application configuration. As part of this, RTEMS provides
the implementation of __getreent() as appropriate. Allow the target
to determine if this method is present in libc.a.
2017-11-13 10:19:23 +01:00
Joel Sherrill 076ce7098f newlib/configure.host: Remove obsolete definition of _I386MACH_ALLOW_HW_INTERRUPTS
The *-*-rtems* targets defined this even though the conditional
was no longer present in i386/setjmp.S.
2017-11-02 09:27:15 +01:00
Giacomo Tesio 8a57809fe4 jehanne: add fcntl 2017-09-27 00:39:07 +02:00
Giacomo Tesio 95383ee144 jehanne: define SIGNAL_PROVIDED in configure.host 2017-09-14 00:07:08 +02:00
Sebastian Huber f9205f1d47 Let RTEMS provide clock()
Newlib uses _times_r() in clock().  The problem is that the _times_r()
clock frequency is defined by sysconf(_SC_CLK_TCK).  The clock frequency
of clock() is the constant CLOCKS_PER_SEC.

FreeBSD uses getrusage() for clock().  Since RTEMS has only one process,
the implementation can be simplified.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-09-07 07:41:07 +02:00
Giacomo Tesio 185a319fdc jehanne: enable posix and unix functions in configure.host 2017-08-21 00:15:07 +02:00
Giacomo Tesio 075aeba3a9 jehanne: enable posix build 2017-08-19 16:09:36 +02:00
Giacomo Tesio 8fbd328317 jehanne: first try to enable posix (BROKEN) 2017-08-18 01:02:24 +02:00
Giacomo Tesio 1680e696ac Merge branch 'upstream-master' 2017-08-17 22:40:51 +02:00
Kito Cheng 363dbb9e44 Add RISC-V port for newlib
Contributor list:
    - Andrew Waterman  <andrew@sifive.com>
    - Palmer Dabbelt  <palmer@dabbelt.com>
    - Kito Cheng  <kito.cheng@gmail.com>
    - Scott Beamer  <sbeamer@eecs.berkeley.edu>
2017-08-16 18:00:58 -04:00
Giacomo Tesio 6ba8da3d11 jehanne: use upstream print functions with -O0 and --disable-newlib-fvwrite-in-streamio 2017-04-27 23:48:43 +02:00
Giacomo Tesio 595d23fca2 jehanne: fix uio initializations; disable optimizations in print related functions 2017-04-21 21:27:35 +02:00
Giacomo Tesio 0f0315dbff jehanne: initial port 2017-04-18 23:43:16 +02:00
Jeff Johnston 93f5d7c739 Add port for Phoenix-RTOS in common configure files. 2016-05-09 15:23:58 -04:00
Igor Venevtsev 5d3ad3b123 Add Intel MCU target
Intel MCU System V ABI are incompartible with i386 System V ABI:
    o Minimum instruction set is Intel Pentium ISA minus x87 instructions
    o No x87 or vector registers
    o First three args are passed in %eax, %edx and %ecx
    o Full specification available here:
      https://github.com/hjl-tools/x86-psABI/wiki/iamcu-psABI-0.7.pdf

newlib/
    * configure.host: Add new ix86-*-elfiamcu target

newlib/libc/include/
    * setjmp.h: Change _JBLEN for Intel MCU target

newlib/libc/machine/i386/
    * memchr.S:  (memchr)  Target-specific size-optimized version
    * memcmp.S:  (memcmp)  Likewise
    * memcpy.S:  (memcpy)  Likewise
    * memmove.S: (memmove) Likewise
    * memset.S:  (memset)  Likewise
    * setjmp.S:  (setjmp)  Likewise
    * strchr.S:  (strchr)  Likewise
    * strlen.S:  (strlen)  Likewise

newlib/libc/stdlib/
    * srtold.c:  (__flt_rounds) Disable for Intel MCU
2016-04-04 16:32:07 +02:00
Joel Sherrill 4db48d17eb newlib/configure.host: Turn off sti/cli for i386 setjmp for i386-rtems*
When running RTEMS paravirtualized in user space, the cli/sti instructions
can't be used. But I can't see why they are needed in either user or
supervisor state. Turning the use of them off for RTEMS.

This code is unmodified since the beginning of the repository, so I have
no insight into why it was done. I may even have been the one to add them.
Absolutely no idea except they aren't necessary.
2016-03-22 09:45:08 -05:00
Corinna Vinschen b9217601f8 Enable HW interrupt setup on x86/x86_64 systems by default
* configure.host: Define _I386MACH_DISABLE_HW_INTERRUPTS on rdos.
	Remove setting _I386MACH_ALLOW_HW_INTERRUPTS anywhere else.
	* libc/machine/i386/i386mach.h: Replace test for
	_I386MACH_ALLOW_HW_INTERRUPTS with test for
	!_I386MACH_DISABLE_HW_INTERRUPTS.
	* libc/machine/x86_64/x86_64mach.h: Ditto.
	* libc/sys/linux/machine/i386/i386mach.h: Ditto.
	* libm/machine/i386/i386mach.h: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-02-26 18:52:46 +01:00
Joel Sherrill 678f774727 newlib/configure.host: Turn off sti/cli for i386 setjmp for i386-rtems* 2016-02-25 14:11:27 -06:00
Anton Kolesov c0a99f0293 Add support for ARC to newlib
newlib/ChangeLog:
2015-11-12  Anton Kolesov  <Anton.Kolesov@synopsys.com>

	* configure.host: Add ARC support.
	* libc/include/machine/setjmp.h: Likewise.
	* libc/machine/configure: Likewise.
	* libc/machine/configure.in: Likewise.
	* libc/machine/arc/Makefile.am: Likewise.
	* libc/machine/arc/Makefile.in: Likewise.
	* libc/machine/arc/aclocal.m4: Likewise.
	* libc/machine/arc/asm.h: Likewise.
	* libc/machine/arc/configure: Likewise.
	* libc/machine/arc/configure.in: Likewise.
	* libc/machine/arc/memcmp-bs-norm.S: Likewise.
	* libc/machine/arc/memcmp-stub.c: Likewise.
	* libc/machine/arc/memcmp.S: Likewise.
	* libc/machine/arc/memcpy-archs.S: Likewise.
	* libc/machine/arc/memcpy-bs.S: Likewise.
	* libc/machine/arc/memcpy-stub.c: Likewise.
	* libc/machine/arc/memcpy.S: Likewise.
	* libc/machine/arc/memset-archs.S: Likewise.
	* libc/machine/arc/memset-bs.S: Likewise.
	* libc/machine/arc/memset-stub.c: Likewise.
	* libc/machine/arc/memset.S: Likewise.
	* libc/machine/arc/setjmp.S: Likewise.
	* libc/machine/arc/strchr-bs-norm.S: Likewise.
	* libc/machine/arc/strchr-bs.S: Likewise.
	* libc/machine/arc/strchr-stub.c: Likewise.
	* libc/machine/arc/strchr.S: Likewise.
	* libc/machine/arc/strcmp-archs.S: Likewise.
	* libc/machine/arc/strcmp-stub.c: Likewise.
	* libc/machine/arc/strcmp.S: Likewise.
	* libc/machine/arc/strcpy-bs-arc600.S: Likewise.
	* libc/machine/arc/strcpy-bs.S: Likewise.
	* libc/machine/arc/strcpy-stub.c: Likewise.
	* libc/machine/arc/strcpy.S: Likewise.
	* libc/machine/arc/strlen-bs-norm.S: Likewise.
	* libc/machine/arc/strlen-bs.S: Likewise.
	* libc/machine/arc/strlen-stub.c: Likewise.
	* libc/machine/arc/strlen.S: Likewise.
	* libc/machine/arc/strncpy-bs.S: Likewise.
	* libc/machine/arc/strncpy-stub.c: Likewise.
	* libc/machine/arc/strncpy.S: Likewise.
2015-11-12 14:14:17 +01:00
Anton Kolesov e945a19cb2 Remove obsolete ARC system
ARC architecture specific files has been added ages ago in newlib/libc/sys,
but with invention of libgloss those files should be moved from newlib to
libgloss.

newlib/ChangeLog:
2015-11-12  Anton Kolesov  <Anton.Kolesov@synopsys.com>

	* configure.host: Remove ARC system.
	* libc/sys/configure: Likewise.
	* libc/sys/configure.in: Likewise.
	* libc/sys/arc/Makefile.am: Likewise.
	* libc/sys/arc/Makefile.in: Likewise.
	* libc/sys/arc/aclocal.m4: Likewise.
	* libc/sys/arc/configure: Likewise.
	* libc/sys/arc/configure.in: Likewise.
	* libc/sys/arc/crt0.S: Likewise.
	* libc/sys/arc/dummy.S: Likewise.
	* libc/sys/arc/isatty.c: Likewise.
	* libc/sys/arc/mem-layout.c: Likewise.
	* libc/sys/arc/sbrk.c: Likewise.
	* libc/sys/arc/sys/syscall.h: Likewise.
	* libc/sys/arc/syscalls.c: Likewise.
2015-11-12 14:03:05 +01:00
Jeff Johnston f296bb3569 Minimize newlib code size for ft32
* configure.host (ft32): minimise newlib code size
2015-09-22 18:12:23 -04:00
Jeff Johnston 948b5f0043 Add support for ft32 to newlib. 2015-09-04 14:37:37 -04:00
Eric Botcazou bf8f43ae8a * COPYING.LIBGLOSS: Add Controls and Data Services copyright.
* COPYING.NEWLIB: Likewise.
libgloss/
	* configure.in: Add Visium support.
	* configure: Regenerate.
	* visium/: New directory.
newlib/
	* configure.host: Add Visium support.
	* libc/machine/configure.in: Likewise.
	* libc/machine/configure: Regenerate.
	* libc/machine/visium/: New directory.
	* libc/include/machine/setjmp.h (_JBLEN): Define for Visium.
	* libc/include/machine/ieeefp.h (__IEEE_BIG_ENDIAN): Likewise.
	* libc/include/machine/time.h (_CLOCKS_PER_SEC_): Likewise.
2015-01-21 18:27:47 +00:00
Corinna Vinschen d0695096ba * configure.host: Add extra system for OpenRISC baremetal. 2015-01-20 09:59:40 +00:00
Corinna Vinschen 0cbcde7bdb * configure.host: Add libm nds32 machine directory.
* libm/machine/configure: Regenerated.
	* libm/machine/configure.in: Add nds32 AC_CONFIG.
	* libm/machine/nds32/Makefile.am: New file.
	* libm/machine/nds32/Makefile.in: Generated.
	* libm/machine/nds32/aclocal.m4: Generated.
	* libm/machine/nds32/configure: Generated.
	* libm/machine/nds32/configure.in: New file.
	* libm/machine/nds32/w_sqrt.S: New file.
	* libm/machine/nds32/wf_sqrt.S: New file.
2014-12-15 13:27:38 +00:00
Jeff Johnston f58bc5991f 2014-12-12 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
* configure.host: or1knd support, OpenRISC without delay slot
        * libc/include/machine/setjmp.h: Add or1knd
        * libc/machine/or1k/setjmp.S: Optional delay slot
2014-12-12 21:14:06 +00:00
Nick Clifton d5692c713f PR target/63901
* configure.host (msp430): Add -mhwmult=none to newlib_cflags.
2014-11-21 11:55:39 +00:00
Anthony Green 0a0f33e501 Add moxiebox support. 2014-07-27 14:37:10 +00:00
Corinna Vinschen 81fd6210c0 * configure.host: Remove or16 and or32 targets and add or1k.
* libc/include/machine/ieeefp.h: Replace or32 with or1k.
	* libc/machine/configure.in: Add or1k subdirectory.
	* libc/machine/or1k/configure.in: New file.
	* libc/machine/or1k/Makefile.am: New file.
	* libc/machine/or1k/setjmp.S: New file.
2014-07-17 18:43:05 +00:00
DJ Delorie d043b4c527 * configure.host (default_newlib_nano_malloc): New.
(msp430): Set it.
* configure.in (newlib_nano_malloc): Leave unset if not set by
the user.
* configure: Regenerate.
* libc/configure.in (NEWLIB_NANO_MALLOC): Set after running
configure.host.
(newlib_nano_malloc): Leave unset if not set by	the user.
* libc/configure: Regenerate.
2014-06-10 03:09:35 +00:00
Jeff Johnston d3925b72d5 2014-04-04 Ashish Kapania <akapania@ti.com>
* configure.host (sys_dir, newlib_cflags): Set sys_dir to tirtos and use
        -D__DYNAMIC_REENT__ and -DMALLOC_PROVIDED compiler options for TIRTOS
        target.
        * libc/stdio/local.h (_STDIO_CLOSE_PER_REENT_STD_STREAMS): Change #ifdef
        to not define this macro when __tirtos__ is defined.
        * libc/sys/tirtos : Add support for TIRTOS.
        * libc/sys/tirtos/Makefile.am, libc/sys/tirtos/lock.c: New files.
        * libc/sys/tirtos/configure.in, libc/sys/tirtos/include/sys/lock.h: Ditto.
2014-04-04 21:40:59 +00:00
Nick Clifton 57cfbb7bbf * configure.host (newlib_cflags): Use -Os, -ffunction-sections and
-fdata-sections for RL78.
2013-12-20 10:27:49 +00:00
Jeff Johnston c7c1a1ca1b 2013-10-01 Petr Hosek <phosek@chromium.org>
* configure.host: Disable new posix_spawn function for all
        users of posix dir except Cygwin.
        * libc/posix/Makefile.am: Add support for new posix_spawn function.
        * libc/posix/Makefile.in: Regenerate.
        * libc/posix/posix_spawn.c: New file.
        * libc/include/spawn.h: Ditto.
2013-10-01 18:08:46 +00:00
Corinna Vinschen 6041792ec6 * configure.host: Change to microblaze*.
* libc/include/machine/ieeefp.h: Add __MICROBLAZEEL__.
	* libc/machine/microblaze/mb_endian.h: New file.
	* newlib/libc/machine/microblaze/strcmp.c: Add little endian support.
	* newlib/libc/machine/microblaze/strcpy.c: Likewise.
	* newlib/libc/machine/microblaze/strlen.c: Likewise.

	* configure.in: Change to microblaze*.
	* configure: Regenerate.
	* microblaze/xilinx.ld: Remove OUTPUT_FORMAT.
2013-07-16 07:48:53 +00:00
Jeff Johnston dc0cb474bb 2013-07-09 Sabrina Ni <sabrina@andestech.com>
* configure.host (machine_dir, syscall_dir, newlib_cflags):
        Add settings for nds32*.
        * libc/include/machine/ieeefp.h (IEEE_BIG_ENDIAN, IEEE_LITTLE_ENDIAN):
        Ditto.
        * libc/include/machine/setjmp.h (JBLEN): Ditto.
        * libc/machine/configure.in: Add nds32 subdir.
        * libc/machine/configure: Regenerated.
        * libc/machine/nds32/Makefile.am: New.
        * libc/machine/nds32/Makefile.in: New (autogenerated).
        * libc/machine/nds32/aclocal.m4: New (autogenerated).
        * libc/machine/nds32/configure.in: New.
        * libc/machine/nds32/configure: New (autogenerated).
        * libc/machine/nds32/setjmp.S: New.
2013-07-09 19:06:47 +00:00
DJ Delorie 2f2a304234 [newlib]
* configure.host (msp430): Add.
* libc/include/machine/ieeefp.h: Add MSP430 support.
* libc/include/machine/setjmp.h: Likewise.
* libc/include/sys/config.h: Likewise.
* libc/machine/configure.in (msp430): Add.
* libc/machine/configure: Regenerate.
* libc/machine/msp430: New directory.

[libgloss]
* configure.in (msp430*-*-elf): Add.
* configure: Regenerate.
* msp430: New directory.
2013-05-13 21:39:51 +00:00
Jeff Johnston c16862d85b 2013-05-06 Sandra Loosemore <sandra@codesourcery.com>
* configure.host (machine_dir, sys_dir, syscall_dir, newlib_cflags):
        Add settings for nios2*.
        * libc/include/machine/ieeefp.h (IEEE_BIG_ENDIAN, IEEE_LITTLE_ENDIAN):
        Likewise.
        * libc/include/machine/setjmp.h (JBLEN, JBTYPE): Likewise.
        * libc/machine/configure.in: Add nios2 subdir.
        * libc/machine/configure: Regenerated.
        * libc/machine/nios2/Makefile.am: New.
        * libc/machine/nios2/Makefile.in: New (autogenerated).
        * libc/machine/nios2/aclocal.m4: New (copied from mips version).
        * libc/machine/nios2/configure.in: New.
        * libc/machine/nios2/configure: New (autogenerated).
        * libc/machine/nios2/setjmp.s: New.
2013-05-06 18:23:09 +00:00