]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
2 years agoCygwin: console: Remove unnecessary (redundant) code.
Takashi Yano [Sat, 5 Feb 2022 07:52:33 +0000 (16:52 +0900)]
Cygwin: console: Remove unnecessary (redundant) code.

2 years agonewlib: drop shared documentation rules
Mike Frysinger [Sat, 22 Jan 2022 04:11:27 +0000 (23:11 -0500)]
newlib: drop shared documentation rules

Now that the top-level makefile handles these, don't need to copy
these into every single subdir.

2 years agonewlib: move man page generation into top-level build
Mike Frysinger [Sat, 22 Jan 2022 03:50:42 +0000 (22:50 -0500)]
newlib: move man page generation into top-level build

This allows building the libc & libm pages in parallel, and drops
the duplication in the subdirs with the chew/chapter settings.

The unused rules in Makefile.shared are left in place to minimize
noise in the change.

2 years agonewlib: libc: move manual into top-level build
Mike Frysinger [Sat, 22 Jan 2022 02:50:20 +0000 (21:50 -0500)]
newlib: libc: move manual into top-level build

This doesn't migrate all the docs, just the libc's manual (pdf/info).
This is to show the basic form of migrating the chew files.

For subdirs that didn't have any docs, I've stripped their settings
for clarity.  If someone wanted to suddenly add docs, they can add
the corresponding Makefile.inc files easily.

2 years agonewlib: libc: include all chapters all the time in the manual
Mike Frysinger [Sat, 22 Jan 2022 01:59:36 +0000 (20:59 -0500)]
newlib: libc: include all chapters all the time in the manual

THe stdio subdir is actually required by the documentation.  The
stdio/def is handled dynamically, but libc.texi always expects it
to be included, and fails if it isn't.  So making it required when
building docs is safe.

The xdr subdir is handled dynamically, but it doesn't include any
docs, so the dynamic logic isn't (currently) adding any value.  So
making it required when building docs is safe.

That leaves: iconv, stdio64, posix, and signal subdirs.  The chapters
have a little disclaimer saying they are system-dependent, but even
then, imo having stable manuals regardless of the target is preferable,
and we can add more disclaimer language to these chapters if we want.

This doesn't touch the man page codepaths, just the info/pdf.

2 years agonewlib: libm: move manual into top-level build
Mike Frysinger [Fri, 21 Jan 2022 07:12:26 +0000 (02:12 -0500)]
newlib: libm: move manual into top-level build

This doesn't migrate all the docs, just the libm's manual (pdf/info).
This is to show the basic form of migrating the chew files.

2 years agolibgloss: restore multilib settings in subdir makefiles
Mike Frysinger [Fri, 4 Feb 2022 06:17:54 +0000 (01:17 -0500)]
libgloss: restore multilib settings in subdir makefiles

