]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
7 months agolibgloss: merge xc16x into top-level Makefile users/vapier/wip github/users/vapier/wip
Mike Frysinger [Sat, 30 Dec 2023 02:24:58 +0000 (21:24 -0500)]
libgloss: merge xc16x into top-level Makefile

Avoid a recursive make to speed things up a bit.
Untested as this target has never been merged into gcc.

7 months agolibgloss: merge microblaze into top-level Makefile
Mike Frysinger [Sun, 31 Dec 2023 06:51:47 +0000 (01:51 -0500)]
libgloss: merge microblaze into top-level Makefile

Avoid a recursive make to speed things up a bit.
A microblaze-elf build shows installed objects & libs produce same code.

7 months agolibgloss: microblaze: use port-specific sbrk
Mike Frysinger [Sun, 31 Dec 2023 07:07:04 +0000 (02:07 -0500)]
libgloss: microblaze: use port-specific sbrk

The default search path uses the common sbrk.c over the microblaze
one, so add a rule to force the microblaze variant instead.

7 months agolibgloss: merge tic6x into top-level Makefile
Mike Frysinger [Sun, 31 Dec 2023 06:41:30 +0000 (01:41 -0500)]
libgloss: merge tic6x into top-level Makefile

Avoid a recursive make to speed things up a bit.
A tic6x-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge sparc_leon into top-level Makefile
Mike Frysinger [Fri, 29 Dec 2023 07:10:36 +0000 (02:10 -0500)]
libgloss: merge sparc_leon into top-level Makefile

Avoid a recursive make to speed things up a bit.
A sparc-elf build shows installed objects & libs produce same code.

7 months agolibgloss: sparc_leon: workaround newer newlib pthread APIs
Mike Frysinger [Fri, 29 Dec 2023 22:52:31 +0000 (17:52 -0500)]
libgloss: sparc_leon: workaround newer newlib pthread APIs

Fix a compile error due to duplicate pthreads types:
.../libgloss/sparc_leon/mutex.c:50:8: error: conflicting types for ‘pthread_mutex_t’; have ‘struct pthread_mutex’
   50 |      } pthread_mutex_t;
In file included from .../newlib/libc/include/sys/types.h:221,
                 from .../libgloss/sparc_leon/mutex.c:26:
.../newlib/libc/include/sys/_pthreadtypes.h:154:20: note: previous declaration of ‘pthread_mutex_t’ with type ‘pthread_mutex_t’ {aka ‘long unsigned int’}
  154 | typedef __uint32_t pthread_mutex_t;      /* identify a mutex */

.../libgloss/sparc_leon/mutex.c:57:8: error: conflicting types for ‘pthread_mutexattr_t’; have ‘struct <anonymous>’
   57 |      } pthread_mutexattr_t;
../newlib/libc/include/sys/_pthreadtypes.h:169:3: note: previous declaration of ‘pthread_mutexattr_t’ with type ‘pthread_mutexattr_t’
  169 | } pthread_mutexattr_t;

7 months agolibgloss: merge sparc into top-level Makefile
Mike Frysinger [Fri, 29 Dec 2023 05:42:13 +0000 (00:42 -0500)]
libgloss: merge sparc into top-level Makefile

Avoid a recursive make to speed things up a bit.
A sparc-elf build shows installed objects & libs produce same code.

7 months agolibgloss: sparc: always install erc32 sim files
Mike Frysinger [Fri, 29 Dec 2023 06:31:10 +0000 (01:31 -0500)]
libgloss: sparc: always install erc32 sim files

These are already compiled for all sparc targets, so we might as well
install them all the time so they can be used with the erc32 sim.

7 months agolibgloss: merge ft32 into top-level Makefile
Mike Frysinger [Fri, 29 Dec 2023 05:16:46 +0000 (00:16 -0500)]
libgloss: merge ft32 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A ft32-elf build shows installed objects & libs produce same code.

Mention of ft32-elf-common.ld is dropped as it has never existed
in the tree, and has been an (ignored) error in the past.

7 months agolibgloss: ft32: delete unused/invalid assembly file
Mike Frysinger [Fri, 29 Dec 2023 05:20:10 +0000 (00:20 -0500)]
libgloss: ft32: delete unused/invalid assembly file

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.

7 months agolibgloss: merge fr30 into top-level Makefile
Mike Frysinger [Fri, 29 Dec 2023 05:11:38 +0000 (00:11 -0500)]
libgloss: merge fr30 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A fr30-elf build shows installed objects & libs produce same code.

A lot of code seems like it hasn't been migrated, but that's because
it's all disabled/unused (i.e. all the test & mon code).  It looks
like a lot of copy & paste holdovers from the original port.

7 months agolibgloss: merge or1k into top-level Makefile
Mike Frysinger [Fri, 29 Dec 2023 05:00:11 +0000 (00:00 -0500)]
libgloss: merge or1k into top-level Makefile

