Commit Graph

20376 Commits

Author SHA1 Message Date
Corinna Vinschen c3efc81658 Cygwin: drop dllfixdbg script
On second thought, we don't actually need this script.
Express the entire action as sufficiently simple Makefile rule.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-02-05 10:42:27 +01:00
Takashi Yano 44d8704179 Cygwin: console: Remove unnecessary (redundant) code. 2022-02-05 16:55:12 +09:00
Mike Frysinger 24b1e4b942 newlib: drop shared documentation rules
Now that the top-level makefile handles these, don't need to copy
these into every single subdir.
2022-02-05 00:18:01 -05:00
Mike Frysinger 6026ef29d8 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.
2022-02-05 00:17:54 -05:00
Mike Frysinger fc2b4ffee0 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.
2022-02-04 23:57:12 -05:00
Mike Frysinger 44f6310bf9 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.
2022-02-04 19:39:09 -05:00
Mike Frysinger 3365bd2f7a 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.
2022-02-04 19:39:05 -05:00
Mike Frysinger 67c600b995 libgloss: restore multilib settings in subdir makefiles
Commit 754f8def0d ("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.
2022-02-04 19:33:29 -05:00
Corinna Vinschen 899cf3c952 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>
2022-02-04 18:27:14 +01:00
Corinna Vinschen 820c736785 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>
2022-02-04 18:27:14 +01:00
Mike Frysinger 4574c60378 newlib: arm & v850: simplify build rules
Let automake manage whether the objects are included in lib.a.  This
fixes failures after to commit 71086e8b2d
("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.
2022-02-03 20:45:47 -05:00
Corinna Vinschen 4aeba49016 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>
2022-02-03 16:22:46 +01:00
Corinna Vinschen 7ae91f3b56 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 ba02fef995 ("Cygwin: Makefile.am: fix DLL build rule")
made new-cygwin1.dll the DLL to be installed.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-02-03 16:22:46 +01:00
Takashi Yano 96646006a7 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
2022-02-03 21:09:44 +09:00
Takashi Yano e5aca9ced9 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.
2022-02-03 12:21:21 +09:00
Corinna Vinschen 4a70041dfd Cygwin: silence dllfixdbg
There's no good reason to print the objcopy generation rules

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-02-02 21:30:20 +01:00
Corinna Vinschen ba02fef995 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>
2022-02-02 21:30:20 +01:00
Mike Frysinger 8622002ffc 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.
2022-02-01 23:07:11 -05:00
Mike Frysinger 30f244155b 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.
2022-02-01 23:06:21 -05:00
Mike Frysinger d5a20f0b70 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.
2022-02-01 21:53:22 -05:00
Mike Frysinger d5ebf5277e 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.
2022-02-01 21:37:00 -05:00
Mike Frysinger 624e06b3cf 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.
2022-02-01 21:35:47 -05:00
Mike Frysinger 041dd7ff26 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.
2022-02-01 18:15:51 -05:00
Mike Frysinger 38755463e5 newlib: delete unused iconvdata subdir config
Since commit dcbff9eea7 ("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-02-01 18:13:53 -05:00
Jon Turney 544637b21b
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.
2022-02-01 16:11:32 +00:00
Mike Frysinger 4b0e66093c newlib: fix preprocessor checks
Restore the call to AC_NO_EXECUTABLES -- I naively assumed in commit
2e9aa5f56c ("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.
2022-01-31 22:21:17 -05:00
Mike Frysinger 6a59fc444b 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.
2022-01-29 01:35:30 -05:00
Mike Frysinger fc0bd2eb03 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.
2022-01-29 01:35:30 -05:00
Mike Frysinger 6444f108d9 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.
2022-01-29 01:35:30 -05:00
Mike Frysinger 502cf4b7b5 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.
2022-01-29 01:33:49 -05:00
Mike Frysinger 580817ec01 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.
2022-01-29 00:10:59 -05:00
Jeff Law 063d67faf0 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.
2022-01-28 21:39:14 -07:00
Mike Frysinger 7a4bef590b newlib: hoist crt0 install up another dir
Commit dd23de27c8 ("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-28 07:27:19 -05:00
Mike Frysinger 9d33524164 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.
2022-01-28 06:21:41 -05:00
Mike Frysinger c6c414fcb3 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.
2022-01-28 05:57:37 -05:00
Corinna Vinschen 047eaf9a6b Cygwin: drop autoloading kernel32 symbols available since Windows 7
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-01-28 10:36:54 +01:00
Dimitar Dimitrov b095628ecf 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>
2022-01-27 19:40:10 -05:00
Mike Frysinger dcbff9eea7 newlib: merge iconvdata into top-level Makefile
Avoid a recursive make with this tiny subdir to speed things up a bit.
2022-01-27 19:14:57 -05:00
Mike Frysinger 996a85ba4c 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.
2022-01-27 19:14:21 -05:00
Corinna Vinschen d079ab4d37 Revert "Cygwin: fix permission problem when writing DAC info on Samba shares"
This reverts commit 0390cc8572.

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>
2022-01-27 15:31:25 +01:00
Mike Frysinger 866de704f3 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.
2022-01-26 21:41:47 -05:00
Cyril Yared 73d515fcfe 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.
2022-01-26 13:14:03 +01:00
Mike Frysinger 43ab30fbd5 libgloss: merge stub iq2000 configure scripts up a level
This was supposed to be included in the previous commit.
2022-01-26 04:42:09 -05:00
Mike Frysinger 754f8def0d 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.
2022-01-26 04:32:54 -05:00
Mike Frysinger c0bf2d68f9 libgloss: iq2000: drop unused configure vars
This will make it easier to merge up as it won't have unique settings.
2022-01-26 04:27:50 -05:00
Mike Frysinger ee3ed2b65e 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.
2022-01-26 04:17:34 -05:00
Mike Frysinger 08a55a233d 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.
2022-01-26 03:11:21 -05:00
Mike Frysinger 8bee45444f 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.
2022-01-26 03:11:21 -05:00
Mike Frysinger dd23de27c8 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.
2022-01-26 03:11:21 -05:00
Mike Frysinger fbfeebc221 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.
2022-01-26 03:11:20 -05:00