aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc
AgeCommit message (Collapse)AuthorFilesLines
2022-05-04Revert "sys/types.h: Don't include sys/_stdint.h"Corinna Vinschen4-73/+72
This reverts commit 4232d171a620662aaed650879936eac60aefd9e0.
2022-05-03sys/types.h: Don't include sys/_stdint.hCorinna Vinschen4-72/+73
By including sys/_stdint.h, all types from stdint.h are exposed even if stdint.h isn't pulled in explicitely. Include <machine/_default_types.h instead. Fix up newlib and Cygwin files which rely on stdint.h types, too. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-04-11Aarch32/64: Support __FLT_EVAL_METHOD__ values other than 0, 1, 2Andrea Corallo2-0/+23
2022-03-30 Andrea Corallo <andrea.corallo@arm.com> * libc/include/machine/ieeefp.h (__FLOAT_TYPE, __DOUBLE_TYPE): New macros. * libc/include/math.h: Uses __DOUBLE_TYPE __FLOAT_TYPE to define double_t float_t if possible.
2022-04-08Add angle TZ angle bracket support to tzset_rJeff Johnston2-43/+132
- from Brian Inglis <Brian.Inglis@systematicsw.ab.ca> - add support to _tzset_unlocked_r() to support quoting std and dst names with angle brackets <> as per Posix - modify documentation of tzset.c
2022-04-01newlib: Remove superfluous CHECK_STD_INIT() macroSebastian Huber9-24/+0
This macro is unused or expands to nothing.
2022-04-01Remove unused _cleanup()Matt Joyce1-8/+0
Removed the unused function _cleanup() from findfp.c.
2022-04-01Fix bug introduced in previous patch (44b60f0c)Matt Joyce4-7/+5
This fixes a bug introduced in a previous patch (Commit 44b60f0c: Make __sdidinit unused). Removed intitialization of __cleanup from __smakebuf_r(). All callers of __smakebuf_r() call __sinit() through the_CHECK_INIT macro, thus __cleanup is already initialized. This fix also allows _cleanup_r() to be made static. Changed its name to cleanup_stdio() and removed its declaration from local.h.
2022-03-31newlib: Rename __sfmoreglue() and make it staticSebastian Huber2-5/+3
Rename __sfmoreglue() in sfmoreglue() and make it static. This function is only used by __sfp() in the same translation unit. Remove use of register keyword.
2022-03-31Replace _fwalk() calls with _fwalk_reent()Sebastian Huber4-39/+12
Remove the _fwalk() implementation to avoid duplicated code with _fwalk_reent().
2022-03-30Commit patch from Tobias Burnus <tobias@codesourcery.com>Jeff Johnston2-4/+4
[PATCH] newlib: Only call _fputwc_r if ELIX_LEVEL >= 4 (nano-)vfprintf.c is enabled for ELIX_LEVEL >= 1. When _WIDE_ORIENT is set, its __sprint_r / __sfputs_r functions unconditionally called _fputwc_r which is only in ELEX_LEVEL >= 4. With this commit, the _WIDE support in (nano-)vfprintf.c is disabled for ELEX_LEVEL < 4.
2022-03-28newlib: drop phoenix supportMike Frysinger133-9950/+0
This code has not been updated since 2016, and it looks like it has rotted quite a bit since. It does not build against the current set of phoenix sources -- I had to hack both the kernel headers and the newlib headers up to get it to build, and I still have no idea if it actually links or runs. It seems like the project itself has moved away from newlib and to its own C library: https://phoenix-rtos.com/documentation/libc/README.md So since there's no interest from the phoenix folks to maintain this, and it has a significant amount of non-standard code that we try to keep up-to-date (without actually testing it), just punt it all.
2022-03-22amdgcn: Fix build failureAndrew Stubbs2-1/+1
The recent makefile reorganization broke the amdgcn port by creating duplicate __malloc_lock symbols. This patch fixes the problem by renaming the malloc_support.c file to mlock.c, thus overriding the default symbol properly. Actually, I'm not sure how this ever worked?
2022-03-21iconv: Fix EL/IX level 2 handlingSebastian Huber3-10/+2
Consistently use if !ELIX_LEVEL_1 to enable EL/IX level 2 interfaces.
2022-03-19Avoid using common symbols in v850 libglossJeff Law26-26/+26
I've had this lying around for probably a year or two at this point. It just changes all the instance of "errno" from a common symbol to an extern. I can't offhand recall where the actual definition is, but it certainly exists in the generic code.
2022-03-16newlib: integrate iconv update to maintainer buildMike Frysinger2-2/+20
To help prevent people from missing running this script, integrate it into the build via maintainer mode. Also fix the inverted exit status to make this work correctly -- for some reason, it exited 1 when it worked, and 0 when it failed.
2022-03-16newlib: libc: merge build up a directoryMike Frysinger330-71316/+1860
Convert all the libc/ subdir makes into the top-level Makefile. This allows us to build all of libc from the top Makefile without using any recursive make calls. This is faster and avoids the funky lib.a logic where we unpack subdir archives to repack into a single libc.a. The machine override logic is maintained though by way of Makefile include ordering, and source file accumulation in libc_a_SOURCES. There's a few dummy.c files that are no longer necessary since we aren't doing the lib.a accumulating, so punt them. The winsup code has been pulling the internal newlib ssp library out, but that doesn't exist anymore, so change that to pull the objects.
2022-03-13newlib: xstormy16: move malloc multiplex logic from build to source filesMike Frysinger9-85/+84
Rather than define per-object rules in the Makefile, have small files that define & include the right content. This simplifies the build rules, and makes understanding the source a little easier (imo) as it makes all the subdirs behave the same: you have 1 source file and it produces 1 object. It's also about the same amount of boiler plate, without having to define custom build rules that can fall out of sync. We also realign the free & pvalloc definitions: common code puts these in malloc.o & valloc.o respectively, not in free.o & pvalloc.o objects. This will also be important as we merge the libc.a build into the top dir since it relies on a single flat list of objects for overrides.
2022-03-13newlib: xstormy16: break up mallocr stubsMike Frysinger6-63/+60
Move the multiplex logic out of the build and into source files to make the build rules a lot simpler.
2022-03-13newlib: xstormy16: fix mallopt definition & mstats handlingMike Frysinger3-28/+29
The mallopt symbol is defined in tiny-malloc.c, not mallocr.c, but the Makefile in here tries to compile it out of the latter. This leads to mallopt never being defined. The build also creates mallinfo.o & mallopt.o & mallstats.o objects to override common ones, but the common dir doesn't use these names. Instead, it places these all in mstats.o. So move the build define logic to a dedicated file and compile it directly to make things a bit simpler while fixing the missing func and aligning objects with the cmomon code.
2022-03-09newlib: libc: move stdlib multiplex logic from build to source filesMike Frysinger14-193/+153
Rather than define per-object rules in the Makefile, have small files that define & include the right content. This simplifies the build rules, and makes understanding the source a little easier (imo) as it makes all the subdirs behave the same: you have 1 source file and it produces 1 object. It's also about the same amount of boiler plate, without having to define custom build rules that can fall out of sync. This will also be important as we merge the libc.a build into the top dir since it relies on a single flat list of objects for overrides. Also take the opportunity to clean up the unnecessary header deps in here. Automake provides dependency generation for free now.
2022-03-09newlib: rename mallocr.c to _mallocr.cMike Frysinger3-24/+24
This file is a little confusing: it provides all of the mallocr logic, but is compiled multiple times to produce a unique symbol each time. For example, building mallocr.c with -DDEFINE_FREER produces freer.o that only defines _free_r(). This is fine for most symbols, but it's a little confusing when defining mallocr itself -- we produce a file with the same symbol name, but we still need -DDEFINE_MALLOCR. In order to move the logic from the build rules to source files, using mallocr.c both as a multiplexer and for defining a single symbol is a bit tricky. It's possible (if we add a lot of redundant preprocessor checks to mallocr.c, or we add complicated build flags just for this one files), but it's easier if we simply rename this to a dedicated file. So let's do that. We do this as a dedicated commit because the next one will create a new mallocr.c file and git's automatic diff algorithms can handle trivial renames, but it can't handle renames+creates in the same commit.
2022-03-09newlib: move nano-malloc logic from build to source filesMike Frysinger3-116/+67
Simplify the build system logic a bit by moving the mallocr.c -> nano-mallocr.c redirection from the Makefile to the source files. This allows for consistent object name usage regardless of the configuration options used in case a machine dir wants to define its own override.
2022-03-07Fix Bug libc/28945Jeff Johnston1-1/+1
- apply fix from Tom de Vries <vries@gcc.gnu.org> to have calloc zero out storage for nvptx calloc function
2022-03-01newlib: convert INTERNAL_NEWLIB to _LIBCMike Frysinger4-41/+38
Since we already set up _LIBC to indicate source files are building for newlib, we don't need this malloc-specific symbol. Convert it over to simplify the build a bit.
2022-03-01newlib: xstormy16: add missing string.h includeMike Frysinger1-0/+5
Some of these functions are using memcpy & memset from string.h but not including the header leading to implicit declaration warnings.
2022-02-28newlib: libc: move stdio multiplex logic from build to source filesMike Frysinger16-502/+249
Rather than define per-object rules in the Makefile, have small files that define & include the right content. This simplifies the build rules, and makes understanding the source a little easier (imo) as it makes all the subdirs behave the same: you have 1 source file and it produces 1 object. It's also about the same amount of boiler plate, without having to define custom build rules that can fall out of sync. Some of these rules were already unnecessary as they were compiling a single source file into the same named object w/out custom flags, and Automake handles that for us completely. This will also be important as we merge the libc.a build into the top dir since it relies on a single flat list of objects for overrides. Also take the opportunity to clean up the unnecessary header deps in here. Automake provides dependency generation for free now.
2022-02-25newlib: libc: move configure into top-levelMike Frysinger114-8957/+3444
This kills off the last configure script under libc/ and folds it into the top newlib configure script. The a lot of the logic was already in the top configure script, so move what's left into a libc/acinclude.m4 file.
2022-02-22Make __sdidinit unusedMatt Joyce8-20/+16
Remove dependency on __sdidinit member of struct _reent to check object initialization. Like __sdidinit, the __cleanup member of struct _reent is initialized in the __sinit() function. Checking initialization against __cleanup serves the same purpose and will reduce overhead in the __sfp() function in a follow up patch.
2022-02-18newlib: libc: delete crt0.o duplicationMike Frysinger111-143/+1
The crt0.o was handled in a subdir-by-subdir basis: it would be compiled in one (e.g. libc/sys/$arch/), then copied up one level (libc/sys/), then copied up another (libc/) before finally being copied & installed in the top newlib dir. The libc/sys/ copy was cleaned up, and then the top dir was changed to copy it directly out of the libc/sys/$arch/ dir. But the libc/sys/ copy to libc/ was left behind. Clean that up now too.
2022-02-18newlib: posix: use local includes for local headersMike Frysinger3-4/+4
These headers aren't installed, so use "" includes instead of <> so we don't search system header paths. This matches the style used elsewhere in the tree for these local headers, and makes it work w/out explicit -I flags (as needed with non-recursive make).
2022-02-17newlib: libc: reshuffle include order for the manualMike Frysinger10-14/+24
When migrating the manual to the top-level, the include order was sorted by name of the subdir. But this changed the chapter order of the manual in the process. Change the sorting back to match existing chapters and update the comments to explain.
2022-02-17newlib: powerpc: switch to Automake conditionalsMike Frysinger2-72/+81
Using xxx_LIBADD, xxx_DEPENDENCIES, and EXTRA_xxx_SOURCES is one way of conditionally including files into a target. But it's meant more for the cases where the variables added to LIBADD & DEPENDENCIES are constructed via substitution (e.g. AC_SUBST) or other dynamic methods. With Automake conditionals, then the much simpler form is to conditionally append to the xxx_SOURCES variable and let Automake sort everything out.
2022-02-16newlib: rtems: drop redundant header installMike Frysinger2-45/+9
The top-level newlib dir already takes care of recursing into the sys/xxx/include/ subdirs and installing any headers found, so the rtems subdir doesn't need to do this itself.
2022-02-16newlib: powerpc: simplify reallocr & callocr build logicMike Frysinger4-14/+18
Replace the custom build rules (which require copying & pasting from the current Makefile) with small stub files. This allows us to drop the rules entirely and let Automake provide everything.
2022-02-16newlib: i386/xstormy16: drop unused -I libm/common flagMike Frysinger4-9/+4
These subdirs don't actually use anything from libm. The common dir in particular only has 4 header files, and none are included here. The xstormy16 code has a comment mentioning why this hack is here, but it refers to code that was removed when its configure script was merged up a level.
2022-02-15newlib/libgloss: drop unused $(CROSS_CFLAGS)Mike Frysinger210-210/+210
This is used in a bunch of places, but nowhere is it ever set, and nowhere can I find any documentation, nor can I find any other project using it. So delete the flags to simplify.
2022-02-15newlib: drop support for decstation & sunos systemsMike Frysinger54-4733/+0
These targets don't actually cross-compile -- they try to pull some objects out of the host's /lib/libc.a, /lib/libm.a, and /lib/crt0.o directly and merge them into newlib's own libraries. This is hard to keep working and impossible to test. Considering the vintage of such targets, and gcc dropping them many many years ago, drop them from newlib too. This will make cleaning up the build a lot easier.
2022-02-15newlib: phoenix: merge configure up to top-levelMike Frysinger118-6784/+319
Merge sys/phoenix/ configure logic into libc/ itself. This kills off the last lingering script in this tree (other than libc itself).
2022-02-15newlib: phoenix: merge machine/ configure scripts up a levelMike Frysinger8-6651/+34
The machine configure scripts are all effectively stub scripts that pass the higher level options to its own makefile.
2022-02-15newlib: phoenix: merge machine/ trampoline up a levelMike Frysinger9-7201/+44
The machine/{configure,Makefile} files exist only to fan out to the specific machine/$arch/ subdir. We already have all that same info in the phoenix/ dir itself, so by moving the recursive configure and make calls into it, we can cut off this logic entirely and save the overhead.
2022-02-15newlib: phoenix: drop missing machine subdirsMike Frysinger2-13/+1
These were never added to the tree, and as we transition from autoconf to automake, it really wants the latter subdirs to always exist. These don't, so delete the logic.
2022-02-15newlib: phoenix: move some logic from configure to the MakefileMike Frysinger8-22/+6
These configure scripts hardcode some settings, so move them to the Makefile to simplify so we can drop the configure scripts entirely.
2022-02-10newlib: delete unused autotool regen scriptsMike Frysinger3-15/+0
These don't work at all now that we've completely upgraded autotools.
2022-02-09newlib: drop support for $oextMike Frysinger121-514/+394
This was needed only to support libtool in case objects ended in .lo instead of .o, but we dropped libtool, so drop this too.
2022-02-09newlib: drop support for $aextMike Frysinger119-164/+44
This was needed only to support libtool in case the library ended in .la instead of .a, but we dropped libtool, so drop this too.
2022-02-09newlib: fix mkdoc dependenciesMike Frysinger1-0/+1
Make sure we depend on the right name of mkdoc all the time, and that the rules that need it (e.g. .def files) depend on it. Reported-by: Jon Turney <jon.turney@dronecode.org.uk>
2022-02-09newlib: drop libtool supportMike Frysinger140-16563/+1817
This was only ever used for i?86-pc-linux-gnu targets, but that's been broken for years, and has since been dropped. So clean this up too. This also deletes the funky objectlist logic since it only existed for the libtool libraries. Since it was the only thing left in the small Makefile.shared file, we can punt that too.
2022-02-09newlib: punt sys/linux supportMike Frysinger831-221915/+6
This was only used by the i?86-pc-linux-gnu target which we've removed, and even though it's using a "sys/linux/" dir to make it sound like it only depends on the Linux kernel, it's actually tied to glibc APIs built on top of Linux. Since the code relies on internal glibc APIs and has been broken for some time, punt it all. If someone wants to bring it back, they can try and actually keep the Linux-vs-glibc APIs separate.
2022-02-08newlib: drop autoconf-2.13 hackMike Frysinger10-44/+14
We require autoconf-2.69 now, so we don't need this old install hack.
2022-02-08newlib: drop cygnus EXEEXT hackMike Frysinger10-134/+14
Now that we rely on AC_NO_EXECUTABLES to disable link tests, we don't need this hack to disable exeext probing.