Avoid a recursive make to speed things up a bit.
A or1k-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge epiphany into top-level Makefile
Mike Frysinger [Thu, 28 Dec 2023 01:45:25 +0000 (20:45 -0500)]
libgloss: merge epiphany into top-level Makefile

Avoid a recursive make to speed things up a bit.
A epiphany-elf build shows installed objects & libs produce same code.

7 months agolibgloss: xtensa: fix CPPFLAGS clobbering
Mike Frysinger [Wed, 27 Dec 2023 07:42:30 +0000 (02:42 -0500)]
libgloss: xtensa: fix CPPFLAGS clobbering

No sub-Makefile.inc file should ever set CPPFLAGS directly.  That is
a global/common variable.  Instead, ports should set the per-target
CPPFLAGS to include what they need.

Further, per-target CPPFLAGS should respect $(AM_CPPFLAGS).

7 months ago[RFC] newlib: libc: start manual appendix to hold various ABI constants
Mike Frysinger [Wed, 27 Dec 2023 07:08:21 +0000 (02:08 -0500)]
[RFC] newlib: libc: start manual appendix to hold various ABI constants

The newlib errno values end up being exposed way beyond newlib itself,
so it can be helpful to have a reference of the names & values of them
all.  When using a GNU stack, the errno values might be shared across
all of them without any translation layers.

Consider:
* user's code
* GNU newlib (libc)
* GNU libgloss (OS bindings)
* GNU simulator (syscall handler)

When the user program tries to open a file that doesn't exist, it will
call through newlib -> libgloss -> sim.  How is the error code handled ?
The user program relies on newlib's ENOENT constant.  If newlib & libgloss
don't agree on this value, then libgloss has to maintain a mapping of the
different constants {"EAGAIN", NEWLIB_EAGAIN, LIBGLOSS_EAGAIN}.  No one
does this of course -- libgloss just uses newlib's values directly.  If
libgloss & the OS don't agree on this value, then libgloss again has to
maintain a mapping of {"EAGAIN", NEWLIB_EAGAIN, OS_EAGAIN}.  No one does
this with the GNU simulator -- it returns newlib's values directly.  The
simulator definitely has to maintain a mapping of the target's EAGAIN
values and whatever OS it is running on.  Having this be documented all
the way down is important so people writing simulator ports know what
values to use.

People implementing a minimal bootloader environment can easily be in the
same boat -- they are trying to glue one world (e.g. Das U-Boot's machine
independent API runtime) with another world (e.g. libgloss), and that will
need to maintain the mapping of values in order for the programs to run
unmodified.

Start an appendix in the libc manual to hold these constants.  These pages
are automatically generated using the preprocessor and a script from the
GNU simulator project.  If people are amenable to this direction, I can
port that script over to newlib & strip it down, and also add a few more
appendix chapters for other important ABI constants (e.g. signals).

7 months agolibgloss: merge visium into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 06:05:23 +0000 (01:05 -0500)]
libgloss: merge visium into top-level Makefile

Avoid a recursive make to speed things up a bit.
A visium-elf build shows installed objects & libs produce same code.

7 months agolibgloss: visium: fix sbrk search path
Mike Frysinger [Wed, 27 Dec 2023 06:20:50 +0000 (01:20 -0500)]
libgloss: visium: fix sbrk search path

The code was loading the common ../sbrk.c file rather than the visium
specific sbrk.c due to VPATH setup.  Add an explicit rule for this one
file so we make sure the correct one is used.

7 months agolibgloss: merge m32r into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 05:54:13 +0000 (00:54 -0500)]
libgloss: merge m32r into top-level Makefile

Avoid a recursive make to speed things up a bit.
A m32r-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge rl78 into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 05:43:25 +0000 (00:43 -0500)]
libgloss: merge rl78 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A rl78-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge rx into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 05:38:25 +0000 (00:38 -0500)]
libgloss: merge rx into top-level Makefile

Avoid a recursive make to speed things up a bit.
A rx-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge xstormy16 into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 05:18:12 +0000 (00:18 -0500)]
libgloss: merge xstormy16 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A xstormy16-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge nds32 into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 04:59:00 +0000 (23:59 -0500)]
libgloss: merge nds32 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A nds32le-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge mcore into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 04:44:44 +0000 (23:44 -0500)]
libgloss: merge mcore into top-level Makefile

Avoid a recursive make to speed things up a bit.
A mcore-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge mn10200 into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 04:26:40 +0000 (23:26 -0500)]
libgloss: merge mn10200 into top-level Makefile

Avoid a recursive make to speed things up a bit.
Untested, but follows the same pattern as mn10300, but simpler.

