Commit Graph

20214 Commits

Author SHA1 Message Date
Mike Frysinger f159663b08 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.
2022-01-21 17:10:10 -05:00
Mike Frysinger 4317e0676a 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.
2022-01-21 17:10:10 -05:00
Mike Frysinger 17c2b857dc 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.
2022-01-21 17:10:09 -05:00
Mike Frysinger 5cc72ac79d 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.
2022-01-21 07:18:25 -05:00
Mike Frysinger 55e09d5e8c 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.
2022-01-21 07:07:15 -05:00
Mike Frysinger 0a67325726 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.
2022-01-19 19:59:16 -05:00
Mike Frysinger b86dc2dab4 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.
2022-01-19 19:59:16 -05:00
Mike Frysinger 15c091ad73 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.
2022-01-19 19:59:16 -05:00
Mike Frysinger 21fb1b461c 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.
2022-01-19 19:59:16 -05:00
Mike Frysinger 850e08fedb 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.
2022-01-19 19:59:16 -05:00
Mike Frysinger 810c5e5979 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.
2022-01-19 19:59:16 -05:00
Mike Frysinger ff5be4ab83 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.
2022-01-19 19:59:16 -05:00
Mike Frysinger 437c5c5085 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.
2022-01-19 19:59:16 -05:00
Mike Frysinger 6783cceb0a 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.
2022-01-19 18:51:04 -05:00
Jon Turney 0f29c6fc3c
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.
2022-01-19 17:14:48 +00:00
Jon Turney 2ede7d11e1
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.
2022-01-19 17:14:36 +00:00
Jon Turney c344628a69
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.
2022-01-19 17:14:19 +00:00
Jon Turney 9c546e0fd2
Cygwin: silence most custom build rules 2022-01-19 17:13:44 +00:00
Anton Lavrentiev via Cygwin-patches 93511d575e 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
2022-01-19 15:26:14 +01:00
Jon Turney 4a7461a07b
Cygwin: Fix configure help for --{en,dis}able-doc option
Report '--disable-doc' in 'configure --help', as enable is the default.
2022-01-19 13:00:42 +00:00
Corinna Vinschen a74707e7ac Cygwin: add resolver fixes to release message
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-01-19 08:51:03 +01:00
Anton Lavrentiev via Cygwin-patches 099d5a9a57 Cygwin: resolver: A few fixes for cygwin_query(), part 2
Make sure Windows ResultSet is free'd when dn_comp failed internally
2022-01-19 08:05:18 +01:00
Anton Lavrentiev via Cygwin-patches 54f0590a66 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
2022-01-19 08:05:18 +01:00
Anton Lavrentiev via Cygwin-patches 905f51d797 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
2022-01-19 08:05:18 +01:00
Anton Lavrentiev via Cygwin-patches 12bf36f72b 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.
2022-01-19 08:05:18 +01:00
Anton Lavrentiev via Cygwin-patches fa279a583d Cygwin: resolver: Process options forward (not backwards)
Also, make sure the debug setting propagates to the parser of
the remainder of /etc/resolv.conf
2022-01-19 08:05:18 +01:00
Mike Frysinger 84ff8d9477 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.
2022-01-18 19:34:31 -05:00
Mike Frysinger 7113ecbe79 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.
2022-01-18 19:34:31 -05:00
Mike Frysinger ac3d869afb 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.
2022-01-18 19:31:58 -05:00
Mike Frysinger a492b26065 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.
2022-01-18 19:28:24 -05:00
Mike Frysinger 6746e06043 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.
2022-01-18 19:25:18 -05:00
Mike Frysinger 3722489f1f 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).
2022-01-18 19:15:44 -05:00
Mike Frysinger fe591ba3f7 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.
2022-01-18 19:15:44 -05:00
Mike Frysinger 71086e8b2d 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
2022-01-18 19:12:02 -05:00
Takashi Yano ff539cc0f9 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
2022-01-18 22:17:37 +09:00
Corinna Vinschen 0cae2b802b Cygwin: add release text for last two patches
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-01-18 11:57:14 +01:00
Johannes Schindelin bd4fdcc059 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>
2022-01-18 11:55:44 +01:00
Anton Lavrentiev via Cygwin-patches e195f51af7 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.
2022-01-18 11:24:48 +01:00
Anton Lavrentiev via Cygwin-patches 90947659b0 Cygwin: resolver: A little more consistency in debug messages 2022-01-18 11:24:37 +01:00
Anton Lavrentiev via Cygwin-patches 3baaf08324 Cygwin: resolver: Format spec consistency for Windows errors 2022-01-18 11:24:33 +01:00
Anton Lavrentiev via Cygwin-patches 5f40b62709 Cygwin: resolver: Debug to output both IP and port # in native b.o.
Also, change a few other debug output spots for consistency
2022-01-18 11:24:20 +01:00
Anton Lavrentiev via Cygwin-patches 1dd65a9ede Use matching format for NTSTATUS 2022-01-17 11:32:00 +01:00
Anton Lavrentiev via Cygwin-patches 746e7f1b06 Fix format specifier for wide-char string 2022-01-17 11:30:35 +01:00
Mike Frysinger 7c02fc3075 libgloss: clean up redundant shared lib warnings
Use standard AC_MSG_WARN macro in the top-level configure, and delete
the message from all the subdirs.  There's no need to issue this more
than once per libgloss build.
2022-01-17 04:30:37 -05:00
Joseph Myers 6cde47de67 Merge autoconf / automake update changes from GCC.
Top level:
	Merge from GCC:
	PR bootstrap/82856
	* multilib.am: New file.  From automake.

config:
	Merge from GCC:
	PR bootstrap/82856
	* math.m4, tls.m4: Use AC_LANG_SOURCE.

zlib:
	Merge from GCC.
	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* Makefile.in: Regenerate.
2022-01-17 04:30:37 -05:00
Mike Frysinger 20e3103471 newlib: update to automake-1.15
This matches what the other GNU toolchain projects have done already.
The generated diff in practice isn't terribly large.  This will allow
more use of subdir local.mk includes due to fixes & improvements that
came after the 1.11 release series.
2022-01-14 19:10:38 -05:00
Mike Frysinger a100e80fc9 require autoconf-2.69 exactly
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.
2022-01-14 15:24:33 -05:00
Takashi Yano 909ed837cc Cygwin: pty: Fix race issue between closing and opening master.
- If the from_master is closed before cleaning up other pipes, such
  as from_slave_nat, the same pty may be allocated and pty master may
  try to open the pipe which is not closed yet, and it will fail.
  This patch fixes the issue.
2022-01-14 23:11:20 +09:00
Takashi Yano bff4594b08 Cygwin: console: Fix potential deadlock regarding acuqiring mutex.
- Acquiring input_mutex and attach_mutex in console code has potential
  risk of deadlock. This patch fixes the issue.
2022-01-14 23:11:07 +09:00
Takashi Yano 3af461092e Cygwin: pty: Stop closing and recreating attach_mutex.
- Closing attach_mutex and recreating it causes the race issue
  between pty and console codes. With this patch, attach_mutex
  is created only once in a process which opens pty, and never
  closed in order to avoid this issue.

Addresses:
  https://cygwin.com/pipermail/cygwin-developers/2021-December/012548.html
2022-01-14 23:11:01 +09:00