aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-04-12Cygwin: pty: Do not set internal handles in HPCON inheritable.Takashi Yano1-4/+4
- The internal handles in HPCON should not be inheritable, however, the current code duplicates them as inheritable when handing over ownership of the pseudo console. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2022-April/251222.html
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-09Cygwin: pty: Close pseudo console only if the process is the owner.Takashi Yano1-1/+2
- Currently, close_pseudoconsole() is called unconditionally from fhandler_termios::process_sigs() on Ctrl-C. This causes deadlock if Ctrl-C is pressed while setup_pseudoconsole() is called. With this patch, close_pseudoconsole() is called only if the master process is the owner of the nat-pipe to avoid the deadlock.
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-02Cygwin: pipe: Avoid deadlock for non-cygwin writer.Takashi Yano6-1/+76
- As mentioned in commit message of the commit b531d6b0, if multiple writers including non-cygwin app exist, the non-cygwin app cannot detect pipe closure on the read side when the pipe is created by system account or the the pipe creator is running as service. This is because query_hdl which is held in write side also is a read end of the pipe, so the pipe is still alive for the non-cygwin app even after the reader is closed. To avoid this problem, this patch lets all processes in the same process group close query_hdl using newly introduced internal signal __SIGNONCYGCHLD when non-cygwin app is started. Addresses: https://cygwin.com/pipermail/cygwin/2022-March/251097.html
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-04-01fhandler_proc.cc(format_proc_cpuinfo): add Linux Superb Owl cpuinfo flagsBrian Inglis1-2/+9
0x00000007:1 EBX:0 intel_ppin Intel Protected Processor Inventory Number 0x00000006:0 EAX:19 hfi Hardware Feedback Interface 0x00000007:0 EDX:20 ibt Intel Indirect Branch Tracking
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 Huber5-42/+15
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-30Cygwin: pty: Fix crash on master close in Windows 7.Takashi Yano2-1/+4
- The 4th parameter of WriteFile() cannot be NULL especially in Windows 7 as mentioned in Microsoft documentation. This patch fixes that. Addresses: https://cygwin.com/pipermail/cygwin/2022-March/251162.html
2022-03-28newlib: drop phoenix supportMike Frysinger138-11798/+277
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-20Revert accidental change to v850/sim.ldJeff Law1-1/+1
2022-03-19Avoid using common symbols in v850 libglossJeff Law52-52/+52
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-19Cygwin: console: Do not use memcmp() to compare INPUT_RECORD.Takashi Yano1-3/+38
- Using memcmp() to compare structure such as INPUT_RECORD is not correct manner because padding may not be initialized. This patch stops to use memcmp() for comparison of INPUT_RECORD.
2022-03-19Cygwin: console: Ignore dwControlKeyState in event comparison.Takashi Yano1-3/+3
- dwControlKeyState also may be null'ed on WriteConsoleInputW(). Therefore ignore it in event comparison as well as wVirtualKeyCode and wVirtualScanCode.
2022-03-18Cygwin: console: Add attach_mutex guard that was not added.Takashi Yano1-0/+2
2022-03-18Cygwin: console: Fix typeahead key swapping which still occurs.Takashi Yano1-20/+38
- The commit "Cygwin: console: Improve the code to avoid typeahead key swapping." did not solve the problem enough. Two unexpected things happen. (1) wVirtualKeyCode and wVirtualScanCode of readback key event may be null'ed even if they are not zero on WriteConsoleInputW(). Therefore, memcmp() may report the event sequence is not equal. (2) WriteConsoleInputW() may not be atomic. The event sequence which is written by WriteConsoleInputW() may be inserted by key input in the middle of the sequence. Current code gives up to fix in this situation. This patch should fix that issue.
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-17Cygwin: document recent gmondump formatting fixMark Geisert1-0/+3
2022-03-17Cygwin: Fix gmondump formatting goofsMark Geisert1-3/+3
The rewrite of %X to %p was malhandled. Fix that/them.
2022-03-16winsup: disable fortify sourceMike Frysinger1-1/+1
When using a compiler that automatically enables -D_FORTIFY_SOURCE, building winsup fails with errors like below. Since winsup is not setup to compile itself with _FORTIFY_SOURCE, disable it for now. make[4]: Entering directory '.../x86_64-pc-cygwin/winsup/cygwin' CC libc/minires-os-if.o In file included from .../newlib/newlib/libc/include/ssp/strings.h:34, from .../newlib/newlib/libc/include/strings.h:77, from .../newlib/newlib/libc/include/string.h:24, from ../../../../../winsup/cygwin/string.h:12, from /usr/x86_64-pc-cygwin/usr/include/w32api/guiddef.h:154, from /usr/x86_64-pc-cygwin/usr/include/w32api/winnt.h:635, from /usr/x86_64-pc-cygwin/usr/include/w32api/minwindef.h:163, from /usr/x86_64-pc-cygwin/usr/include/w32api/windef.h:9, from /usr/x86_64-pc-cygwin/usr/include/windows.h:69, from ../../../../../winsup/cygwin/winlean.h:56, from ../../../../../winsup/cygwin/winsup.h:84, from ../../../../../winsup/cygwin/libc/minires-os-if.c:13: .../newlib/winsup/cygwin/include/ssp/socket.h:9:1: error: conflicting types for 'recv'; have 'ssize_t(int, void *, size_t, int)' {aka 'long int(int, void *, long unsigned int, int)'} 9 | __ssp_redirect0(ssize_t, recv, \ | ^~~~~~~~~~~~~~~ In file included from /usr/x86_64-pc-cygwin/usr/include/w32api/ws2tcpip.h:17, from ../../../../../winsup/cygwin/libc/minires-os-if.c:14: /usr/x86_64-pc-cygwin/usr/include/w32api/winsock2.h:1022:34: note: previous declaration of 'recv' with type 'int(SOCKET, char *, int, int)' {aka 'int(long long unsigned int, char *, int, int)'} 1022 | WINSOCK_API_LINKAGE int WSAAPI recv(SOCKET s,char *buf,int len,int flags); | ^~~~ In file included from .../newlib/newlib/libc/include/ssp/strings.h:34, from .../newlib/newlib/libc/include/strings.h:77, from .../newlib/newlib/libc/include/string.h:24, from ../../../../../winsup/cygwin/string.h:12, from /usr/x86_64-pc-cygwin/usr/include/w32api/guiddef.h:154, from /usr/x86_64-pc-cygwin/usr/include/w32api/winnt.h:635, from /usr/x86_64-pc-cygwin/usr/include/w32api/minwindef.h:163, from /usr/x86_64-pc-cygwin/usr/include/w32api/windef.h:9, from /usr/x86_64-pc-cygwin/usr/include/windows.h:69, from ../../../../../winsup/cygwin/winlean.h:56, from ../../../../../winsup/cygwin/winsup.h:84, from ../../../../../winsup/cygwin/libc/minires-os-if.c:13: .../newlib/winsup/cygwin/include/ssp/socket.h:13:1: error: conflicting types for 'recvfrom'; have 'ssize_t(int, void *, size_t, int, struct sockaddr *, socklen_t *)' {aka 'long int(int, void *, long unsigned int, int, struct sockaddr *, int *)'} 13 | __ssp_redirect0(ssize_t, recvfrom, \ | ^~~~~~~~~~~~~~~ In file included from /usr/x86_64-pc-cygwin/usr/include/w32api/ws2tcpip.h:17, from ../../../../../winsup/cygwin/libc/minires-os-if.c:14: /usr/x86_64-pc-cygwin/usr/include/w32api/winsock2.h:1023:34: note: previous declaration of 'recvfrom' with type 'int(SOCKET, char *, int, int, struct sockaddr *, int *)' {aka 'int(long long unsigned int, char *, int, int, struct sockaddr *, int *)'} 1023 | WINSOCK_API_LINKAGE int WSAAPI recvfrom(SOCKET s,char *buf,int len,int flags,struct sockaddr *from,int *fromlen); | ^~~~~~~~ make[4]: *** [Makefile:1930: libc/minires-os-if.o] Error 1 CC gmon.o ../../../../../winsup/cygwin/gmon.c:60: error: "bzero" redefined [-Werror] 60 | #define bzero(ptr,size) memset (ptr, 0, size); | In file included from .../newlib/newlib/libc/include/strings.h:77, from .../newlib/newlib/libc/include/string.h:24, from ../../../../../winsup/cygwin/string.h:12, from /usr/x86_64-pc-cygwin/usr/include/w32api/guiddef.h:154, from /usr/x86_64-pc-cygwin/usr/include/w32api/winnt.h:635, from /usr/x86_64-pc-cygwin/usr/include/w32api/minwindef.h:163, from /usr/x86_64-pc-cygwin/usr/include/w32api/windef.h:9, from /usr/x86_64-pc-cygwin/usr/include/windows.h:69, from ../../../../../winsup/cygwin/winlean.h:56, from ../../../../../winsup/cygwin/winsup.h:84, from ../../../../../winsup/cygwin/gmon.h:69, from ../../../../../winsup/cygwin/gmon.c:47: .../newlib/newlib/libc/include/ssp/strings.h:43: note: this is the location of the previous definition 43 | #define bzero(dst, len) \ | cc1: all warnings being treated as errors
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 Frysinger335-71951/+18360
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-15Cygwin: Add description of fsync() fix to 3.3.5 release notes.Takashi Yano1-0/+4
2022-03-14Cygwin: path: Convert type of variable 'remlen' to DWORD.Takashi Yano1-2/+1
- Variable remlen stores the return value of QueryDosDeviceW(), so it is better to be DWORD.
2022-03-14Cygwin: path: Add fallback for DFS mounted drive.Takashi Yano1-5/+12
- If UNC path for DFS is mounted to a drive with drive letter, the error "Too many levels of symbolic links" occurs when accessing to that drive. This is because GetDosDeviceW() returns unexpected string such as "\Device\Mup\DfsClient\;Z:000000000003fb89\dfsserver \dfs\linkname" for the mounted UNC path "\??\UNC\fileserver\share". This patch adds a workaround for this issue. Addresses: https://cygwin.com/pipermail/cygwin/2022-March/250979.html
2022-03-14Cygwin: fsync: Return EINVAL for special files.Takashi Yano1-1/+1
- Unlike linux, fsync() calls FlushFileBuffers() even for special files. This causes the problem reported in: https://cygwin.com/pipermail/cygwin/2022-March/251022.html This patch fixes the issue.
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-10Cygwin: console, pty: Fix segfault in child_info_spawn::worker().Takashi Yano2-3/+7
- After the commit "Cygwin: pty, console: Fix handle leak which occurs on exec() error.", startxwin cannot start X due to the error "Failed to activate virtual core keyboard: 2". The problem is access violation in the code retrieving the pgid of the ctty. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2022-March/251013.html
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-05Cygwin: update 3.3.5 release notesTakashi Yano1-0/+8
2022-03-05Cygwin: add 3.3.5 release notesTakashi Yano1-0/+30
2022-03-05Cygwin: pty: Adopt the variable name to the name generally used.Takashi Yano1-10/+10
- Generally, '\n' is called "line feed" (not "new line"), so the variable name p_nl has been changed to p_lf.
2022-03-05Cygwin: pty: Add several further comments to the pty code.Takashi Yano1-3/+15
2022-03-05Cygwin: pty: Take account of CR+NL line feed in input.Takashi Yano1-7/+16
- Currently, individual CR or NL is treated as line feed in accept_input() and transfer_input(). This patch takes account of CR+NL as well.