7 months agolibgloss: merge mn10300 into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 04:13:37 +0000 (23:13 -0500)]
libgloss: merge mn10300 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A mn10300-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge i386 into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 03:39:05 +0000 (22:39 -0500)]
libgloss: merge i386 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A i386-elf build shows installed objects & libs produce same code other
than a rename from cygmon-gmon.o & cygmon-salib.o to i386_libcygmon_a-*.o
due to the use of custom CPPFLAGS in here.

7 months agolibgloss: merge frv into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 03:29:20 +0000 (22:29 -0500)]
libgloss: merge frv into top-level Makefile

Avoid a recursive make to speed things up a bit.
A frv-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge msp430 into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 02:11:58 +0000 (21:11 -0500)]
libgloss: merge msp430 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A msp430-elf build shows installed objects & libs produce same code.

7 months agolibgloss: msp430: delete custom .S.o rule
Mike Frysinger [Wed, 27 Dec 2023 03:17:22 +0000 (22:17 -0500)]
libgloss: msp430: delete custom .S.o rule

This was added to specify -Wa,-gdwarf2 when compiling the assembly
files.  Considering the size of these .S files, it seems unnecessary
overkill and complicates the build system.  All but one of these
compile down to 6 or fewer lines, and those hardly need extra debug
for anyone who is poking msp430 assembly.  The 1 file that is larger
than that (crt_move_highdata.S) is still <15 insns.

This will also simplify merging it into the top-level Makefile.

7 months agolibgloss: msp430: split up crt0.S source
Mike Frysinger [Wed, 27 Dec 2023 03:01:30 +0000 (22:01 -0500)]
libgloss: msp430: split up crt0.S source

The build system compiles crt0.S many times to produce independent
object files by defining different -DLxxx symbols for each.  This
complicates the build, and has led to some bugs in the source and
build (see the previous cleanup commits in here).  The crt_bss.S
file has also been duplicated with crt0.S leading to confusion as
to which one is the "real" one.  The only reason to keep them in
one file is to make management of the section numbers when calling
START_CRT_FUNC a little easier, but that seems trivial to check
with a quick grep across all the files.

Considering how complicated the build is now, and the bugs we've
had as a result, split the crt0.S file up into multiple source
files so we don't have to compile it multiple times.  This will
also simplify merging it into the top-level Makefile.

7 months agolibgloss: msp430: delete stub crt_init.o
Mike Frysinger [Wed, 27 Dec 2023 02:56:00 +0000 (21:56 -0500)]
libgloss: msp430: delete stub crt_init.o

This object is created by compiling crt0.S with -DLinit, but there
has never been an "#if Linit" check in crt0.S, so this has always
produced a stub object file.  Drop compiling it entirely.

7 months agolibgloss: msp430: delete outdated/wrong code
Mike Frysinger [Wed, 27 Dec 2023 02:46:59 +0000 (21:46 -0500)]
libgloss: msp430: delete outdated/wrong code

The #if 0 & comment imply this code doesn't exist and is never used,
except there's another #if Lrun_fini_array section below which *does*
define this function, which makes this code comment confusing.  This
seems to be a hold over of the cleanup of the minrt code in the old
commit 884b05b54e4595433c85f8ca9820e88b4c723e38 ("MSP430: Remove
.init/.fini sections").

7 months agolibgloss: merge i960 into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 01:59:58 +0000 (20:59 -0500)]
libgloss: merge i960 into top-level Makefile

Avoid a recursive make to speed things up a bit.
I can't test this as current versions of binutils doesn't support i960.

7 months agolibgloss: i960: delete dead/broken code
Mike Frysinger [Wed, 27 Dec 2023 01:53:43 +0000 (20:53 -0500)]
libgloss: i960: delete dead/broken code

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.

7 months agolibgloss: merge v850 into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 01:47:38 +0000 (20:47 -0500)]
libgloss: merge v850 into top-level Makefile

Avoid a recursive make to speed things up a bit.
A v850e-elf build shows installed objects & libs produce same code.

7 months agolibgloss: merge moxie into top-level Makefile
Mike Frysinger [Wed, 27 Dec 2023 01:21:28 +0000 (20:21 -0500)]
libgloss: merge moxie into top-level Makefile

Avoid a recursive make to speed things up a bit.
A moxie-elf build shows installed objects & libs produce same code.

7 months agolibgloss: moxie: delete unused/invalid assembly file
Mike Frysinger [Wed, 27 Dec 2023 01:25:18 +0000 (20:25 -0500)]
libgloss: moxie: delete unused/invalid assembly file

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.

7 months agolibgloss: add per-file & per-dir flag support
Mike Frysinger [Sat, 30 Dec 2023 01:34:38 +0000 (20:34 -0500)]
libgloss: add per-file & per-dir flag support

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.

7 months agolibgloss: add some objcopy/objdump build rules
Mike Frysinger [Fri, 29 Dec 2023 06:51:27 +0000 (01:51 -0500)]
libgloss: add some objcopy/objdump build rules

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.

