aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-01-19libgloss: add per-file & per-dir flag supportMike Frysinger2-2/+14
This logic is copied from what's used in newlib today. This allows subdirs to easily define per-directory flags & per-file flags without having to setup unique automake rules for each one.
2024-01-19libgloss: add some objcopy/objdump build rulesMike Frysinger2-0/+19
A bunch of ports have manual rules to generate disassembly, srec, and binary files from test programs. Add top-level pattern rules so every test program gets this for free, and we don't have to duplicate it in every subdir.
2024-01-19libgloss: check for objcopy & objdump properlyMike Frysinger3-0/+190
A bunch of ports hack together these values rather than setting them up in the configure script for everyone.
2024-01-19Cygwin: remove warnings from testsuite buildCorinna Vinschen3-8/+4
- drop unused variable - remove deprectated usage of std::pointer_to_unary_function. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-19fputwc: call __fputwc directlyCorinna Vinschen2-2/+7
Avoid another hop in the call stack. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-19memccpy: fix pointer assignmentCorinna Vinschen1-2/+2
The local vars dst and src are unsigned pointers, but two assignments cast their value to signed explicitely. This results in the warning "pointer targets in assignment from ‘char *’ to ‘unsigned char *’ differ in signedness [-Wpointer-sign]" in case of -Wall. Fix the cast. Fixes: d254189b38bb ("2002-07-23 Jeff Johnston <jjohnstn@redhat.com>") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-19ORIENT: avoid "expression has no effect" warningCorinna Vinschen3-3/+3
The warning "right-hand operand of comma expression has no effect [-Wunused-value]" crops up with -Wall in cases where ORIENT is called without checking or assigning its value. Explicitely void the expression in these cases to avoid the warning. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-19_fputwc_r: actually return result of __fputwcCorinna Vinschen1-1/+1
Compiling with -Wall uncovered a bug in _fputwc_r introduced in commit 09119463a1445 ("stdio: split byte- and wide-char-oriented low-level output functions"). The underlying function __fputwc has been accidentally called without fetching its return value. So the return value of _fputwc_r (and thus fputwc) was undefined. Fixes: 09119463a1445 ("stdio: split byte- and wide-char-oriented low-level output functions" Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-18Cygwin: replace all `fgrep' with `grep -F'Corinna Vinschen5-8/+8
Unfortunately fgrep is now deprecated in a very pushy way. Make sure to use grep -F instead all around, even in docs and comments/ Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-17Cygwin: copy doc changes from commit 241b50a7abe2 to release notesCorinna Vinschen1-4/+4
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-16Cygwin: Update documentation for cygwin_stackdumpJon Turney1-0/+4
2024-01-16Cygwin: Treat api_fatal() similarly to a core-dumping signalJon Turney3-5/+20
Provide the same debugging opportunities for api_fatal() as we do for a core-dumping signal: 1) Break into any attached debugger 2) Start JIT debugger (if configured) (keeping these under DEBUGGING doesn't seem helpful) 3) Write a coredump (if rlim_core > 1MB) 4) Write a stackdump (if that failed, or 0 < rlim_core <= 1MB)
2024-01-16Cygwin: Define and use __WCOREFLAGJon Turney2-3/+4
Also fix a typo in description of exit status
2024-01-16Cygwin: Disable writing core dumps by default.Jon Turney3-1/+10
Change the default core limit from unlimited to 0 (disabled)
2024-01-16Cygwin: Make 'ulimit -c' control writing a coredumpJon Turney7-41/+143
Pre-format a command to be executed on a fatal error to run 'dumper' (using an absolute path). Factor out executing a pre-formatted command, so we can use that for invoking the JIT debugger in try_to_debug() (if error_start is present in the CYGWIN env var) and to invoke dumper when a fatal error occurs. On a fatal error, if the core file size limit is greater than 1MB, invoke dumper to write a core dump. Otherwise, if that limit is greater than 0, write a .stackdump file, as previously. Adjust and clarify the associated documentation. Also: Fix so that the error_start JIT debugger is now invoked, even when ulimit -c is zero. Also: Fix uses of console_printf() inside exec_prepared_command(). It's output is written via the Windows console device, so needs to use Windows-style line endings. Also: consistently return non-zero from try_to_debug() if we debugged. Future work: Truncate or remove the file written, if it exceeds the maximum size set by the ulimit. Future work: Using the words "fatal error" could probably be improved on. This means exiting on one of the "certain signals whose default action is to cause the process to terminate and produce a core dump file".
2024-01-15Cygwin: introduce close_range(2)Christian Franke7-1/+62
This function closes or sets the close-on-exec flag for a specified range of file descriptors. It is available on FreeBSD and Linux. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-01-15Cygwin: api docs: add missing fallocateCorinna Vinschen1-0/+9
Also add notes in terms of fallocate quirks. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-12Cygwin: Clarifications in 3.5 changes docJon Turney1-4/+4
2024-01-11Cygwin: path.cc: fix comment starting with // but ending in */Corinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-10Cygwin: Fix a stray '\n' in cygcheck manpageJon Turney1-1/+1
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2024-01-10RISC-V: fix setting up std streams in init_semihosting()Venkata Ramanaiah Nalamothu1-9/+10
Currently init_semihosting() assumes the return value from _open() call as the file descriptor handle and that is incorrect. The semihost _open() call returns the fdtable index returned by the __add_fdentry() for the file opened.
2024-01-08fix strverscmp comparison of digit sequence with non-digitsBrian Inglis1-3/+3
From: Rich Felker <dalias@aerifal.cx> Date: Mon, 7 Nov 2022 22:17:55 -0500 the rule that longest digit sequence not beginning with a zero is greater only applies when both sequences being compared are non-degenerate. this is spelled out explicitly in the man page, which may be deemed authoritative for this nonstandard function: "If one or both of these is empty, then return what strcmp(3) would have returned..." we were wrongly treating any sequence of digits not beginning with a zero as greater than a non-digit in the other string. Signed-off-by: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
2024-01-08RISC-V: Initialize the jvt CSRHau Hsu1-0/+11
Set symbol '__jvt_base$' as weak. So if the symbol is not set in the linker script, the address would be 0. We initialize jvt CSR only if the address is not 0. Also use csr number directly instead of using symbolic name to prevent the backward incompatible issue. psabi reference: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/2d770815dc9a8b11e61ea1abd487cb25ee56ad5e/riscv-elf.adoc#table-jump-relaxation
2024-01-08Cygwin: check remote drives for being SSDs as wellCorinna Vinschen1-1/+1
This enables automatic sparse file support for remote SSDs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-03libgloss: merge i960 into top-level MakefileMike Frysinger6-195/+168
Avoid a recursive make to speed things up a bit. I can't test this as current versions of binutils doesn't support i960.
2024-01-03libgloss: i960: delete dead/broken codeMike Frysinger1-37/+0
The i960 port has a lot of references to sim files that have never been included in the tree afaict, and thus has never worked. Delete all the code to simplify.
2024-01-03libgloss: merge v850 into top-level MakefileMike Frysinger6-206/+271
Avoid a recursive make to speed things up a bit. A v850e-elf build shows installed objects & libs produce same code.
2024-01-03libgloss: merge moxie into top-level MakefileMike Frysinger7-239/+306
Avoid a recursive make to speed things up a bit. A moxie-elf build shows installed objects & libs produce same code.
2024-01-03libgloss: moxie: delete unused/invalid assembly fileMike Frysinger1-31/+0
This is a .c file, not assembly, and it's a duplicate (same content) as the existing sim-lseek.c. Delete it since it's unused and doesn't actually compile.
2024-01-03libgloss: fix up incorrect "it's"Mike Frysinger19-30/+30
2024-01-02newlib: libc: Improved the readability of strspn with minor optimizationXiao Zeng1-1/+2
Signed-off-by: Xiao Zeng <zengxiao@eswincomputing.com>
2023-12-31Changes for newlib 4.4.0 snapshotnewlib-4.4.0Jeff Johnston5-17/+29
- bump up version to 4.4.0
2023-12-31Minor improvement to H8 startup codeJeff Law1-18/+12
Basically the startup code needs to clear memory from _edata to _end. In the past it's been done with a fairly naive copy loop. This changes the code to just call memset and let memset figure out a sensible way to handle the operation given the size and alignment requirements. I don't have performance data on this. I cobbled it together some time ago in response to seeing some of the GCC tests with larger .bss sections taking an insane amount of time to just get from _start to main. With the fixes to the H8 decoder in the simulator it may not matter nearly as much anymore. This has been in my tester for months. Naturally it does not cause any regressions in the H8 port.
2023-12-29Fix various c99/gcc-14 issues in generic libgloss codeJeff Law6-8/+13
Similar to what's been done in the ports, but this time in generic code. Add missing #includes to pick up prototypes. Add prototypes for various internal functions where needed. Fix signatures of various functions to match what's provided by the headers (read, sbrk, write, unlink). Nearly done with this effort ;-) Pushed to the trunk,
2023-12-29Fix another missing header file for mcore libglossJeff Law1-0/+1
I guess I must have missed this when working through the trivial port specific changes. This adds an include of stdlib.h to get a prototype for exit(). Pushed to the trunk.
2023-12-29libgloss: sparc: add missing m4 includeMike Frysinger5-5/+32
Commit 8d758283785042589e95c93d7899cecf28ef00ea ("libgloss: merge sparc configure script up a level") missed including the sparc acinclude.m4 file which meant none of the sparc-specific vars were propagating to the sub-makefile.
2023-12-29libgloss: xtensa: fix crt0.o ruleMike Frysinger2-37/+52
Don't hardcode a custom rule for this -- reuse libobjs_a_SOURCES which was designed for this exact scenario.
2023-12-29newlib MMIX: Fix compilation warnings that recent gcc treats as errorsHans-Peter Nilsson10-21/+30
Without this, when building with recent gcc, we'll see errors when compiling for --target mmix the first being: CC libc/sys/mmixware/libc_a-chmod.o In file included from /x/newlib/libc/sys/mmixware/chmod.c:17: /x/newlib/libc/sys/mmixware/chmod.c: In function 'chmod': /x/newlib/libc/sys/mmixware/sys/syscall.h:139:6: error: implicit declaration \ of function 'sprintf' [-Wimplicit-function-declaration] 139 | sprintf (buf, "UNIMPLEMENTED %s in %s\n", __FUNCTION__, __FILE__); \ Other warnings also quelled. * libc/sys/mmixware/sys/syscall.h: Include stdio.h, string.h and unistd.h. * libc/sys/mmixware/_exit.c: Call __unreachable after simulator exit. * libc/sys/mmixware/chown.c (chown): Match declaration in unistd.h. * libc/sys/mmixware/getpid.c (_getpid): Ditto. * libc/sys/mmixware/kill.c (_kill): Ditto. * libc/sys/mmixware/link.c (_link): Ditto. * libc/sys/mmixware/read.c (_read): Ditto. * libc/sys/mmixware/sbrk.c (_sbrk): Ditto. * libc/sys/mmixware/unlink.c (_unlink): Ditto. * libc/sys/mmixware/write.c (_write): Ditto.
2023-12-23GCN: Implement '_exit' instead of 'exit'Thomas Schwinge4-25/+24
... so that all of 'exit', '_exit', '_Exit' work. 'exit' thus becomes the standard 'newlib/libc/stdlib/exit.c'. (Getting 'atexit' functional needs further work elsewhere.) See also commit 5841b2f6a4208682264d03e3edfa0a09881932a6 "nvptx: Implement '_exit' instead of 'exit'".
2023-12-22Fix epiphany libgloss for c99/gcc-14Jeff Law9-3/+12
So in this case we mostly need to include an internal header (epiphany-syscalls.h). In a few cases an explicit prototype is added. We've also got a return with no value in a function with a non-void return type. Finally the asm_syscall interface expects a pointer as its first argument. In a few cases we've actually got an int (file descriptor) which we just cast to a void *. It's slightly more than Jeff J's pre-approval, but I think still reasonable.
2023-12-22Fix most of m32r libgloss for c99/gcc-14Jeff Law4-3/+9
Make implicit its explicit, add missing prototypes and header includes. This does not fix m32r-stub.c which needs more than the trivial work that Jeff J has pre-approved.
2023-12-22Fix mcore libgloss port for c99/gcc-14Jeff Law4-0/+9
Missing headers and prototypes, much like other ports.
2023-12-22Fix rl78 libgloss port for c99/gcc-14Jeff Law1-1/+2
Needed a prototype for SYS_write and the prototype for write was incorrect (returns an int, not a char *).
2023-12-22Fix c6x libgloss port for c99/gcc-14Jeff Law1-0/+2
Just one missing header in this case...
2023-12-22Fix ft32 libgloss for c99/gcc-14Jeff Law1-0/+1
Just one missing header for this libgloss port.
2023-12-22Fix frv libgloss bits for c99/gcc-14\Jeff Law2-0/+4
Same as we've seen elsewhere. Add missing prototype and header include.
2023-12-22Fix newlib H8/300 bits for C99/gcc-14Jeff Law1-0/+2
Similar to other patches. This adds a missing prototype and #include to some H8/300 specific code in newlib. Pushed to the trunk given Jeff J's pre-approval for these kinds of changes.
2023-12-22Fix v850 libgloss for c99/gcc-14Jeff Law6-4/+10
So the prior patch for sysnecv850 was in newlib. This time we're fixing v850 bits in libgloss. Like other patches submitted recently, this converts implicit ints to explicit ints, adds a missing prototype and header includes.
2023-12-21Fix iq2000 libgloss for c99/gcc-14Jeff Law5-4/+8
Similar to the others in this space. Make implicit ints explicit ints. Add prototype for _write in sbrk.c.
2023-12-21Optimize strpbrk.cJeff Johnston1-9/+2