Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-12-23GCN: Implement '_exit' instead of 'exit'Thomas Schwinge
... 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-19Add generated files for Revert patchJeff Johnston
2023-12-04RISC-V: Support long double mathKito Cheng
Long double for RISC-V is using 128 bit IEEE 754 format like Aarch64, so we reference AArch64 to support that.
2023-11-21aarch64: Remove duplicated optimized memmove()Sebastian Huber
The optimized aarch64/memcpy.S already provides a memmove() implementation.
2023-11-20stdio: split byte- and wide-char-oriented low-level output functionsCorinna Vinschen
Introduce function __swbufw_r and macros/inline-functions called __swputc_r. Call these functions/macros exclusively from wide-char functions. This allows to set and test the stream orientation correctly even if output is only performed using byte-oriented macros from stdio.h. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-17v{fs}printf/v{fs}wprintf: create external output helpersCorinna Vinschen
So far, the printf family of functions has two output helper functions called __sprint_r and __sfputs_r. Both are called from all variants of vfprintf as well as vfwprintf. There are also analogue helper functions for the string-creating functions vsprintf/vswprintf called __ssprint_r and __ssputs_r. However, the helpers are built once when building vfprintf/vsprintf with the INTEGER_ONLY flag, and then they are part of the vfiprintf.c and vsiprintf.c files. The problem is this: Even if a process only calls vfwprintf or the non-INTEGER_ONLY vfprintf it will always have to include the INTEGER_ONLY vfiprintf. Otherwise the helper functions are undefined. Analogue for the string-creating functions. That's a useless waste of space by including one (or two) big, unused function, if newlib is linked in statically. Create new files to define the printf output helpers separately and split them into byte-oriented and wide-char-oriented functions. This allows to link only the required functions. Also, simplify the string output helpers and fix a potential (but unlikely) buffer overflow in __ssprint_r. Fixes: 8a0efa53e449 ("import newlib-2000-02-17 snapshot") Fixes: 6121968b198d ("* libc/include/stdio.h (__VALIST): Guard against multiple definition.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-10-05aarch64: Import memrchr.SSebastian Huber
Import memrchr.S for AArch64 from: https://github.com/ARM-software/optimized-routines commit 0cf84f26b6b8dcad8287fe30a4dcc1fdabd06560 Author: Sebastian Huber <sebastian.huber@embedded-brains.de> Date: Thu Jul 27 17:14:57 2023 +0200 string: Fix corrupt GNU_PROPERTY_TYPE (5) size For ELF32 the notes alignment is 4 and not 8.
2023-09-18newlib: Fix header installAlexey Lapshin
2023-08-29newlib: fix 'sed' for sys headers path prefixAlexey Lapshin
Precisely remove the prefix from the filepath.
2023-08-18newlib: add Xtensa portAlexey Lapshin
2023-08-10Add wildcard support to recurse into sys include directoriesAlexey Lapshin
2023-08-09Add stub for getentropyTorbjörn SVENSSON
Example test case that fails with undefined reference to getentropy: Testing g++.robertl/eb77.C, -std=c++20 doing compile Executing on host: /build/gcc-13-2709-g9ac9fde961f/bin/arm-none-eabi-g++ /build/src/gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C -mthumb -march=armv6s-m -mcpu=cortex-m0 -mfloat-abi=soft -fdiagnostics-plain-output -fmessage-length=0 -std=c++20 -pedantic-errors -Wno-long-long -Wl,--start-group -lc -lm -Wl,--end-group --specs=nosys.specs -Wl,--allow-multiple-definition -Wl,-u,_isatty,-u,_fstat -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -Wl,g++_tg.o -lm -o ./eb77.exe (timeout = 800) spawn -ignore SIGHUP /build/gcc-13-2709-g9ac9fde961f/bin/arm-none-eabi-g++ /build/src/gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C -mthumb -march=armv6s-m -mcpu=cortex-m0 -mfloat-abi=soft -fdiagnostics-plain-output -fmessage-length=0 -std=c++20 -pedantic-errors -Wno-long-long -Wl,--start-group -lc -lm -Wl,--end-group --specs=nosys.specs -Wl,--allow-multiple-definition -Wl,-u,_isatty,-u,_fstat -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -Wl,g++_tg.o -lm -o ./eb77.exe pid is 28414 -28414 /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libstdc++.a(random.o): in function `std::(anonymous namespace)::__libc_getentropy(void*)': (.text._ZNSt12_GLOBAL__N_117__libc_getentropyEPv+0x8): undefined reference to `getentropy' /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libstdc++.a(random.o): in function `std::random_device::_M_init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': (.text._ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x58): undefined reference to `getentropy' /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-arc4random.o): in function `_rs_stir': (.text._rs_stir+0x8): undefined reference to `getentropy' collect2: error: ld returned 1 exit status pid is -1 close result is 28414 exp6 0 1 output is /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libstdc++.a(random.o): in function `std::(anonymous namespace)::__libc_getentropy(void*)': (.text._ZNSt12_GLOBAL__N_117__libc_getentropyEPv+0x8): undefined reference to `getentropy' /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libstdc++.a(random.o): in function `std::random_device::_M_init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': (.text._ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x58): undefined reference to `getentropy' /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/bin/ld: /build/gcc-13-2709-g9ac9fde961f/bin/../lib/gcc/arm-none-eabi/13.0.0/../../../../arm-none-eabi/lib/thumb/v6-m/nofp/libc.a(libc_a-arc4random.o): in function `_rs_stir': (.text._rs_stir+0x8): undefined reference to `getentropy' collect2: error: ld returned 1 exit status status 1 compiler exited with status 1 FAIL: g++.old-deja/g++.robertl/eb77.C -std=c++20 (test for excess errors) Excess errors: (.text._ZNSt12_GLOBAL__N_117__libc_getentropyEPv+0x8): undefined reference to `getentropy' (.text._ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x58): undefined reference to `getentropy' (.text._rs_stir+0x8): undefined reference to `getentropy' UNRESOLVED: g++.old-deja/g++.robertl/eb77.C -std=c++20 compilation failed to produce executable Contributed by STMicroelectronics Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2023-05-16Regenerated source for adding non LDBL_EQ_DBLJennifer Averett
2023-05-05Regenerated source for moving signgam.cJennifer Averett
2023-02-22Fix libgloss/newlib build to conditionally use top include dirJeff Johnston
- conditionally use -idirafter option for arm
2023-01-18amdgcn: Add vectorized math routinesKwok Cheung Yeung
This implements a set of vectorized math routines to be used by the compiler auto-vectorizer. Versions for vectors with 2 lanes up to 64 lanes (in powers of 2) are provided. These routines are based on the scalar versions of the math routines in libm/common, libm/math and libm/mathfp. They make extensive use of the GCC C vector extensions and GCN-specific builtins in GCC.
2023-01-11libgloss: arm: break newlib dependencyMike Frysinger
The libgloss port has been reaching back into newlib internals for a single header whose contents have been frozen for almost a decade. To break this backwards libgloss->newlib dependency, move the acle header to the srcroot include/ so everyone can use the same copy.
2022-12-22nvptx: Implement '_exit' instead of 'exit'Thomas Schwinge
... so that all of 'exit', '_exit', '_Exit' work. 'exit' thus becomes the standard 'newlib/libc/stdlib/exit.c' -- and functions registered via 'atexit' are now called at return from 'main' or manual 'exit' invocation.
2022-12-16Revert "amdgcn: Add vectorized math routines"Jeff Johnston
This reverts commit 125e39bfea1a39341a60348c93a65cf4894e0f2a.
2022-12-16amdgcn: Add vectorized math routinesKwok Cheung Yeung
This implements a set of vectorized math routines to be used by the compiler auto-vectorizer. Versions for vectors with 2 lanes up to 64 lanes (in powers of 2) are provided. These routines are based on the scalar versions of the math routines in libm/common, libm/math and libm/mathfp. They make extensive use of the GCC C vector extensions and GCN-specific builtins in GCC.
2022-10-29makedocbook: Add explicit locking for PLY parser table generationJon Turney
Drop 'makedocbook --cache' (any dependency on the man-cache rule which invokes that was dropped by the non-recursive make changes) Instead, add some explicit locking which prevents processes colliding over the file containing generated python code for the parser table.
2022-09-28Rerun automake in newlib/Szabolcs Nagy
newlib/libc/sys/arm/Makefile.inc was modified but automake was not rerun in commit 5230eb7f8c6b43c71d7e38d138935c48de930b76 Implement sysconf for Arm on arm-none-eabi target this caused ld: B/arm-none-eabi/lib/libg.a(libc_a-mallocr.o): in function `malloc_extend_top': S/newlib-cygwin/newlib/libc/stdlib/_mallocr.c:2161: undefined reference to `sysconf'
2022-08-15SH: Do not build syscalls if option providedYilin Sun via Newlib
This patch makes syscalls for SH architecture respecting the global option "--disable-newlib-supplied-syscalls". This is useful when a bare-metal toolchain is needed. Signed-off-by: Yilin Sun <imi415@imi.moe>
2022-05-16newlib: Regenerate Makefile.inSebastian Huber
Regenerate Makefile.in to include changes in Makefile.am of commit 81b7cf09faa523e7bb438abe24e6e5376e45a0e5.
2022-05-04Remove _global_impure_ptr indirectionSebastian Huber
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-03-29newlib: drop phoenix supportMike Frysinger
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-23amdgcn: Fix build failureAndrew Stubbs
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 Huber
Consistently use if !ELIX_LEVEL_1 to enable EL/IX level 2 interfaces.
2022-03-18newlib: enable automatic dependency generationMike Frysinger
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-17newlib: libm: integrate tests subdirMike Frysinger
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-17newlib: integrate iconv update to maintainer buildMike Frysinger
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-17newlib: libc: merge build up a directoryMike Frysinger
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-09build: Avoid length() awk functionSebastian Huber
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-01newlib: speed up targ-include setup & add error checkingMike Frysinger
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-03-01newlib: simplify header setup rulesMike Frysinger
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 Frysinger
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-25newlib: add silent rules support to top-level rulesMike Frysinger
2022-02-24newlib: fix multilib libg.a parallel buildsMike Frysinger
I split libg.a out into a sep target from libc.a for the main dir in commit f2b053f49ed2bd7b4da8cf4ed3a608dc2f425c2b ("newlib: separate out libg from libc"), but missed the multilib dirs. That leads to an uncommon parallel build failure: - libc.a rule runs & finishes - $(BUILD_MULTISUBDIR)/libc.a rule runs -> failure due to libg.a not yet existing - libg.a rule runs & finishes Split the multilib libg rule out from libc too so it can depend on the main libg directly and avoid this race.
2022-02-24newlib: libm: workaround ar duplicate member behaviorMike Frysinger
GNU ar has undocumented behavior where it doesn't dedupe its inputs if they're all on the same command line, so we have to dedupe ourselves.
2022-02-18newlib: libm: merge build up a directoryMike Frysinger
Convert all the libm/ subdir makes into the top-level Makefile. This allows us to build all of libm 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 libm.a. The machine override logic is maintained though by way of Makefile include ordering, and source file accumulation in libm_a_SOURCES. One thing to note is that this will require GNU Make because of: libm_a_CFLAGS = ... $(libm_a_CFLAGS_$(subst /,_,$(@D))) This was the only way I could find to supporting per-dir compiler settings, and I couldn't find a POSIX compatible way of transforming the variable content. I don't think this is a big deal as other Makefiles in the tree are using GNU Make-specific syntax, but I call this out as it's the only one so far in the new automake code that I've been writing. Automake doesn't provide precise control over the output object names (by design). This is fine by default as we get consistent names in all the subdirs: libm_a-<source>.o. But this relies on using the same set of compiler flags for all objects. We currently compile libm/common/ with different optimizations than the rest. If we want to compile objects differently, we can create an intermediate archive with the subset of objects with unique flags, and then add those objects to the main archive. But Automake will use a different prefix for the objects, and thus we can't rely on ordering to override. But if we leverage $@, we can turn Automake's CFLAGS into a multiplex on a per-dir (and even per-file if we wanted) basis. Unfortunately, since $@ contains /, Automake complains it's an invalid name. While GNU Make supports this, it's a POSIX extension, so Automake flags it. Using $(subst) avoids the Automake warning to get a POSIX compliant name, albeit with a GNU Make extension.
2022-02-18newlib: separate out libg from libcMike Frysinger
Make this a separate target from libc so that we can migrate libc over to automake more easily. Having it integrated into the libc target is difficult to handle when using automake rules which expect a one-to-one mapping between names & inputs.
2022-02-18newlib: libc: reshuffle include order for the manualMike Frysinger
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: add missing mkdir to header installMike Frysinger
Make sure these subdirs exist before trying to install headers into them.
2022-02-16newlib: rename doc/local.mk to Makefile.incMike Frysinger
For consistency across the whole tree.
2022-02-10newlib: libm: move configure into top-levelMike Frysinger
This kills off the last configure script under libm/ and folds it into the top newlib configure script. The vast majority of logic was already in the top configure script, so move the little that is left into a libm/acinclude.m4 file.
2022-02-10newlib: drop support for $oextMike Frysinger
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-10newlib: drop support for $aextMike Frysinger
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-10newlib: fix mkdoc dependenciesMike Frysinger
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-10newlib: drop libtool supportMike Frysinger
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-10newlib: drop unused iconvdataMike Frysinger
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.