Commit Graph

20476 Commits

Author SHA1 Message Date
Mike Frysinger db2ef77287 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.
2022-01-26 03:11:20 -05:00
Mike Frysinger 2339979934 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.
2022-01-26 03:11:20 -05:00
Mike Frysinger 6ac043b192 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.
2022-01-26 03:11:20 -05:00
Mike Frysinger 6d8c4e4ba1 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.
2022-01-25 21:56:47 -05:00
Mike Frysinger 5420733ef3 newlib: libm: drop unused config.h.in file
Not sure how this snuck in.  It's never been used in libm/, so punt it.
2022-01-25 21:56:47 -05:00
Corinna Vinschen f467a1da58 Cygwin: ACLs: don't set indicator for default ACEs prematurely
Commit a2bfe7cae6 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: a2bfe7cae6 ("Cygwin: ACLs: ignore *_INHERIT flags in file ACLs")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-01-25 19:53:40 +01:00
Mike Frysinger 5dc4e2089a 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.
2022-01-23 22:35:21 -05:00
Mike Frysinger 2e9aa5f56c 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.
2022-01-23 22:35:21 -05:00
Mike Frysinger dfa088ab66 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.
2022-01-23 21:08:07 -05:00
Mike Frysinger dcb25665be 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.
2022-01-21 17:29:46 -05:00
Mike Frysinger 8776d090f8 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.
2022-01-21 17:28:54 -05:00
Mike Frysinger 4af3551136 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.
2022-01-21 17:27:55 -05:00
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