Commit 754f8def0dfeeb43afa5a96ad1971fd0ef02c419 ("libgloss: merge stub
arch configure scripts up a level") had an unintended side-effect: the
MULTI* variables in the Makefiles no longer get rewritten at configure
time in the subdirs.  Only the top-level Makefile still is.  This is
because the configure integration of multilib (both the way libgloss
did it manually and the way AM_ENABLE_MULTILIB does it) only rewrites
"Makefile".

We could try propagating the MULTI* variables from libgloss/Makefile
down via FLAGS_TO_PASS, but this runs into a limitation: the multilib
logic uses this variable to switch from libgloss/ to each multilib
libgloss/, and libgloss uses this variable to enter subdirectories.
The latter we want, but the former ends up overridding the Makefile
environment.  We could side-step that with some GNU Make directives,
but it feels like we're getting a bit too deep down the rabbit hole.

Instead, let's call config-ml.in ourselves for each subdir Makefile
that the top-level configure generates.  This restores the previous
behavior and should be less risky in general.

This logic should be unnecessary when/if we switch libgloss over to
a non-recursive Automake build (since all build+install settings are
in the single libgloss/Makefile), but it'll be a while before we can
land that rework, so let's fix this up now.

2 years agoCygwin: fix dependency to dllfixdbg script
Corinna Vinschen [Fri, 4 Feb 2022 17:26:01 +0000 (18:26 +0100)]
Cygwin: fix dependency to dllfixdbg script

Only the files created from cygwin0.dll depend on the script, not
cygwin0.dll as well.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: dllfixdbg: improve readability
Corinna Vinschen [Fri, 4 Feb 2022 17:25:07 +0000 (18:25 +0100)]
Cygwin: dllfixdbg: improve readability

- formatting
- use array pointer as argument rather than variable arguments
- syntactical fixes
- add comments
- drop unnecessary recomputation of all section VMAs.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agonewlib: arm & v850: simplify build rules
Mike Frysinger [Tue, 1 Feb 2022 05:46:42 +0000 (00:46 -0500)]
newlib: arm & v850: simplify build rules

Let automake manage whether the objects are included in lib.a.  This
fixes failures after to commit 71086e8b2d70c1e71a8372f35d9901505fc72905
("newlib: delete (most) redundant lib_a_CCASFLAGS=$(AM_CCASFLAGS)") due
to automake generating different set of implicit rules, and the code in
here assuming the names of the generated objects.

2 years agoCygwin: dllfixdbg: honor Makefile verbositiy flag "V"
Corinna Vinschen [Thu, 3 Feb 2022 15:21:13 +0000 (16:21 +0100)]
Cygwin: dllfixdbg: honor Makefile verbositiy flag "V"

In Makefile.am, add the value of $(V) to the dllfixdbg call.
In dllfixdbg, if V=1, print what the script is doing.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: dllfixdbg: don't overwrite input DLL
Corinna Vinschen [Thu, 3 Feb 2022 15:19:54 +0000 (16:19 +0100)]
Cygwin: dllfixdbg: don't overwrite input DLL

Change dllfixdbg to keep the input DLL intact and just generate
a new DLL matching the debug file.  Fix Makefile rule accordingly.
The result is, cygwin0.dll is the original DLL created with full
debug sections and stays that way throughout the build process.
Only new-cygwin1.dll will become the stripped DLL matching with
the file containing the debug sections cygwin1.dbg.  This is ok,
because commit ba02fef995ac ("Cygwin: Makefile.am: fix DLL build rule")
made new-cygwin1.dll the DLL to be installed.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: console: Fix IL/DL escape sequence on the last line.
Takashi Yano [Thu, 3 Feb 2022 12:09:44 +0000 (21:09 +0900)]
Cygwin: console: Fix IL/DL escape sequence on the last line.

- Currently, escape sequence IL/DL (CSI Ps L, CSI Ps M) does not
  work correctly at the last (bottom end) line. This patch fixes
  the issue.

Addresses:
  https://cygwin.com/pipermail/cygwin/2022-February/250736.html

2 years agoCygwin: path: Fix UNC path handling for SMB3 mounted to a drive.
Takashi Yano [Thu, 3 Feb 2022 03:00:14 +0000 (12:00 +0900)]
Cygwin: path: Fix UNC path handling for SMB3 mounted to a drive.

- If an UNC path is mounted to a drive using SMB3.11, accessing to
  the drive fails with error "Too many levels of symbolic links."
  This patch fixes the issue.

2 years agoCygwin: silence dllfixdbg
Corinna Vinschen [Wed, 2 Feb 2022 20:24:04 +0000 (21:24 +0100)]
Cygwin: silence dllfixdbg

There's no good reason to print the objcopy generation rules

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: Makefile.am: fix DLL build rule
Corinna Vinschen [Wed, 2 Feb 2022 20:16:35 +0000 (21:16 +0100)]
Cygwin: Makefile.am: fix DLL build rule

A single Makefile rule creates three files in three steps, the second
and third one never showing up in dependencies.  The next step creating
the link lib only depends on the first of these files.  Even if the
second or third step in the DLL build rule fails, the next make
invocation never picks up on this and just goes ahead creating the
link lib.

Fix this by splitting the DLL build rule into three rules, with
every step on the way depending on the previous rule.  Also fix up
the names, TEST_DLL_NAME just doesn't cut it.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agolibgloss: move to ../config/multi.m4 for multilib logic
Mike Frysinger [Mon, 24 Jan 2022 04:24:52 +0000 (23:24 -0500)]
libgloss: move to ../config/multi.m4 for multilib logic

The current libgloss 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.

The insertions here look larger and that's because none of the scripts
were declaring --enable-multilib explicitly even though they checked the
flag and changed behavior.

2 years agolibgloss: merge subdirs that have unique makefile_frags up a level
Mike Frysinger [Mon, 24 Jan 2022 05:28:05 +0000 (00:28 -0500)]
libgloss: merge subdirs that have unique makefile_frags up a level

Merge the subdir configure scripts up that only existed to set unique
values for their target/host makefile_frags.

2 years agolibgloss: merge epiphany & libnosys & or1k configure scripts up a level
Mike Frysinger [Mon, 24 Jan 2022 05:12:58 +0000 (00:12 -0500)]
libgloss: merge epiphany & libnosys & or1k configure scripts up a level

These subdirs have unique configure scripts to do some compiler tests.
The checks should work for all targets, so hoist them up to the top
libgloss dir.  This should allow us to delete these subdir configure
scripts.

It means the top-level gains autoheader support, but that's fine.
It wasn't exporting any defines previously (i.e. -D into CPPFLAGS),
and all of the defines it now exports are only used by code in the
libnosys subdir which was expecting to have a config.h.

2 years agonewlib: rename libc_cv_ prefix to newlib_cv_
Mike Frysinger [Wed, 2 Feb 2022 02:37:00 +0000 (21:37 -0500)]
newlib: rename libc_cv_ prefix to newlib_cv_

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.

2 years agonewlib: drop unused cache vars from Makefiles
Mike Frysinger [Wed, 2 Feb 2022 02:35:02 +0000 (21:35 -0500)]
newlib: drop unused cache vars from Makefiles

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.

2 years agonewlib: add AC_CACHE_CHECK sugar around preprocessor checks
Mike Frysinger [Fri, 28 Jan 2022 10:17:46 +0000 (05:17 -0500)]
newlib: add AC_CACHE_CHECK sugar around preprocessor checks

This isn't strictly necessary, but it makes for much clearer logs as
to what the target is doing, and provides cache vars for anyone who
wants to force the test a different way, and it lets the build cache
its own results when rerunning config.status.

2 years agonewlib: delete unused iconvdata subdir config
Mike Frysinger [Tue, 1 Feb 2022 23:13:53 +0000 (18:13 -0500)]
newlib: delete unused iconvdata subdir config

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.

2 years agoCygwin: CI: Make sure pdflatex TeX format exists
Jon Turney [Wed, 26 Jan 2022 16:43:17 +0000 (16:43 +0000)]
Cygwin: CI: Make sure pdflatex TeX format exists

On Fedora, make sure the needed pdflatex TeX format exists after
prerequisite installation, to avoid the output of mktexfmt during build.

2 years agonewlib: fix preprocessor checks
Mike Frysinger [Fri, 28 Jan 2022 10:12:54 +0000 (05:12 -0500)]
newlib: fix preprocessor checks

Restore the call to AC_NO_EXECUTABLES -- I naively assumed in commit
2e9aa5f56cc26a411014a7f788423c670cfb5646 ("newlib: update preprocessor
configure checks") that checking for a preprocessor would not involve
linking code.  Unfortunately, autoconf will implicitly check that the
compiler "works" before allowing it to be used, and that involves a
link test, and that fails because newlib provides the C library which
is needed to pass a link test.

There is some code in NEWLIB_CONFIGURE specifically to help mitigate
these, but it's not kicking in here for some reason, so let's just add
the AC_NO_EXECUTABLES call back until we can unwind that custom logic.

Additionally, we have to call AC_PROG_CPP explicitly.  This was being
invoked later on, but only in the use_libtool=yes codepath, and that
is almost never enabled.

2 years agonewlib: fix cygwin -I path
Mike Frysinger [Fri, 28 Jan 2022 00:29:14 +0000 (19:29 -0500)]
newlib: fix cygwin -I path

This code snippet assumed it was only ever run in the top configure
script where srcdir would point to newlib/ which is parallel to the
winsup/ tree.  This is incorrect for all of the subdir configure
scripts leading to bad -I flags in $(CC).  Switch it over to the
new abs_newlib_basedir which should work in all subdirs.

2 years agonewlib: use abs_newlib_basedir for -I paths
Mike Frysinger [Fri, 28 Jan 2022 00:24:16 +0000 (19:24 -0500)]
newlib: use abs_newlib_basedir for -I paths

When we had configure scripts in subdirs, the newlib_basedir value
was computed relative to that, and it'd be the same when used in the
Makefile in the same dir.  With many subdir configure scripts removed,
the top-level configure & Makefile can't use the same relative path.
So switch the subdir Makefiles over to abs_newlib_basedir when they
use -I to find source headers.

Do this for all subdirs, even ones with configure scripts and where
newlib_basedir works.  This makes the code consistent, and avoids
surprises if the configure script is ever removed in the future as
part of merging to the higher level.

Some of the subdirs were using -I$(newlib_basedir)/../newlib/ for
some reason.  Collapse those too since newlib_basedir points to the
newlib source tree already.

2 years agonewlib: export abs_newlib_basedir for all subdirs
Mike Frysinger [Fri, 28 Jan 2022 00:17:04 +0000 (19:17 -0500)]
newlib: export abs_newlib_basedir for all subdirs

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.

2 years agolibgloss: fix more missing dir with parallel install
Mike Frysinger [Sat, 29 Jan 2022 06:33:44 +0000 (01:33 -0500)]
libgloss: fix more missing dir with parallel install

Depending on the processing order of rules when installing in parallel,
these install rules might be processed before some other rule happens
to create the respective dirs.  Make sure each one creates the needed
dirs before installing into them.

2 years agolibgloss: update Makefile regen rules for merged arches
Mike Frysinger [Sat, 29 Jan 2022 05:10:59 +0000 (00:10 -0500)]
libgloss: update Makefile regen rules for merged arches

For arches that had their configure merged into the top-level, make
sure they don't still depend on a subdir configure script that no
longer exists.  I had cleaned this up for some of the subdirs, but
these got lost in the shuffle.

2 years agoFinish this commit by prefixing HAVE_INITFINI_ARRAY and HAVE_INIT_FINI references...
Jeff Law [Sat, 29 Jan 2022 04:26:18 +0000 (21:26 -0700)]
Finish this commit by prefixing HAVE_INITFINI_ARRAY and HAVE_INIT_FINI references in libgloss in the same way.

Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Jan 17 22:20:20 2022 -0500

    newlib: internalize HAVE_INITFINI_ARRAY

    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.

2 years agonewlib: hoist crt0 install up another dir
Mike Frysinger [Fri, 28 Jan 2022 12:24:18 +0000 (07:24 -0500)]
newlib: hoist crt0 install up another dir

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.

2 years agolibgloss: aarch64/sparc: fix missing dir with parallel install
Mike Frysinger [Fri, 28 Jan 2022 11:21:41 +0000 (06:21 -0500)]
libgloss: aarch64/sparc: fix missing dir with parallel install

Depending on the processing order of rules when installing in parallel,
install-board might run first and the target dirs don't yet exist.

2 years agolibgloss: bfin: fix missing dir with parallel install
Mike Frysinger [Fri, 28 Jan 2022 10:56:36 +0000 (05:56 -0500)]
libgloss: bfin: fix missing dir with parallel install

Depending on the processing order of rules when installing in parallel,
install-board might run first and the target dirs don't yet exist.

2 years agoCygwin: drop autoloading kernel32 symbols available since Windows 7
Corinna Vinschen [Fri, 28 Jan 2022 09:33:50 +0000 (10:33 +0100)]
Cygwin: drop autoloading kernel32 symbols available since Windows 7

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agolibgloss: Fix PRU & Blackfin mkinstalldirs path
Dimitar Dimitrov [Thu, 27 Jan 2022 18:52:43 +0000 (20:52 +0200)]
libgloss: Fix PRU & Blackfin mkinstalldirs path

With the move of configure scripts out of target directories, relative
paths to top_srcdir got broken:

  /bin/sh: .../newlib/libgloss/../../mkinstalldirs: No such file or directory

Fix the PRU build by switching to srcroot relative path, as rest of targets do.

Fix the Blackfin build in the same way.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2 years agonewlib: merge iconvdata into top-level Makefile
Mike Frysinger [Fri, 31 Dec 2021 01:53:04 +0000 (20:53 -0500)]
newlib: merge iconvdata into top-level Makefile

Avoid a recursive make with this tiny subdir to speed things up a bit.

2 years agonewlib: drop unused saber file
Mike Frysinger [Thu, 27 Jan 2022 09:30:17 +0000 (04:30 -0500)]
newlib: drop unused saber file

I can't find any references to this, and it looks like a generated
build log from a specific old sparc system.

2 years agoRevert "Cygwin: fix permission problem when writing DAC info on Samba shares"
Corinna Vinschen [Thu, 27 Jan 2022 14:22:39 +0000 (15:22 +0100)]
Revert "Cygwin: fix permission problem when writing DAC info on Samba shares"

This reverts commit 0390cc85727b0165b5cdfcff7578cac94ae3371d.

There's no indication what exact situation this patch was supposed to
solve, and local testing doesn't show any such problems.  However, this
patch itself introduced a new problem, as outlined by
https://cygwin.com/pipermail/cygwin/2022-January/250629.html

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agonewlib: fix info+man page builds
Mike Frysinger [Thu, 27 Jan 2022 02:41:47 +0000 (21:41 -0500)]
newlib: fix info+man page builds

The work to merge libc/machine/ up a dir lost the stub doc targets.
So when libc/ recursed into machine/, it would stop going deeper as
the doc rules were empty.  But now that libc/ goes directly into the
libc/machine/$arch/ and those have never had doc stubs, the build
fails.  Add a quick hack to the top dir to ignore all machine/$arch/
dirs when generating docs.  A follow up series will delete all of
this code as it merges all the doc rules into the top newlib dir.

2 years agoFix null-pointer dereference in nano-malloc
Cyril Yared [Tue, 25 Jan 2022 15:44:10 +0000 (07:44 -0800)]
Fix null-pointer dereference in nano-malloc

If p is NULL, then the free_list is empty and we should return the
correct failure values.

2 years agolibgloss: merge stub iq2000 configure scripts up a level
Mike Frysinger [Wed, 26 Jan 2022 09:42:09 +0000 (04:42 -0500)]
libgloss: merge stub iq2000 configure scripts up a level

This was supposed to be included in the previous commit.

2 years agolibgloss: merge stub arch configure scripts up a level
Mike Frysinger [Sun, 23 Jan 2022 06:10:33 +0000 (01:10 -0500)]
libgloss: merge stub arch configure scripts up a level

For about half the ports, we don't need a subdir configure script.
They're using the config/default.m[ht] rules, and they aren't doing
any unique configure tests, so they exist just to pass top-level
settings down to create the arch Makefile.  We can just as easily
do that from the top-level Mkaefile directly and skip configure.

Most of the remaining configure scripts could be migrated up to
the top-level too, but that would require care in each subdir.
So let's be lazy and put that off to another day.

2 years agolibgloss: iq2000: drop unused configure vars
Mike Frysinger [Mon, 24 Jan 2022 05:35:52 +0000 (00:35 -0500)]
libgloss: iq2000: drop unused configure vars

This will make it easier to merge up as it won't have unique settings.

2 years agonewlib: switch to multilib.am
Mike Frysinger [Mon, 24 Jan 2022 01:04:59 +0000 (20:04 -0500)]
newlib: switch to multilib.am

We use the common config-ml.in for configure, so switch the makefile
over to the common multilib.am.  It's almost exactly the same code,
but there are two differences:
* Common code hooks install-exec-local for install-multi, but newlib
  doesn't currently install any executables, so that doesn't fire.
  Newlib already has install-data-local that inlined install-multi,
  so switch that to the common install-multi.
* Common code doesn't provide a check-multi at all.  Keep ours for
  now.  Some day common code might get it.  Or not.  Who knows.

2 years agonewlib: libc: merge machine/ configure scripts up a level
Mike Frysinger [Sun, 23 Jan 2022 05:23:28 +0000 (00:23 -0500)]
newlib: libc: merge machine/ configure scripts up a level

The machine configure scripts are all effectively stub scripts that
pass the higher level options to its own makefile.  There were only
three doing custom tests.  The rest were all effectively the same as
the libc/ configure script.

So instead of recursively running configure in all of these subdirs,
generate their makefiles from the top-level configure.  For the few
unique ones, deploy a pattern of including subdir logic via m4:
m4_include([machine/nds32/acinclude.m4])

Some of the generated machine makefiles have a bunch of extra stuff
added to them, but that's because they were inconsistent in their
configure libtool calls.  The top-level has it, so it exports some
new vars to the ones that weren't already.

2 years agonewlib: libc: merge most sys/ configure scripts up a level
Mike Frysinger [Sun, 23 Jan 2022 04:31:31 +0000 (23:31 -0500)]
newlib: libc: merge most sys/ configure scripts up a level

The sys configure scripts are almost all effectively stub scripts that
pass the higher level options to its own makefile.  The phoenix & linux
ones are a bit more complicated with nested subdirs, so those have been
left alone for now.  Plus, I don't really have a way of testing them.

2 years agonewlib: libc: install CRT0 straight out of subdir
Mike Frysinger [Sun, 23 Jan 2022 04:17:35 +0000 (23:17 -0500)]
newlib: libc: install CRT0 straight out of subdir

There's no need to have a sys/ subdir just to copy the sys/$arch/crt0.o
up to sys/crt0.o, and then have libc/ copy sys/crt0.o up again.  Just
have libc/ refer to sys/$arch/crt0.o directly and drop the intermediate
makefile entirely.

2 years agonewlib: libc: merge sys/ trampoline up a level
Mike Frysinger [Sun, 23 Jan 2022 04:10:46 +0000 (23:10 -0500)]
newlib: libc: merge sys/ trampoline up a level

The sys/{configure,Makefile} files exist to fan out to the specific
sys/$arch/ subdir, and to possibly generate a crt0.  We already have
all that same info in the libc/ dir itself, so by moving the recursive
configure and make calls into it, we can cut off some of this logic
entirely and save the overhead.

For arches that don't have a sys subdir, it means they can skip the
logic entirely.

The sys subdir itself is kept for the crt0 logic, for now.  We'll try
and clean that up next.

2 years agonewlib: libc: merge machine/ trampoline up a level
Mike Frysinger [Sun, 23 Jan 2022 04:00:39 +0000 (23:00 -0500)]
newlib: libc: merge machine/ trampoline up a level

The machine/{configure,Makefile} files exist only to fan out to the
specific machine/$arch/ subdir.  We already have all that same info
in the libc/ dir itself, so by moving the recursive configure and
make calls into it, we can cut off this logic entirely and save the
overhead.

For arches that don't have a machine subdir, it means they can skip
the logic entirely.  Although there's prob not too many of those.

2 years agonewlib: libm: merge machine/ configure scripts up a level
Mike Frysinger [Sun, 23 Jan 2022 01:19:41 +0000 (20:19 -0500)]
newlib: libm: merge machine/ configure scripts up a level

The machine configure scripts are all effectively stub scripts that
pass the higher level options to its own makefile.  The only one doing
any custom tests was nds32.  The rest were all effectively the same as
the libm/ configure script.

So instead of recursively running configure in all of these subdirs,
generate their makefiles from the top-level configure.  For nds32,
deploy a pattern of including subdir logic via m4:
m4_include([machine/nds32/acinclude.m4])

Even its set of checks are very small -- it does 2 preprocessor tests
and sets up 2 makefile conditionals.

Some of the generated machine makefiles have a bunch of extra stuff
added to them, but that's because they were inconsistent in their
configure libtool calls.  The top-level has it, so it exports some
new vars to the ones that weren't already.

2 years agonewlib: libm: merge machine/ trampoline up a level
Mike Frysinger [Sun, 23 Jan 2022 00:54:54 +0000 (19:54 -0500)]
newlib: libm: merge machine/ trampoline up a level

The machine/{configure,Makefile} files exist only to fan out to the
specific machine/$arch/ subdir.  We already have all that same info
in the libm/ dir itself, so by moving the recursive configure and
make calls into it, we can cut off this logic entirely and save the
overhead.

For arches that don't have a machine subdir, it means they can skip
the logic entirely.

2 years agolibgloss: define default target_makefile_frag in top-level
Mike Frysinger [Mon, 24 Jan 2022 05:23:10 +0000 (00:23 -0500)]
libgloss: define default target_makefile_frag in top-level

A bunch of subdirs want this, so make it available in the common
dir to ease future merges.  It isn't used directly in libgloss so
it should be harmless as-is.

2 years agonewlib: libm: drop unused config.h.in file
Mike Frysinger [Mon, 24 Jan 2022 03:46:59 +0000 (22:46 -0500)]
newlib: libm: drop unused config.h.in file

Not sure how this snuck in.  It's never been used in libm/, so punt it.

2 years agoCygwin: ACLs: don't set indicator for default ACEs prematurely
Corinna Vinschen [Tue, 25 Jan 2022 18:53:40 +0000 (19:53 +0100)]
Cygwin: ACLs: don't set indicator for default ACEs prematurely

Commit a2bfe7cae61a introduced a change ignoring default ACEs on files
to come up with a valid POSIX ACL, reflecting the Windows ACEs actually
making sense on files.

However, if CREATOR OWNER or CREATOR GROUP ACEs - both only making sense
as default ACEs - are found in the ACL, a value indicating the presence
of default ACEs gets set, even on files.  This in turn breaks a
subsequent integrity check and get_posix_access returns EINVAL.

The code path handling default ACEs on directories sets this indicator
anyway, so don't set it just because one of the above SIDs are found.

Fixes: a2bfe7cae61a ("Cygwin: ACLs: ignore *_INHERIT flags in file ACLs")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agonewlib: powerpc: move libc machine list to Makefile
Mike Frysinger [Sun, 23 Jan 2022 05:19:08 +0000 (00:19 -0500)]
newlib: powerpc: move libc machine list to Makefile

This makes the makefile logic a bit cleaner so we don't have two
files maintaining lists of sources & objects.  Since the logic is
tied to cpu capabilities, past those boolean settings down from
the configure logic to the makefile logic.

This will also make it easier to throw away the configure script
in a follow up commit and just keep the makefile.

2 years agonewlib: update preprocessor configure checks
Mike Frysinger [Sun, 23 Jan 2022 01:35:00 +0000 (20:35 -0500)]
newlib: update preprocessor configure checks

The nds32 & spu dirs are using compile tests to look for some
preprocessor defines, but we don't need to compile the code,
just preprocess it.  So switch to AC_PREPROC_IFELSE.

The sh dir is using a preprocessor test via grep, but let's
switch it to AC_PREPROC_IFELSE too to be consistent.

This should allow us to drop the uncommon AC_NO_EXECUTABLES call.

2 years agolibgloss: bfin: fix subdir install for sim files
Mike Frysinger [Mon, 24 Jan 2022 02:08:07 +0000 (21:08 -0500)]
libgloss: bfin: fix subdir install for sim files

When building in parallel, make sure the subdir for the sim files
exist before trying to install into them.

2 years agonewlib: punt unused LIBC_EXTRA_LIB settings
Mike Frysinger [Fri, 21 Jan 2022 12:04:19 +0000 (07:04 -0500)]
newlib: punt unused LIBC_EXTRA_LIB settings

This was added decades ago, but the commit message lacks any
explanation, and it was unused when it was merged.  It's still
unused today.  So punt it all.

2 years agonewlib: stop making .def generation conditional
Mike Frysinger [Fri, 21 Jan 2022 11:57:33 +0000 (06:57 -0500)]
newlib: stop making .def generation conditional

Generating these files is very cheap, so let's just do it all the time.
This makes the build logic simpler, and keeps errors for slipping in in
codepaths that are not well tested.  Creating these files doesn't mean
they'll be included in the manual implicitly.

For example, some of the nano stdio files break documentation because
they don't have any chew directives in them.  But no one noticed since
that code path is rarely enabled.  So drop the _i and _float def files.

2 years agonewlib: drop redundant CFLAGS export
Mike Frysinger [Fri, 21 Jan 2022 04:57:43 +0000 (23:57 -0500)]
newlib: drop redundant CFLAGS export

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.

2 years agonewlib: stop clobbering LDFLAGS with non-standard $ldflags
Mike Frysinger [Fri, 21 Jan 2022 04:45:23 +0000 (23:45 -0500)]
newlib: stop clobbering LDFLAGS with non-standard $ldflags

It's unclear why this was added originally, but assuming it was needed
20 years ago, it shouldn't be explicitly required nowadays.  Current
versions of autotools already take care of exporting LDFLAGS to the
Makefile as needed (things are actually getting linked).  That's why
the configure diffs show LDFLAGS still here, but shifted to a diff
place in the output list.  A few dirs stop exporting LDFLAGS, but
that's because they don't do any linking, only compiling, so it's
correct.

As for the use of $ldflags instead of the standard $LDFLAGS, I can't
really explain that at all.  Just use the right name so users don't
have to dig into why their setting isn't respected, and then use a
non-standard name instead.  Adjust the testsuite to match.

2 years agonewlib: stop checking --enable-multilib in subdirs
Mike Frysinger [Fri, 21 Jan 2022 03:52:38 +0000 (22:52 -0500)]
newlib: stop checking --enable-multilib in subdirs

None of the subdirs actually use the multilib arg, so include the
logic only in the top-level configure.

2 years agonewlib: move to ../config/multi.m4 for multilib logic
Mike Frysinger [Fri, 21 Jan 2022 03:52:02 +0000 (22:52 -0500)]
newlib: move to ../config/multi.m4 for multilib logic

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.

2 years agonewlib: punt unused template file
Mike Frysinger [Fri, 21 Jan 2022 04:00:45 +0000 (23:00 -0500)]
newlib: punt unused template file

This was needed by ancient versions of automake, but that hasn't been
the case since at least automake-1.5, so punt this unused stub.

2 years agonewlib: switch to autoconf long double macro
Mike Frysinger [Fri, 21 Jan 2022 03:47:47 +0000 (22:47 -0500)]
newlib: switch to autoconf long double macro

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.

2 years agonewlib: switch newlib.h to autoheader
Mike Frysinger [Tue, 18 Jan 2022 01:10:38 +0000 (20:10 -0500)]
newlib: switch newlib.h to autoheader

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.

2 years agonewlib: iconv: autogenerate iconv define list
Mike Frysinger [Tue, 18 Jan 2022 03:00:26 +0000 (22:00 -0500)]
newlib: iconv: autogenerate iconv define list

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.

2 years agonewlib: add missing _NANO_MALLOC to newlib.hin
Mike Frysinger [Tue, 18 Jan 2022 02:25:17 +0000 (21:25 -0500)]
newlib: add missing _NANO_MALLOC to newlib.hin

This was added to configure, but never to the header file.  Nothing
uses this currently, so it's not a big deal (as all the dynamic logic
is via automake conditionals), but might as well restore it now to
keep autoheader output in sync.

2 years agonewlib: move version defines out of the config headers
Mike Frysinger [Tue, 18 Jan 2022 02:17:54 +0000 (21:17 -0500)]
newlib: move version defines out of the config headers

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.

2 years agonewlib: sort newlib.h output
Mike Frysinger [Tue, 18 Jan 2022 01:10:38 +0000 (20:10 -0500)]
newlib: sort newlib.h output

Sort the symbols lexically like autoheader does.  There are no other
changes in here.  This will make it easier to sync with autoheader.

2 years agonewlib: clean up autoheader templates
Mike Frysinger [Thu, 13 Jan 2022 04:05:16 +0000 (23:05 -0500)]
newlib: clean up autoheader templates

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.

2 years agonewlib: merge acconfig.h changes into newlib.hin
Mike Frysinger [Tue, 18 Jan 2022 01:03:13 +0000 (20:03 -0500)]
newlib: merge acconfig.h changes into newlib.hin

The acconfig.h header was used to run autoheader and then manually
sync the output into newlib.hin.  Based on how the files have fallen
out of sync (with newlib.hin having many more templates), this has
not been run in a long time, and attempts to do so now would break
newlib.hin.

Further, if you try to run autoheader now, it will automatically
replace _newlib_version.hin since it's the first entry in the call
to AC_CONFIG_HEADERS.

So let's throw away acconfig.h entirely.  It only had 2 slightly
better comments, and the rest were either worse, missing, or stale.
This has the side benefit of avoiding autoheader warning about the
deprecated use of acconfig.h since newer autoconf only wants macro
calls in configure.ac.

2 years agonewlib: internalize HAVE_INITFINI_ARRAY
Mike Frysinger [Tue, 18 Jan 2022 03:20:20 +0000 (22:20 -0500)]
newlib: internalize HAVE_INITFINI_ARRAY

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.

2 years agonewlib: libm: switch to autoconf long double macro
Mike Frysinger [Mon, 17 Jan 2022 05:42:53 +0000 (00:42 -0500)]
newlib: libm: switch to autoconf long double macro

Now that we require a recent version of autoconf, we can rely on this
macro working.  We shift the call in configure.ac down a little to
help keep the generated diff minimal -- there should be no functional
difference otherwise.  This is because the autoconf macros will call
a bunch of standard toolchain macros first, and arguably the current
code is incorrect in how it does its testing.

2 years agoCygwin: silence xsltproc when writing manpages
Jon Turney [Tue, 18 Jan 2022 20:52:46 +0000 (20:52 +0000)]
Cygwin: silence xsltproc when writing manpages

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.

2 years agoCygwin: silence xsltproc when writing chunked html
Jon Turney [Tue, 18 Jan 2022 20:20:18 +0000 (20:20 +0000)]
Cygwin: silence xsltproc when writing chunked html

Unless make is invoked with V=1, have xmlto pass the parameter
'chunk.quietly=1' to xsltproc to suppress "Writing foo.html for
sect1(foo)" output from the chunker.xsl stylesheet.

2 years agoCygwin: silence dblatex when building PDFs
Jon Turney [Tue, 18 Jan 2022 18:17:38 +0000 (18:17 +0000)]
Cygwin: silence dblatex when building PDFs

Unless make is invoked with V=1, have xmlto pass '-q' to dblatex when
building PDFs, to supress repeated "default template used in
programlisting or screen" warnings from dblatex's verbatim.xsl
stylesheet.

2 years agoCygwin: silence most custom build rules
Jon Turney [Tue, 18 Jan 2022 17:06:15 +0000 (17:06 +0000)]
Cygwin: silence most custom build rules

2 years agoCygwin: resolver: cygwin_query() skip response header on internal error
Anton Lavrentiev via Cygwin-patches [Wed, 19 Jan 2022 13:12:55 +0000 (08:12 -0500)]
Cygwin: resolver: cygwin_query() skip response header on internal error

- When dn_comp() failed internally there is no longer any need to
fill the response header since it's now all cleared upon entry

2 years agoCygwin: Fix configure help for --{en,dis}able-doc option
Jon Turney [Tue, 18 Jan 2022 16:26:36 +0000 (16:26 +0000)]
Cygwin: Fix configure help for --{en,dis}able-doc option

Report '--disable-doc' in 'configure --help', as enable is the default.

2 years agoCygwin: add resolver fixes to release message
Corinna Vinschen [Wed, 19 Jan 2022 07:50:48 +0000 (08:50 +0100)]
Cygwin: add resolver fixes to release message

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: resolver: A few fixes for cygwin_query(), part 2
Anton Lavrentiev via Cygwin-patches [Wed, 19 Jan 2022 00:07:55 +0000 (19:07 -0500)]
Cygwin: resolver: A few fixes for cygwin_query(), part 2

Make sure Windows ResultSet is free'd when dn_comp failed internally

2 years agoCygwin: resolver: Targets in SRV DNS responses may not be compressed
Anton Lavrentiev via Cygwin-patches [Tue, 18 Jan 2022 22:39:16 +0000 (17:39 -0500)]
Cygwin: resolver: Targets in SRV DNS responses may not be compressed

RFC2782 clearly says so yet it's a common misconception to perform the
compression in the violation of the standard.  This patch fixes that

2 years agoCygwin: resolver: Fix to match response ID with request ID
Anton Lavrentiev via Cygwin-patches [Tue, 18 Jan 2022 22:39:15 +0000 (17:39 -0500)]
Cygwin: resolver: Fix to match response ID with request ID

In case when the native OS resolver is used (via os_query) the returned
response ID is always 0.  It should actually match the ID passed in to
res_send() in the DNS request header.  This patch fixes that

2 years agoCygwin: resolver: A few fixes for cygwin_query()
Anton Lavrentiev via Cygwin-patches [Tue, 18 Jan 2022 21:34:34 +0000 (16:34 -0500)]
Cygwin: resolver: A few fixes for cygwin_query()

- Make sure the answer buffer is properly cleared so there is no trailing
garbage when the response does not fit entirely in;
- Make sure an internal decomp failure gets reported correctly (w/return code -1);
- Make sure that the buffer is not overrun when filling out the header.

2 years agoCygwin: resolver: Process options forward (not backwards)
Anton Lavrentiev via Cygwin-patches [Tue, 18 Jan 2022 16:09:33 +0000 (11:09 -0500)]
Cygwin: resolver: Process options forward (not backwards)

Also, make sure the debug setting propagates to the parser of
the remainder of /etc/resolv.conf

2 years agonewlib: iconv: sort ccsbi.c contents
Mike Frysinger [Tue, 18 Jan 2022 02:41:37 +0000 (21:41 -0500)]
newlib: iconv: sort ccsbi.c contents

The current output doesn't happen to match what is produced on my
system, so force _iconv_ccs to be sorted like is already done in
the ccsbi.h header.

2 years agonewlib: iconv: sync mkdeps.pl with aliasesbi.c changes
Mike Frysinger [Tue, 18 Jan 2022 02:34:26 +0000 (21:34 -0500)]
newlib: iconv: sync mkdeps.pl with aliasesbi.c changes

Some changes were made to aliasesbi.c, but not to this file which
dynamically generates it.  Add those fixes to this file too.

2 years agonewlib: drop autoconf-2.59 workaround
Mike Frysinger [Tue, 18 Jan 2022 00:28:48 +0000 (19:28 -0500)]
newlib: drop autoconf-2.59 workaround

As the file comments say, this was a backport of an autoconf-2.60 fix,
and shouldn't matter for >autoconf-2.59 versions.  Drop it since we use
and require autoconf-2.69 now.

2 years agonewlib: enable automake subdir-objects in all dirs
Mike Frysinger [Mon, 17 Jan 2022 18:56:48 +0000 (13:56 -0500)]
newlib: enable automake subdir-objects in all dirs

Currently this is only enabled in the top-level as that's the only
place where it seemed to be used.  But the libc/sys/phoenix/ dir
also uses this functionality, but fails to explicitly enable it.
Automake workedaround it, but generated warnings.  Move the option
to NEWLIB_CONFIGURE so all dirs get it automatically iff they end
up using the option.  If they don't use the option, there's no
difference to the generated code.

2 years agonewlib: avoid duplicate awk checks
Mike Frysinger [Mon, 17 Jan 2022 18:14:06 +0000 (13:14 -0500)]
newlib: avoid duplicate awk checks

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.

2 years agonewlib: merge old AC_LIBTOOL_WIN32_DLL macro into LT_INIT
Mike Frysinger [Mon, 17 Jan 2022 17:45:10 +0000 (12:45 -0500)]
newlib: merge old AC_LIBTOOL_WIN32_DLL macro into LT_INIT

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).