7 months agolibgloss: check for objcopy & objdump properly
Mike Frysinger [Wed, 27 Dec 2023 05:26:14 +0000 (00:26 -0500)]
libgloss: check for objcopy & objdump properly

A bunch of ports hack together these values rather than setting them
up in the configure script for everyone.

7 months agolibgloss: doc: unify duplicate copyright/license content
Mike Frysinger [Wed, 27 Dec 2023 00:53:51 +0000 (19:53 -0500)]
libgloss: doc: unify duplicate copyright/license content

Use @copying & @insertcopying directives to define the copyright &
license block only once, and then inserted at the same places as it
was before.

7 months agolibgloss: doc: fix dir info entry usage
Mike Frysinger [Wed, 27 Dec 2023 00:09:29 +0000 (19:09 -0500)]
libgloss: doc: fix dir info entry usage

Wrapping the dir info with @ifnottex means it's included in all other
outputs like html which makes no sense.  Switch to @direntry which is
specific for this content and is automatically written to the output
that makes sense, and omitted from the rest.

7 months agolibgloss: fix up incorrect "it's"
Mike Frysinger [Mon, 25 Dec 2023 23:17:38 +0000 (18:17 -0500)]
libgloss: fix up incorrect "it's"

7 months agolibgloss: sparc: add missing m4 include
Mike Frysinger [Fri, 29 Dec 2023 05:33:05 +0000 (00:33 -0500)]
libgloss: sparc: add missing m4 include

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.

7 months agolibgloss: xtensa: fix crt0.o rule
Mike Frysinger [Wed, 27 Dec 2023 07:37:30 +0000 (02:37 -0500)]
libgloss: xtensa: fix crt0.o rule

Don't hardcode a custom rule for this -- reuse libobjs_a_SOURCES
which was designed for this exact scenario.

7 months agonewlib MMIX: Fix compilation warnings that recent gcc treats as errors
Hans-Peter Nilsson [Thu, 28 Dec 2023 03:31:19 +0000 (04:31 +0100)]
newlib MMIX: Fix compilation warnings that recent gcc treats as errors

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.

7 months agoGCN: Implement '_exit' instead of 'exit'
Thomas Schwinge [Mon, 6 Nov 2023 15:48:20 +0000 (16:48 +0100)]
GCN: Implement '_exit' instead of 'exit'

... 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'".

7 months agoFix epiphany libgloss for c99/gcc-14
Jeff Law [Sat, 23 Dec 2023 04:29:56 +0000 (21:29 -0700)]
Fix epiphany libgloss for c99/gcc-14

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.

7 months agoFix most of m32r libgloss for c99/gcc-14
Jeff Law [Sat, 23 Dec 2023 04:21:52 +0000 (21:21 -0700)]
Fix most of m32r libgloss for c99/gcc-14

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.

7 months agoFix mcore libgloss port for c99/gcc-14
Jeff Law [Sat, 23 Dec 2023 04:17:36 +0000 (21:17 -0700)]
Fix mcore libgloss port for c99/gcc-14

Missing headers and prototypes, much like other ports.

7 months agoFix rl78 libgloss port for c99/gcc-14
Jeff Law [Sat, 23 Dec 2023 04:00:35 +0000 (21:00 -0700)]
Fix rl78 libgloss port for c99/gcc-14

Needed a prototype for SYS_write and the prototype for write was incorrect
(returns an int, not a char *).

7 months agoFix c6x libgloss port for c99/gcc-14
Jeff Law [Sat, 23 Dec 2023 03:57:47 +0000 (20:57 -0700)]
Fix c6x libgloss port for c99/gcc-14

Just one missing header in this case...

7 months agoFix ft32 libgloss for c99/gcc-14
Jeff Law [Sat, 23 Dec 2023 03:48:21 +0000 (20:48 -0700)]
Fix ft32 libgloss for c99/gcc-14

Just one missing header for this libgloss port.

7 months agoFix frv libgloss bits for c99/gcc-14\
Jeff Law [Sat, 23 Dec 2023 03:40:21 +0000 (20:40 -0700)]
Fix frv libgloss bits for c99/gcc-14\

Same as we've seen elsewhere.  Add missing prototype and header include.

7 months agoFix newlib H8/300 bits for C99/gcc-14
Jeff Law [Sat, 23 Dec 2023 03:25:10 +0000 (20:25 -0700)]
Fix newlib H8/300 bits for C99/gcc-14

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.

7 months agoFix v850 libgloss for c99/gcc-14
Jeff Law [Sat, 23 Dec 2023 03:19:58 +0000 (20:19 -0700)]
Fix v850 libgloss for c99/gcc-14

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.

8 months agoFix iq2000 libgloss for c99/gcc-14
Jeff Law [Thu, 21 Dec 2023 19:43:27 +0000 (12:43 -0700)]
Fix iq2000 libgloss for c99/gcc-14

