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-11-28newlib: filter out versions from newlib.h to simplify autoreconfMike Frysinger
We've been manually editing newlib.hin after generating it with autoheader to drop the version defines that we keep in the separate _newlib_version.h header. This is confusing for people, and is an easy source of mistakes/errors. Since we're already running sed on newlib.h during configure to filter out defines we don't want to expose, add the version macros there too. This way we don't have to manually edit newlib.hin. This simplifies the autoreconf step in exchange for a slightly more complicated configure+sed step, but seems worth the trade-off.
2023-10-15newlib: fix AC_DEFINE quoting style with version macrosMike Frysinger
configure.ac files use [] for quoting by default, not "", which means the "" are passed through as literals. We don't want that for these comments, so change the "..." to [...].
2022-08-23Fix problem with _newlib_version.h not being filled in correctlyJeff Johnston
2022-07-13Add --enable-newlib-reent-thread-local optionMatt Joyce
By default, Newlib uses a huge object of type struct _reent to store thread-specific data. This object is returned by __getreent() if the __DYNAMIC_REENT__ Newlib configuration option is defined. The reentrancy structure contains for example errno and the standard input, output, and error file streams. This means that if an application only uses errno it has a dependency on the file stream support even if it does not use it. This is an issue for lower end targets and applications which need to qualify the software according to safety standards (for example ECSS-E-ST-40C, ECSS-Q-ST-80C, IEC 61508, ISO 26262, DO-178, DO-330, DO-333). If the new _REENT_THREAD_LOCAL configuration option is enabled, then struct _reent is replaced by dedicated thread-local objects for each struct _reent member. The thread-local objects are defined in translation units which use the corresponding object.
2022-06-10Use global stdio streams for all configurationsSebastian Huber
The _REENT_GLOBAL_STDIO_STREAMS was introduced by commit 668a4c8722090fffd10869dbb15b879651c1370d in 2017. Since then it was enabled by default for RTEMS. Recently, the option was enabled for Cygwin which previously used an alternative implementation to use global stdio streams. In Newlib, the stdio streams are defined to thread-specific pointers _reent::_stdin, _reent::_stdout and _reent::_stderr. If the option is disabled (the default for most systems), then these pointers are initialized to thread-specific FILE objects which use file descriptors 0, 1, and 2, respectively. There are at least three problems with this: (1) The thread-specific FILE objects are closed by _reclaim_reent(). This leads to problems with language run-time libraries that provide wrappers to the C/POSIX stdio streams (for example C++ and Ada), since they use the thread-specific FILE objects of the initialization thread. In case the initialization thread is deleted, then they use freed memory. (2) Since thread-specific FILE objects are used with a common output device via file descriptors 0, 1 and 2, the locking at FILE object level cannot ensure atomicity of the output, e.g. a call to printf(). (3) There are resource managment issues, see: https://sourceware.org/pipermail/newlib/2022/019558.html https://bugs.linaro.org/show_bug.cgi?id=5841 This patch enables the _REENT_GLOBAL_STDIO_STREAMS behaviour for all Newlib configurations and removes the option. This removes a couple of #ifdef blocks.
2022-05-18Use global atexit data for all configurationsSebastian Huber
For the exit processing only members of _GLOBAL_REENT were used by default. If the _REENT_GLOBAL_ATEXIT option was enabled, then the data structures were provided through dedicated global objects. Make this option the default. Remove the option. Rename struct _reent members _atexit and _atexit0 to _reserved_6 and _reserved_7, respectively. Provide them only if _REENT_BACKWARD_BINARY_COMPAT is defined.
2022-05-18Add --enable-newlib-reent-binary-compatSebastian Huber
Add the --enable-newlib-reent-binary-compat configure option. This option is disabled by default. If enabled, then unused members in struct _reent are preserved to maintain the structure layout.
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-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 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.
2022-02-10newlib: drop i?86-pc-linux-* target supportMike Frysinger
This was added 20+ years ago. It seems to have very few (or no users) as it only works on 32-bit x86 GNU/Linux (i.e. glibc) systems, and even then only with old versions of glibc. It hasn't compiled in at least 5 years, but most likely been broken for more like 15 years -- it relies on internal glibc APIs (like linuxthreads), and that code has changed and been deleted significantly since. This single target ends up dragging in a lot of non-trivial code that is hard to keep working, and currently impossible to verify -- the libtool and iconvdata and sys/linux/ code isn't used by anything else, but ends up touching just about every build file in the tree. Punt the target so we can start stripping out all these unique code paths. This commit by itself just disables the target. We'll start deleting the individual unused pieces in followups.
2022-02-02newlib: rename libc_cv_ prefix to newlib_cv_Mike Frysinger
We've been using both libc_cv_ and newlib_cv_ for our cache vars. Let's consolidate on newlib_cv_ to avoid conflicts with glibc which is already using the libc_cv_ prefix.
2022-02-02newlib: drop unused cache vars from MakefilesMike Frysinger
These aren't used in any of the makefiles, so there's no point in exporting these. These are only checked in the configure script.
2022-02-02newlib: delete unused iconvdata subdir configMike Frysinger
Since commit dcbff9eea71d06454e7d55d6b7e72672c0987d6d ("newlib: merge iconvdata into top-level Makefile"), there is no configure script in the iconvdata/ subdir, so this call will just issue a warning and not do anything useful. Punt it.
2022-01-29newlib: export abs_newlib_basedir for all subdirsMike Frysinger
When using the top-level configure script but subdir Makefiles, the newlib_basedir value gets a bit out of sync: it's relative to where configure lives, not where the Makefile lives. Move the abs setting from the top-level configure script into acinclude.m4 so we can rely on it being available everywhere. Although this commit doesn't use it anywhere, just lays the groundwork.
2022-01-28newlib: hoist crt0 install up another dirMike Frysinger
Commit dd23de27c8e45513ad276f503a0036c3bc4e487b ("newlib: libc: install CRT0 straight out of subdir") got rid of the libc/sys/ intermediate for copying the file up, but the top-level newlib/ dir was still expecting a libc/crt0.o to exist so it could install. Update that to also look for the crt0 file directly under libc/ like we already do for crt1.
2022-01-28newlib: merge iconvdata into top-level MakefileMike Frysinger
Avoid a recursive make with this tiny subdir to speed things up a bit.
2022-01-22newlib: drop redundant CFLAGS exportMike Frysinger
This is already handled by autotools for us automatically. You can tell as the generated output is exactly the same other than deleting a few blank lines.
2022-01-22newlib: stop checking --enable-multilib in subdirsMike Frysinger
None of the subdirs actually use the multilib arg, so include the logic only in the top-level configure.
2022-01-22newlib: move to ../config/multi.m4 for multilib logicMike Frysinger
The current newlib multilib logic is almost exactly the same as the config/multi.m4, and the differences should be minor, so switch over to that to delete custom logic on ourside.
2022-01-21newlib: switch to autoconf long double macroMike Frysinger
Now that we require a recent version of autoconf, we can rely on this macro working. This change was already made to libm, but these other dirs were missed as I didn't notice it being duplicated in 3 places.
2022-01-20newlib: switch newlib.h to autoheaderMike Frysinger
Now that newlib.hin has been brought up to date and all of its defines are produced by configure, we can switch it to using autoheader without manual editing. This relies on a few pieces: * Moving the header & footer into configure.ac via AH_TOP & AH_BOTTOM. * Running a post-process step on newlib.h to delete all the defines we didn't export ourselves. Basically, anything without a _ prefix. This will leave behind some spurious comments in newlib.h related to the defines we filtered out, but should be harmless, so it's probably not worth the effort to construct a more complicated sed expression to also strip those out.
2022-01-20newlib: iconv: autogenerate iconv define listMike Frysinger
The list of iconv to/from defines is hand maintained in newlib.hin. Lets leverage mkdeps.pl to generate this list automatically from the list of known encodings. The newlib.hin list is up-to-date, so the list in iconv.m4 matches the list already generated.
2022-01-20newlib: move version defines out of the config headersMike Frysinger
This will make it easier to move newlib.h to use autoheader directly. We only want the newlib version defines in our hand curated version file, _newlib_version.h, not in the template header, newlib.h, so using AC_DEFINE doesn't make much sense.
2022-01-20newlib: clean up autoheader templatesMike Frysinger
Sync these back from newlib.hin to configure.ac, and touchup some of the forms to be consistent (like being full sentences). Also use the AC_DEFINE-vs-AC_DEFINE_UNQUOTED macros correctly. This will make it easier to re-enable autoheader for managing newlib.hin.
2022-01-20newlib: internalize HAVE_INITFINI_ARRAYMike Frysinger
This define is only used by newlib internally, so stop exporting it as HAVE_INITFINI_ARRAY since this can conflict with defines packages use themselves. We don't really need to add _ to HAVE_INIT_FINI too since it isn't exported in newlib.h, but might as well be consistent here. We can't (easily) add this to newlib_cflags like HAVE_INIT_FINI is because this is based on a compile-time test in the top configure, not on plain shell code in configure.host. We'd have to replicate the test in every subdir in order to have it passed down.
2022-01-19newlib: avoid duplicate awk checksMike Frysinger
Since AM_INIT_AUTOMAKE calls AC_PROG_AWK, and some configure.ac scripts call it too, we end up testing for awk multiple times. If we change NEWLIB_CONFIGURE to require the macro instead, then it makes sure it's always expanded, but only once. While we're here, do the same thing with AC_PROG_INSTALL since it is also called by AM_INIT_AUTOMAKE, although it doesn't currently result in duplicate configure checks.
2022-01-19newlib: merge old AC_LIBTOOL_WIN32_DLL macro into LT_INITMike Frysinger
The AC_LIBTOOL_WIN32_DLL macro has been deprecated for a while and code should call LT_INIT with win32-dll instead. Update the calls to match. The generated code is noisy not because of substantial differences, but because the order of some macros change (i.e. instead of calling AS and then CC, CC is called first and then AS).
2022-01-19newlib: update libtool macro nameMike Frysinger
Replace old AM_PROG_LIBTOOL name with LT_INIT. There's no change to the generated files since they're aliases internally.
2022-01-14require autoconf-2.69 exactlyMike Frysinger
The newlib & libgloss dirs are already generated using autoconf-2.69. To avoid merging new code and/or accidental regeneration using diff versions, leverage config/override.m4 to pin to 2.69 exactly. This matches what gcc/binutils/gdb are already doing. The README file already says to use autoconf-2.69. To accomplish this, it's just as simple as adding -I flags to the top-level config/ dir when running aclocal. This is because the override.m4 file overrides AC_INIT to first require the specific autoconf version before calling the real AC_INIT.
2021-12-03ldtoa: Import gdtoa from OpenBSD.Takashi Yano
- This patch uses gdtoa imported from OpenBSD if newlib configure option "--enable-newlib-use-gdtoa=no" is NOT specified. gdtoa provides more accurate output and faster conversion than legacy ldtoa, while it requires more heap memory.
2021-11-16newlib: merge doc into top-level MakefileMike Frysinger
Avoid a recursive make with this tiny subdir to speed things up a bit.
2021-09-13libgloss/newlib: rename configure.in to configure.acMike Frysinger
The .in name has been deprecated for a long time in favor of .ac.