aboutsummaryrefslogtreecommitdiff
path: root/newlib
AgeCommit message (Collapse)AuthorFilesLines
2022-05-13Add two __sglue initialization macrosMatt Joyce2-7/+9
Added _REENT_INIT_SGLUE and _REENT_INIT_SGLUE_ZEROED macros to initialize __sglue member of struct _reent. This allows further simplification of __sinit() and facilitates the removal of __sglue as a member of struct _reent for certain configurations in a follow-on patch.
2022-05-13Declare global __sf[] only onceSebastian Huber1-2/+4
Reduced number of global __sf[] declarations from two to one, simplifying initializations in sys/reent.h.
2022-05-13Remove duplicate sglue initializationsMatt Joyce1-3/+0
Removed duplicate sglue initializations from __sinit(). These are already initialized in the _REENT_INIT macro in sys/reent.h. This simplification enables the reduction of _GLOBAL_REENT dependency in a follow-on patch.
2022-05-13Remove duplicate stdio initializationsMatt Joyce1-4/+0
Removed duplicate stdio initializations from __sinit(). These are already initialized in the _REENT_INIT macro in sys/reent.h. This simplification enables the reduction of _GLOBAL_REENT dependency in a follow-on patch.
2022-05-04Generate manpages for functions in chapter sys.texJon Turney1-1/+3
Also generate manpages for functions in chapter sys.tex, omitted in error.
2022-05-04Fix warning about duplicate id in docbook XMLJon Turney1-1/+1
../newlib/libc/libc.xml:22242: element refentry: validity error : ID iconv already defined <refentry id="iconv"> Use a separate namespace for chaper ids, to avoid collision between the ids for the chapter and function 'iconv', now that iconv documentation is generated unconditionally.
2022-05-04Silence xsltproc when writing manpagesJon Turney3-2/+5
Unless make is invoked with V=1, have xmlto pass the parameter 'man.output.quietly=1' to xsltproc to suppress "Note: Writing foo.N" output from the manpages stylesheet. (This doesn't quite do what it says: The output is not silenced if V has any value, including 0. You could consider that either a bug or a feature.)
2022-05-04Add build avoidance for 'make man'Jon Turney2-8/+10
This will generate multiple manpage files as an output, but we don't know what they will be called, so use a timestamp for build avoidance.
2022-05-04Simplify rules for creating man pagesJon Turney2-10/+6
Simplify rules for creating docbook XML used to create manpages: Updating the output using move-if-change and then unconditionally touching the .stamp file doesn't make much sense.
2022-05-04Fix ndbm.c build breakDimitar Dimitrov1-0/+1
The ndbm.c build broke with: Commit 357d7fcc6 In <stdio.h> provide only necessary types The above commit exposed a latent missing-header bug: newlib/newlib/libc/include/ndbm.h:83:38: error: unknown type name ‘mode_t’ Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-05-04Fix nano-malloc buildDimitar Dimitrov1-0/+1
The nano malloc build broke with: Commit 357d7fcc6 In <stdio.h> provide only necessary types The above commit exposed a latent missing-header bug: newlib/libc/stdlib/nano-mallocr.c:220:33: error: ‘uintptr_t’ undeclared (first use in this function) Fix by including <stdint.h>. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-05-04Remove _global_impure_ptr indirectionSebastian Huber6-51/+12
Remove the pointer indirection through the read-only _global_impure_ptr and directly use a externally visible _impure_data object of type struct _reent. This enables the static initialization of global data structures in a follow up patch. In addition, we get rid of a machine-specific file.
2022-05-04In <stdio.h> provide only necessary typesSebastian Huber1-1/+11
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 tests for tzset POSIX timezone string complianceJeff Johnston2-0/+175
- patch from jdbouleu <hi@jdoubleu.de> - create time.exp and tzset.c files in newlib/testsuite/newlib.time
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-07fix testsuite cannot compile testsjdoubleu1-0/+2
DEJAGNU could not find the function 'newlib_target_compile', because it was defined in another file.
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 Frysinger137-11760/+266
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 Stubbs3-15/+15
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 Huber4-421/+396
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-17newlib: enable automatic dependency generationMike Frysinger4-7151/+32111
This was disabled as part of the migration away from the cygnus option as that implied no-dependencies. We currently have 1-to-1 updates enabled -- if you touch a .c file, the corresponding .o file will be rebuilt. But if you touch a header file, none of the files using that get rebuilt.
2022-03-16newlib: libm: integrate tests subdirMike Frysinger8-216/+317
Integrate the old libm/test/ subdir into the main build. It hasn't been used in a long time causing the code to rot a bit. I've fixed some of those, but it still fails for many ports, so it's disabled by default. People who want to take a closer look can run: $ make libm/test/test
2022-03-16newlib: integrate iconv update to maintainer buildMike Frysinger3-3/+37
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: update build system generation documentationMike Frysinger3-72/+191
Replace all of the individual autotool steps with a single autoreconf. This simplifies the documentation greatly, and in the current system, only takes ~10 seconds to regenerate everything. Update the developer documentation to cover all the major components of the current build system. Hopefully this is a fairly complete road map to everything. I tried to include everything that I wish I knew when I started hacking on this :P.
2022-03-16newlib: libc: merge build up a directoryMike Frysinger334-71950/+18359
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-09build: Avoid length() awk functionSebastian Huber2-4/+4
Some awk implementations such as old versions of mawk do not support the length() function. Use the return value of the POSIX split() function instead.
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: drop redundant AM_MAINTAINER_MODE callMike Frysinger2-31/+1
This is already called earlier in this file, so no need to do it again.
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: speed up targ-include setup & add error checkingMike Frysinger2-130/+47
The current targ-include setup runs `cp` every header file it installs, in serial. This can be a little noticeable on systems, so cleanup the logic to rely on cp's ability to copy multiple files to a directory in a single call. We still need a check for empty directories with no headers (i.e. the glob doesn't match anything), so add a helper variable to contain that logic to reduce the boiler plate a little.
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-28newlib: simplify header setup rulesMike Frysinger2-42/+30
Since POSIX cp requires copying a file to a directory without having to specify the name explicitly, rely on that to avoid calling basename on every source file. We can also drop the stub `true` call if the -f test failed. The use of `if` already takes care of that in POSIX shell.
2022-02-25newlib: libc: move configure into top-levelMike Frysinger117-9115/+4268
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-24newlib: add silent rules support to top-level rulesMike Frysinger2-64/+64