Similar to the others in this space.  Make implicit ints explicit ints. Add
prototype for _write in sbrk.c.

8 months agoOptimize strpbrk.c
Jeff Johnston [Thu, 21 Dec 2023 19:04:31 +0000 (14:04 -0500)]
Optimize strpbrk.c

8 months agoRe: libgloss c99 fixes for mn10300-elf
Jeff Law [Thu, 21 Dec 2023 07:01:54 +0000 (00:01 -0700)]
Re: libgloss c99 fixes for mn10300-elf

Very similar to other patches in this space.  Avoid implicit int types and add
missing #includes so that this code works with gcc-14.

8 months agoRegenarate libgloss/Makefile.in
Jeff Johnston [Wed, 20 Dec 2023 22:13:18 +0000 (17:13 -0500)]
Regenarate libgloss/Makefile.in

8 months agonewlib: Fix long double for unsupported rounding modes and exceptions
Craig Blackmore [Wed, 20 Dec 2023 20:32:24 +0000 (20:32 +0000)]
newlib: Fix long double for unsupported rounding modes and exceptions

RISC-V newlib fails to build for soft float multilibs since long double
support was enabled in:

  commit 04798b7bb69571452d2cfc7e0b052a9bbd3b619d
  Author: Kito Cheng <kito.cheng@sifive.com>
  Date:   Mon Dec 4 15:41:39 2023 +0800

      RISC-V: Support long double math

      Long double for RISC-V is using 128 bit IEEE 754 format like Aarch64,
      so we reference AArch64 to support that.

The RISC-V soft floating point environment only supports the
FE_TONEAREST rounding mode and does not support exceptions.  Guard long
double rounding and exception support with ifdefs based on the presence
of the relevant rounding modes and exceptions.

Tested on gcc/g++ testsuite using RISC-V GNU Newlib Toolchain built by
riscv-gnu-toolchain with multilibs:

    riscv-sim/-march=rv32i/-mabi=ilp32/-mcmodel=medlow
    riscv-sim/-march=rv32iac/-mabi=ilp32/-mcmodel=medlow
    riscv-sim/-march=rv32im/-mabi=ilp32/-mcmodel=medlow
    riscv-sim/-march=rv32imac/-mabi=ilp32/-mcmodel=medlow
    riscv-sim/-march=rv32imafc/-mabi=ilp32f/-mcmodel=medlow
    riscv-sim/-march=rv64imac/-mabi=lp64/-mcmodel=medlow

Co-authored-by: Simon Cook <simon.cook@embecosm.com>
8 months agonewlib: libc: Improved the readability of strcspn with minor optimization
Xiao Zeng [Fri, 15 Dec 2023 08:31:01 +0000 (16:31 +0800)]
newlib: libc: Improved the readability of strcspn with minor optimization

Signed-off-by: Xiao Zeng <zengxiao@eswincomputing.com>
8 months agoFix various v850 problems
Jeff Law [Wed, 20 Dec 2023 03:54:37 +0000 (20:54 -0700)]
Fix various v850 problems

These fixes fall into a few different buckets.  First c99 doesn't allow a
parameter without a type.  So in cases where the type had previously been an
implicit int, make it an explicit int.  Second, for return values, don't allow
them to be implicit ints either, make them explicit. In a few cases change c89
function definitions to c99 function definitions.   Lastly include <stdlib.h>
in sbrk.c to get the prototype for abort () which we call when we detect a
heap/stack collision.

8 months agolibgloss: doc: generate single page & split html manuals
Mike Frysinger [Sun, 15 Oct 2023 08:22:06 +0000 (14:07 +0545)]
libgloss: doc: generate single page & split html manuals

By default, only split node html manuals are generated.  Change the
default to single page, and add an extra rule to also generate the
split page manual.

8 months agolibgloss: drop $(INCLUDES) when using $(AS)
Mike Frysinger [Mon, 4 Dec 2023 07:03:07 +0000 (02:03 -0500)]
libgloss: drop $(INCLUDES) when using $(AS)

Since $(AS) is the assembler, passing it a list of preprocessor include
flags doesn't make much sense.  The files aren't preprocessed which means
`#include` lines aren't respected, and while it would affect `.include`
usage, we never use that, and it's extremely unlikely to change.  Plus,
it's extremely unlikely we'd have .s files in common places to include vs
contained entirely within a specific arch dir, and at that point, it can
be included directly (with no flags), or the arch can add the unique set
of include paths that it needs for itself.

8 months agoAdd generated files for Revert patch
Jeff Johnston [Tue, 19 Dec 2023 18:58:12 +0000 (13:58 -0500)]
Add generated files for Revert patch

8 months agoRevert "Fix libgloss/newlib build to conditionally use top include dir"
Mike Frysinger [Mon, 4 Dec 2023 07:03:06 +0000 (02:03 -0500)]
Revert "Fix libgloss/newlib build to conditionally use top include dir"

