aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-01-31Cygwin: implement setproctitlegithub/topic/3.6topic/3.6Corinna Vinschen7-20/+67
Make sure to create commandline according to setting of setproctitle. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: commune_process: don't use IsBadStringPtrCorinna Vinschen1-4/+1
IsBadStringPtr is deprecated and just gives a wrong sense of memory safety. Replace with check for NULL pointer. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: globals: make __progname an alias of program_invocation_short_nameCorinna Vinschen5-19/+22
On Linux, __progname and program_invocation_short_name are just different exported names of the same string. Do the same in Cygwin. This requires to tweak the mkglobals_h so as not to touch the EXPORT_ALIAS expression. Also, use the base variable program_invocation_short_name throughout. __progname is just the export for getopt. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: cygwin_GetCommandLineW/A: don't rely on __argv[0] contentCorinna Vinschen1-2/+5
Since it's possible to change the __argv array, we should not rely on __argv[0] actually representing the windows executable path in any way. Use the real path stored in global_progname instead. Fixes: 521953a83a885 ("* common.din: Export GetCommandLine{A,W}.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: ps -f: output command lineCorinna Vinschen2-2/+18
So far ps(1) always prints the full path of the executable under the COMMAND heading. With -f, print the command line instead. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: redefine CW_CMDLINE to CW_CMDLINE_ALLOCCorinna Vinschen2-4/+41
Make sure to - append a trailing \0 as with Windows multistrings, so the end of the string can be recognized by the caller, and - allocate cmdline on the user heap so the caller can free the multistring after usage. Fixes: 831d6fa520ed4 ("* external.cc (cygwin_internal): Implement CW_CMDLINE.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: pinfo: use stpcpy where appropriateCorinna Vinschen1-9/+3
...rather than strcpy/strchr. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31sys/stat.h: drop __INSIDE_CYGWIN__ guardsCorinna Vinschen2-6/+2
These were only necessary until we dropped 32 bit Cygwin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: posix_getdents: implement per SUS Base Specifications Issue 8 draftCorinna Vinschen9-8/+131
- Basically maintain a hidden DIR* inside fhandlers. - lseek has to be tweaked to allow basic seeking on the directory descriptor. - the current implementation does not keep the dir positions between duplicated descriptor in sync. In fact, every descriptor keeps its own copy of the DIR* and after dup/fork/exec, the directory position is reset to 0, i. e., to the start of the directory, as if rewinddir() has been called on the new descriptors. While this behaviour isn't yet covered by the Issue 8 draft, a bug report along these lines exists and will probably be picked up for TC1. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: devices.h: drop useless mode checkCorinna Vinschen1-4/+1
use IFTODT to generate type from mode. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: dirent.h: make definition of struct __DIR opaqueCorinna Vinschen2-16/+32
The content of DIR should never have been exposed into userspace. Move struct __DIR to local dirent.h and only keep forward declaration in exported dirent.h. This allows to tweak the structure in future, for instance, to add thread-safety. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: implement fdclosedirCorinna Vinschen4-7/+33
fdclosedir is BSD-only but already present in dirent.h for a couple of years. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: implement dirent.d_reclenCorinna Vinschen3-8/+23
This change is in preparation of adding posix_getdents() from the upcoming POSIX Base Specification Issue 8. - Add d_reclen - Add GLibC compatible test macros for dirent members - Bump dirent version - Set d_reclen to the fixed size of the dirent struct We can do that because the size is a multiple of 8, so it fits snugly in the buffer filled by posix_getdents and keep the alignement. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: export getlocalename_lCorinna Vinschen3-1/+11
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31getlocalename_l: implement per SUS Base Specifications Issue 8 draftCorinna Vinschen5-0/+116
#include <locale.h> const char *getlocalename_l(int category, locale_t locobj); Most notably, we need a per-thread space to store the string returned if locobj is LC_GLOBAL_LOCALE. No errors are defined for getlocalename_l. So we can't use buffer allocation which might lead to an ENOMEM error. We have to use a "static" buffer in the per-thread state. Note that the feature test macro in locale.h is not quite correct. This needs to be fixed as soon as the Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: path: convert symlink_info to classCorinna Vinschen1-140/+165
encapsulate everything Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: files: slightly simplify suffix handlingCorinna Vinschen3-32/+17
- drop appending .exe.lnk to files - drop exe_suffixes, it's the same as stat_suffixes for a long time Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Cygwin: bump DLL version to 3.6.0cygwin-3.6.0-devCorinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-31Hide itoa, utoa, __itoa and __utoa in stdlib.h on Cygwin onlycygwin-3.5.0Christian Franke1-1/+3
These functions are non-standard and not exported by Cygwin. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-01-29Cygwin: machine/_arc4random.h: Fix copy/paste bugCorinna Vinschen1-1/+0
Remove a stray __END_DECLS. It didn't hurt in the only (plain C) file including this header, but still... Fixes: 030a762535c1 ("Cygwin: fix arc4random after fork(2)") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-29ssp: add support for _FORTIFY_SOURCE=3Christian Franke4-8/+23
If specified, use __builtin_dynamic_object_size() instead of __builtin_object_size() if supported (GCC 12.0 or later). This enables buffer overflow checks if the buffer size is non-const but known during runtime. Use new macro __ssp_bos_known() instead of the (bos(p) != (size_t)-1) checks. The latter is no longer a compile time constant in all cases. This avoids the generation of unused code. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-01-29Cygwin: fix arc4random after fork(2)Corinna Vinschen2-0/+17
After using fork(), arc4random does not reseed itself, which causes the results to become predictable. Activate droppingfork-recognition Fixes: e0fc33322d50 ("Delete Cygwin's arc4random in favor of new Newlib implementation") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-29Cygwin: redefine how to recognize forkee stateCorinna Vinschen5-16/+27
So far the global variable in_forkee only indicated if the process is the child process during fork(2) itself. However, we need an indicator accessible from plain C code in newlib, allowing to check for a process being a forked process all the time, after fork(2) succeeded. Redefine bool in_forkee to int __in_forkee to allow exposing it to newlib. Redefine how it indicates fork state (not forked, forking, forked). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-25Cygwin: Add a timeout to ensure we don't wait forever for dumperJon Turney1-2/+6
2024-01-24libgloss: start a MAINTAINERS fileMike Frysinger1-0/+13
2024-01-24Cygwin: pthread: Fix handle leak in pthread_once.Takashi Yano1-0/+3
If pthread_once() is called with pthread_once_t initialized using PTREAD_ONCE_INIT, pthread_once does not release pthread_mutex used internally. This patch fixes that by calling pthread_mutex_destroy() in the thread which has called init_routine. Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-01-23Cygwin: Don't terminate via dumperJon Turney2-4/+9
A process which is exiting due to a core dumping signal doesn't propagate the correct exist status after dumping core, because 'dumper' itself forcibly terminates the process. Use 'dumper -n' to avoid killing the dumped process, so we continue to the end of signal_exit(), to exit with the 128+signal exit status. Busy-wait in exec_prepared_command() in an attempt to reliably notice the dumper attaching, so we don't get stuck there. Also: document these important facts for custom uses of error_start.
2024-01-23libgloss: merge cr16 into top-level MakefileMike Frysinger6-421/+458
Avoid a recursive make to speed things up a bit. A cr16-elf build shows installed objects & libs produce same code. The test targets were dropped as they didn't actually work -- there is no test.o rule in here.
2024-01-23configure.ac: configurable tooldir install pathNeal Frager2-3/+39
This patch is required to fix how the newlib headers are installed when using a sysroot install directory. The cross compiler expects headers to be in .../host/usr/arm-none-eabi/sysroot/usr/include/newlib.h by default newlib installed the headers into .../host/usr/arm-none-eabi/sysroot/usr/arm-none-eabi/include/newlib.h ${exec_prefix} provides the .../host/usr/arm-none-eabi/sysroot path ${target_noncanonical} provides an extra arm-none-eabi/ that must be removed. With this patch, users can specify the tooldir path that is needed. Signed-off-by: Neal Frager <neal.frager@amd.com> Co-developed-by: Chris Wardman <cjwfirmware@vxmdesign.com>
2024-01-23libgloss: pru: Trim crt0-minrt.oDimitar Dimitrov1-14/+1
Strip a few more instructions from crt0-minrt.S: - Remove "halt" and rely on the infinite loop after main()'s return. - Remove main()'s argc and argv argument initialization. Host loader does not set them, and typical firmware does not use them, either. - Remove the __dso_handle symbol. This should be safe because the default crt0.S is fully standards compliant. Whereas crt0-minrt.S has been documented from the beginning to intentionally miss features in order to reduce firmware size, while still enabling typical PRU firmware to operate. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2024-01-23libgloss: merge pru into top-level MakefileDimitar Dimitrov8-302/+388
Avoid a recursive make to speed things up a bit. This change was inspired by the recent similar patch for c6x: https://sourceware.org/pipermail/newlib/2023/020869.html While at it, fork crt0-minrt.S into a separate source file instead of relying on a predefined macro to generate two different object files. This improves clarity, simplifies the build rules, and would allow further optimization in crt0-minrt.S to be implemented more cleanly. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2024-01-23Cygwin: seekdir: don't set errnoCorinna Vinschen1-1/+0
Commit 3f3bd1010455 ("* Throughout, use __try/__except/__endtry blocks [...]") introduced setting EINVAL, marked as "Diagnosis". The reason for this is lost in time and space, but looks very much like a debug helper which was supposed to be removed before release. It's rather pointless, so remove it. Fixes: 3f3bd1010455 ("* Throughout, use __try/__except/__endtry blocks [...]") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-22newlib: docs: add "Function " to every function nodeMike Frysinger20-436/+436
When creating a split manual with one-node-per-page, the main index.html ends up getting clobbered by the page for the index() function because it uses "@node index" which, for html, also creates an index.html page. To remedy this, add "Function " to every function node so now we output "Function-index.html" and avoid clobbering. It also namespaces every other function and helps make sure we don't clobber anything else. Otherwise, there isn't really much rendering difference as @node text is mostly internal. Node title text comes from @section instead.
2024-01-22newlib: docs: print the function indexMike Frysinger2-0/+11
The generated function documentation makes sure to include entries for every function in the function index via @findex, but then the manuals forget to actually print the index.
2024-01-22libgloss: doc: unify duplicate copyright/license contentMike Frysinger1-23/+17
Use @copying & @insertcopying directives to define the copyright & license block only once, and then inserted at the same places as it was before.
2024-01-22libgloss: doc: fix dir info entry usageMike Frysinger1-3/+4
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.
2024-01-22Add Dimitar Dimitrov as maintainer for pruJeff Johnston1-0/+1
2024-01-19libgloss: xc16x: drop old stub portMike Frysinger21-645/+2
First off, afaict, xc16x support has never been merged into gcc. Upstream merge isn't strictly required for new ports, but it seems like people should merge eventually in some shape, and considering the libgloss port was merged in 2009, ~14 years seems like plenty of leeway. Which is to say, no one else can seem to build this which makes updating & testing things very difficult. Ignoring that, from what I can tell, this port has only ever built and installed a crt0.o file. It defines libeval.a & libcygmon.a targets, but nothing depends on them. The SCRIPTS & BSP variables are always empty. The original port merge define these in the configure script as substitutes, but never set the vars, so they were always replaced with nothing. I actually broke this build 2 years ago when merging the configure up a level in commit 30f244155b8e82aa948ddcb8f2350654fc1adb92 ("libgloss: merge subdirs that have unique makefile_frags up a level"). I saw that it was exporting a bunch of vars in the configure script, but never set them, so I incorrectly assumed they weren't used. Which means the Makefile has been setting them to invalid values like literal @bsp_list@ and @script_list@. Considering no one has complained, I have to assume no one cares about this port, and we can all stop wasting time on it.
2024-01-19libgloss: merge microblaze into top-level MakefileMike Frysinger6-331/+473
Avoid a recursive make to speed things up a bit. A microblaze-elf build shows installed objects & libs produce same code.
2024-01-19libgloss: microblaze: use port-specific sbrkMike Frysinger1-0/+1
The default search path uses the common sbrk.c over the microblaze one, so add a rule to force the microblaze variant instead.
2024-01-19libgloss: merge tic6x into top-level MakefileMike Frysinger6-218/+163
Avoid a recursive make to speed things up a bit. A tic6x-elf build shows installed objects & libs produce same code.
2024-01-19libgloss: merge sparc_leon into top-level MakefileMike Frysinger6-276/+658
Avoid a recursive make to speed things up a bit. A sparc-elf build shows installed objects & libs produce same code.
2024-01-19libgloss: sparc_leon: workaround newer newlib pthread APIsMike Frysinger1-0/+4
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;
2024-01-19libgloss: merge sparc into top-level MakefileMike Frysinger7-383/+575
Avoid a recursive make to speed things up a bit. A sparc-elf build shows installed objects & libs produce same code.
2024-01-19libgloss: sparc: always install erc32 sim filesMike Frysinger1-3/+3
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.
2024-01-19libgloss: merge ft32 into top-level MakefileMike Frysinger6-317/+341
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.
2024-01-19libgloss: ft32: delete unused/invalid assembly fileMike Frysinger1-31/+0
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.
2024-01-19libgloss: merge fr30 into top-level MakefileMike Frysinger6-336/+244
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.
2024-01-19libgloss: merge or1k into top-level MakefileMike Frysinger7-249/+439
Avoid a recursive make to speed things up a bit. A or1k-elf build shows installed objects & libs produce same code.
2024-01-19libgloss: merge epiphany into top-level MakefileMike Frysinger6-379/+394
Avoid a recursive make to speed things up a bit. A epiphany-elf build shows installed objects & libs produce same code.