2 years agonewlib: update libtool macro name
Mike Frysinger [Mon, 17 Jan 2022 17:29:21 +0000 (12:29 -0500)]
newlib: update libtool macro name

Replace old AM_PROG_LIBTOOL name with LT_INIT.  There's no change to
the generated files since they're aliases internally.

2 years agonewlib: delete (most) redundant lib_a_CCASFLAGS=$(AM_CCASFLAGS)
Mike Frysinger [Thu, 30 Dec 2021 19:32:09 +0000 (14:32 -0500)]
newlib: delete (most) redundant lib_a_CCASFLAGS=$(AM_CCASFLAGS)

Since automake already sets per-library CCASFLAGS to $(AM_CCASFLAGS)
by default, there's no need to explicitly set it here.

Many of these dirs don't have .S files in the first place, so the rule
doesn't even do anything.  That can easily be seen when Makefile.in has
no changes as a result.

For the dirs with .S files, the custom rules are the same as the pattern
.S.o rules, so this is a nice cleanup.

The only dir that was adding extra flags (newlib/libc/machine/mn10300/)
to the per-library setting can have it moved to the global AM_CCASFLAGS
since the subdir only has one target.  Although the setting just adds
extra debugging flags, so maybe it should be deleted in general.

There are a few dirs that we leave the redundant setting in place.  This
is to workaround an automake limitation in subdirs that support building
with & w/out libtool:
https://www.gnu.org/software/automake/manual/html_node/Objects-created-both-with-libtool-and-without.html