This reverts commit 17ac400c11bab30ac2c0bef12cbf7788f0b6f954.

The build failures were due to incorrectly using $(INCLUDES) when
running $(AS).  Let's roll this back and drop $(INCLUDES) from the
$(AS) invocations.

8 months agoRemove curly braces in `@author` tag in .texi files
Freddie Chopin [Sun, 17 Dec 2023 09:01:45 +0000 (10:01 +0100)]
Remove curly braces in `@author` tag in .texi files

Curly braces cause documentation build failure with texinfo 7.1 (works fine
up to 7.0.3):

8 months agolibgloss fix for bfin port
Jeff Law [Tue, 19 Dec 2023 04:29:12 +0000 (21:29 -0700)]
libgloss fix for bfin port

gcc-14 will complain loudly both for calling a function without an in-scope
prototype or when the in scope prototype differs from the known signature.

"main" happens to be one of the functions the compiler knows about.  So not
only do we need to prototype it, we need to make sure the prototype matches
what GCC thinks it should be.

This fixes the bfin libgloss port to do the right thing for bfin-elf.

8 months agoRe: Fix moxie libgloss issues with c99
Jeff Law [Sun, 17 Dec 2023 04:11:10 +0000 (21:11 -0700)]
Re: Fix moxie libgloss issues with c99

Two libgloss issues specific to moxie-elf that show up build with GCC trunk.

First, putnum.c uses "print" without a prototype.  So I added one based on the
function's definition in print.c.  Second sim-inbyte.c uses read, which comes
from unistd.h, so this adds a suitable #include.

8 months agoFix fr30 libgloss build
Jeff Law [Thu, 14 Dec 2023 17:30:13 +0000 (10:30 -0700)]
Fix fr30 libgloss build

gcc-14 will default to c99 and as a result a fair amount of old code in newlib
(particularly libgloss) is failing to build.  I don't offhand know how many
patches will be necessary to fix the various failures. I'll just pick them off
one by one from my tree.

This particular patch works around the return-mismatch problem syscalls.c for
fr30.

That file is a bit odd in that most functions are declared as returning an
integer, but the implementations look like:

> int
> _read (file, ptr, len)
>      int    file;
>      char * ptr;
>      int    len;
> {
>   asm ("ldi:8 %0, r0" :: "i" (SYS_read) : "r0");
>   asm ("int   #10");
>
>   return;
> }

Note the lack of a value on the "return" statement.  The assumption is that the
interrupt handler implementing syscalls will put the return value into the
proper register, so falling off the end of the C function or returning with no
value works in the expected way.  It's not good code, but it probably works.

Working from that assumption I decided to just use a pragma to disable the
upgraded diagnostic from GCC -- essentially preserving existing behavior.

This is the only fr30 specific issue that needs to be resolved and the only
issue (so far) I've seen of this specific nature.

8 months agonewlib cris: Fix compilation warnings that recent gcc treats as errors
Hans-Peter Nilsson [Sat, 2 Dec 2023 01:20:17 +0000 (02:20 +0100)]
newlib cris: Fix compilation warnings that recent gcc treats as errors

For the newlib part, warnings are all from lack of sync between
libc/machine/cris/sys/signal.h and libc/include/sys/signal.h.  This
commit gets them sufficiently in sync again, functionality-wise and
declaration-wise.  Still, nothing is declared that isn't supported at
the system level (i.e. in libgloss system calls and handled by the
CRIS simulator in the gdb project).

8 months agolibgloss/cris: Make C declarations present and match them
Hans-Peter Nilsson [Mon, 4 Dec 2023 17:00:26 +0000 (18:00 +0100)]
libgloss/cris: Make C declarations present and match them

This is the libgloss part.
Recently, there was a change in gcc such that implicit function
declarations and type mismatches are now errors, no longer just
warnings.  Fix by adding and correcting declarations warned about;
including the right header or adding a declaration (for "main" in
lcrt0.c) and adjust to those types as necessary.

8 months agoCygwin: fallocate(2): fix debug output
Corinna Vinschen [Tue, 5 Dec 2023 21:11:18 +0000 (22:11 +0100)]
Cygwin: fallocate(2): fix debug output

Fixes: e01c50c7b0a6 ("Cygwin: introduce fallocate(2)")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: fallocate(2): fix offset and length sanity check
Corinna Vinschen [Tue, 5 Dec 2023 21:08:42 +0000 (22:08 +0100)]
Cygwin: fallocate(2): fix offset and length sanity check

- len must not be <= 0
- offset + len must not exceed off_t (max. file size)

Fixes: e01c50c7b0a6 ("Cygwin: introduce fallocate(2)")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: posix_fallocate(3): fix offset and length sanity check
Corinna Vinschen [Tue, 5 Dec 2023 21:08:01 +0000 (22:08 +0100)]
Cygwin: posix_fallocate(3): fix offset and length sanity check

- len must not be <= 0
- offset + len must not exceed off_t (max. file size)

Fixes: 7636b5859062 ("* autoload.cc (NtSetInformationFile): Define.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agopru: libm: Fix incorrect function name
Dimitar Dimitrov [Mon, 4 Dec 2023 15:42:42 +0000 (17:42 +0200)]
pru: libm: Fix incorrect function name

Upstream GCC changed -Wimplicit-function-declaration warning into an
error. The build break about missing fpclassifyf function prototype
exposed a bug in the PRU port of libm.

The fix is to use the fpclassify macro for both double and float types.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
8 months agoRISC-V: Support long double math
Kito Cheng [Mon, 4 Dec 2023 07:41:39 +0000 (15:41 +0800)]
RISC-V: Support long double math

Long double for RISC-V is using 128 bit IEEE 754 format like Aarch64,
so we reference AArch64 to support that.

8 months agoRISC-V: Fix -Wint-conversion warning
Kito Cheng [Mon, 4 Dec 2023 07:41:28 +0000 (15:41 +0800)]
RISC-V: Fix -Wint-conversion warning

Upstream GCC has change this warning into error by default, so...we need
to explicitly convert the type from pointer from/to integer, generally
it's unsafe, but we know what we are doing here.

However it's not safe for ilp32 on RV64, but we didn't support that yet, so I
think this fix is good enough now :)

8 months agoCygwin: fallocate(2): drop useless zeroing pointer
Corinna Vinschen [Sat, 2 Dec 2023 13:38:28 +0000 (14:38 +0100)]
Cygwin: fallocate(2): drop useless zeroing pointer

The out pointer is only used if data_chunk_count is > 0,
so there's no reason to set it to NULL in the error case.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: CI: drop IRC notification from AppVeyor via notifico
Jon Turney [Fri, 24 Nov 2023 13:17:32 +0000 (13:17 +0000)]
Cygwin: CI: drop IRC notification from AppVeyor via notifico

Drop IRC status notification from AppVeyor via notifico, as we no longer
run tests there.

8 months agonewlib: libc: Fix indentation
Kuan-Wei Chiu [Sat, 2 Dec 2023 04:21:07 +0000 (12:21 +0800)]
newlib: libc: Fix indentation

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
8 months agonewlib: libc: Fix memory leak in computematchjumps()
Kuan-Wei Chiu [Fri, 1 Dec 2023 16:13:21 +0000 (00:13 +0800)]
newlib: libc: Fix memory leak in computematchjumps()

In cases where malloc fails for the 'g->matchjump' allocation, the code
path does not handle the failure gracefully, potentially leading to a
memory leak. This fix ensures proper cleanup by freeing the allocated
memory for 'pmatches' before returning.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
8 months agoCygwin: drop stray fs_info::check_ssd declaration
Corinna Vinschen [Fri, 1 Dec 2023 08:55:33 +0000 (09:55 +0100)]
Cygwin: drop stray fs_info::check_ssd declaration

This is just a leftover from development

Fixes: 8b01c5d6903f ("Cygwin: fs_info: check for SSD")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: doc: add missing change to posix_spawnp
Corinna Vinschen [Thu, 30 Nov 2023 21:38:59 +0000 (22:38 +0100)]
Cygwin: doc: add missing change to posix_spawnp

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: sparse support: enable automatic sparsifying of files on SSDs
Corinna Vinschen [Thu, 30 Nov 2023 21:36:35 +0000 (22:36 +0100)]
Cygwin: sparse support: enable automatic sparsifying of files on SSDs

Given that SSDs don't have a seek penalty, we can enable
automatic sparsifying of files on SSDs, even if the "sparse"
mount option is not set.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: fs_info: check for SSD
Corinna Vinschen [Thu, 30 Nov 2023 21:13:49 +0000 (22:13 +0100)]
Cygwin: fs_info: check for SSD

During fs_info::update, check for the file being on an SSD.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: ntdll.h: add missing NtQueryVolumeInformationFile definitions
Corinna Vinschen [Thu, 30 Nov 2023 21:12:13 +0000 (22:12 +0100)]
Cygwin: ntdll.h: add missing NtQueryVolumeInformationFile definitions

In preparation of using the FileFsSectorSizeInformation info class,
add a couple of missing definitions.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: ntdll.h: add missing POBJECT_NAME_INFORMATION
Corinna Vinschen [Thu, 30 Nov 2023 21:11:26 +0000 (22:11 +0100)]
Cygwin: ntdll.h: add missing POBJECT_NAME_INFORMATION

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: revert autoloading of DiscardVirtualMemory
Corinna Vinschen [Thu, 30 Nov 2023 20:14:48 +0000 (21:14 +0100)]
Cygwin: revert autoloading of DiscardVirtualMemory