2 years agoCygwin: fhandler_base: Fix double free caused when open() fails.
Takashi Yano [Tue, 18 Jan 2022 13:17:37 +0000 (22:17 +0900)]
Cygwin: fhandler_base: Fix double free caused when open() fails.

- When open fails, archetype stored in archetypes[] is not cleared.
  This causes double free when next open fail. This patch fixes the
  issue.

Addresses:
  https://cygwin.com/pipermail/cygwin/2022-January/250518.html

2 years agoCygwin: add release text for last two patches
Corinna Vinschen [Tue, 18 Jan 2022 10:57:14 +0000 (11:57 +0100)]
Cygwin: add release text for last two patches

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2 years agoCygwin: path_conv: do not get confused by a directory with `.lnk` suffix
Johannes Schindelin [Mon, 17 Jan 2022 20:20:45 +0000 (21:20 +0100)]
Cygwin: path_conv: do not get confused by a directory with `.lnk` suffix

When trying to create a directory called `xyz` in the presence of a
directory `xyz.lnk`, the Cygwin runtime errors out with an `ENOENT`.

The root cause is actually a bit deeper: the `symlink_info::check()`
method tries to figure out whether the given path refers to a symbolic
link as emulated via `.lnk` files, but since it is a directory, that is
not the case, and that hypothesis is rejected.

However, the `fileattr` field is not cleared, so that a later
`.exists()` call on the instance mistakenly thinks that the symlink
actually exists. Let's clear that field.

This fixes https://github.com/msys2/msys2-runtime/issues/81

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agoCygwin: resolver: Added processing of AAAA records
Anton Lavrentiev via Cygwin-patches [Mon, 17 Jan 2022 18:03:14 +0000 (13:03 -0500)]
Cygwin: resolver: Added processing of AAAA records

AAAA records returned from Windows resolver were flagged as "No
structure" in debug output because of being processed (although
correctly) in the default catch-all case.  This patch makes the AAAA
records properly recognized.

2 years agoCygwin: resolver: A little more consistency in debug messages
Anton Lavrentiev via Cygwin-patches [Mon, 17 Jan 2022 18:03:13 +0000 (13:03 -0500)]
Cygwin: resolver: A little more consistency in debug messages

This page took 0.073118 seconds and 5 git commands to generate.