Commit a3ae2a734892 ("Cygwin: don't autoload some kernel32 functions")
erroneously removed DiscardVirtualMemory from the list of autloaded
functions.  DiscardVirtualMemory is not available on Windows 8.1.

Fixes: a3ae2a734892 ("Cygwin: don't autoload some kernel32 functions")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: Add '--names-only' flag to cygcheck
Jon Turney [Fri, 24 Nov 2023 16:17:05 +0000 (16:17 +0000)]
Cygwin: Add '--names-only' flag to cygcheck

Add '--names-only' flag to cygcheck, to output just the bare package
names.

8 months agoRISC-V: Fix timeval conversion in _gettimeofday()
Kuan-Wei Chiu [Wed, 29 Nov 2023 03:57:14 +0000 (11:57 +0800)]
RISC-V: Fix timeval conversion in _gettimeofday()

Replace multiplication with division for microseconds calculation from
nanoseconds in _gettimeofday function.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
8 months agonewlib: filter out versions from newlib.h to simplify autoreconf
Mike Frysinger [Sun, 15 Oct 2023 09:29:13 +0000 (15:14 +0545)]
newlib: filter out versions from newlib.h to simplify autoreconf

We've been manually editing newlib.hin after generating it with
autoheader to drop the version defines that we keep in the separate
_newlib_version.h header.  This is confusing for people, and is an
easy source of mistakes/errors.

Since we're already running sed on newlib.h during configure to
filter out defines we don't want to expose, add the version macros
there too.  This way we don't have to manually edit newlib.hin.

This simplifies the autoreconf step in exchange for a slightly more
complicated configure+sed step, but seems worth the trade-off.

8 months agoCygwin: fallocate(2): handle FALLOC_FL_PUNCH_HOLE and FALLOC_FL_ZERO_RANGE
Corinna Vinschen [Tue, 28 Nov 2023 09:42:52 +0000 (10:42 +0100)]
Cygwin: fallocate(2): handle FALLOC_FL_PUNCH_HOLE and FALLOC_FL_ZERO_RANGE

Split fhandler_disk_file::fallocate into multiple methods, each
implementing a different aspect of fallocate(2), thus adding
FALLOC_FL_PUNCH_HOLE and FALLOC_FL_ZERO_RANGE handling.

For more correctly implementing posix_fallocate(3) semantics, make
sure to re-allocate holes in the given range if the file is sparse.

While at it, change the way checking when to make a file sparse.
The rule is now, make file sparse if the hole created by the action
spans at least one sparse block, taking the allocation granularity
of sparse files into account.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: pwrite(2): sparsify file
Corinna Vinschen [Mon, 27 Nov 2023 21:48:50 +0000 (22:48 +0100)]
Cygwin: pwrite(2): sparsify file

write(2) sparsifies a file after an lseek far enough beyond EOF.

Let pwrite(2) sparsify as well if offset is far enough beyond EOF.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: fallocate(2): fix evaluating return value
Corinna Vinschen [Mon, 27 Nov 2023 20:17:12 +0000 (21:17 +0100)]
Cygwin: fallocate(2): fix evaluating return value

fallocate is not supposed to return an errno code, it has to
return -1 and set errno.

Fixes: dd90ede40510 ("Cygwin: introduce fallocate(2)")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: open(2): reset sparseness on O_TRUNCated files
Corinna Vinschen [Mon, 27 Nov 2023 20:14:49 +0000 (21:14 +0100)]
Cygwin: open(2): reset sparseness on O_TRUNCated files

open(2) implements O_TRUNC by just reducing the size of the file
to 0, to make sure EAs stay available.

Turns out, file sparseness is not removed this way either, so add
code to do just that.

Fixes: 603ef545bdbd ("* fhandler.cc (fhandler_base::open): Never open files with FILE_OVERWITE/FILE_OVERWRITE_IF.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: introduce fallocate(2)
Corinna Vinschen [Sun, 26 Nov 2023 20:05:07 +0000 (21:05 +0100)]
Cygwin: introduce fallocate(2)

First cut of the new, Linux-specific fallocate(2) function.
Do not add any functionality yet, except of basic handling
of FALLOC_FL_KEEP_SIZE.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: fcntl.h: Use cdefs.h macros
Corinna Vinschen [Sun, 26 Nov 2023 14:41:41 +0000 (15:41 +0100)]
Cygwin: fcntl.h: Use cdefs.h macros

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 months agoCygwin: fhandler: rename ftruncate method to fallocate
Corinna Vinschen [Sun, 26 Nov 2023 11:50:38 +0000 (12:50 +0100)]
Cygwin: fhandler: rename ftruncate method to fallocate

also, take mode flags parameter instead of just a bool.
Introduce __FALLOC_FL_TRUNCATE mode flag as internal flag to
indictae being called from ftruncate(2).

This is in preparation of an upcoming change introducing the
Linx-specific fallocate(2) call.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This page took 0.069945 seconds and 5 git commands to generate.