]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
2 years agonewlib: i386/xstormy16: drop unused -I libm/common flag
Mike Frysinger [Mon, 14 Feb 2022 06:00:11 +0000 (01:00 -0500)]
newlib: i386/xstormy16: drop unused -I libm/common flag

These subdirs don't actually use anything from libm.  The common dir
in particular only has 4 header files, and none are included here.

The xstormy16 code has a comment mentioning why this hack is here, but
it refers to code that was removed when its configure script was merged
up a level.

2 years agoCygwin: wincap: Add capabilities for Windows 11.
Takashi Yano [Wed, 16 Feb 2022 09:13:02 +0000 (18:13 +0900)]
Cygwin: wincap: Add capabilities for Windows 11.

- The capability changes since Windows 11 have been reflected in
  wincap.cc. The capability has_con_broken_tabs is added, which is
  false since Windows 11.

2 years agofhandler_proc.cc(format_proc_cpuinfo): fix bad bits in last change
Brian Inglis [Tue, 15 Feb 2022 21:54:20 +0000 (14:54 -0700)]
fhandler_proc.cc(format_proc_cpuinfo): fix bad bits in last change

move Linux 5.16 Gobble Gobble flags to 5.17 Superb Owl correct positions:
0x00000007:1 Intel Advanced Matrix eXtensions:
 EAX:22 amx_bf16 Brain Float 16 dot product
 EAX:24 amx_tile Tile matrix multiply
 EAX:25 amx_int8 Int 8 byte dot product
0x00000007:0 Intel Advanced Matrix eXtensions:
 EDX:22 amx_bf16 Brain Float 16 dot product
 EDX:24 amx_tile Tile matrix multiply
 EDX:25 amx_int8 Int 8 byte dot product

2 years agonewlib/libgloss: drop unused $(CROSS_CFLAGS)
Mike Frysinger [Mon, 14 Feb 2022 05:52:55 +0000 (00:52 -0500)]
newlib/libgloss: drop unused $(CROSS_CFLAGS)

This is used in a bunch of places, but nowhere is it ever set, and
nowhere can I find any documentation, nor can I find any other project
using it.  So delete the flags to simplify.

2 years agonewlib: drop support for decstation & sunos systems
Mike Frysinger [Mon, 14 Feb 2022 00:15:57 +0000 (19:15 -0500)]
newlib: drop support for decstation & sunos systems

These targets don't actually cross-compile -- they try to pull some
objects out of the host's /lib/libc.a, /lib/libm.a, and /lib/crt0.o
directly and merge them into newlib's own libraries.  This is hard
to keep working and impossible to test.  Considering the vintage of
such targets, and gcc dropping them many many years ago, drop them
from newlib too.  This will make cleaning up the build a lot easier.

2 years agonewlib: rename doc/local.mk to Makefile.inc
Mike Frysinger [Mon, 14 Feb 2022 04:17:48 +0000 (23:17 -0500)]
newlib: rename doc/local.mk to Makefile.inc

For consistency across the whole tree.

2 years agonewlib: phoenix: merge configure up to top-level
Mike Frysinger [Thu, 10 Feb 2022 08:43:31 +0000 (03:43 -0500)]
newlib: phoenix: merge configure up to top-level

Merge sys/phoenix/ configure logic into libc/ itself.  This kills
off the last lingering script in this tree (other than libc itself).

2 years agonewlib: phoenix: merge machine/ configure scripts up a level
Mike Frysinger [Thu, 10 Feb 2022 08:30:48 +0000 (03:30 -0500)]
newlib: phoenix: 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.

2 years agonewlib: phoenix: merge machine/ trampoline up a level
Mike Frysinger [Thu, 10 Feb 2022 08:27:29 +0000 (03:27 -0500)]
newlib: phoenix: 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 phoenix/ dir itself, so by moving the recursive configure and
make calls into it, we can cut off this logic entirely and save the
overhead.

2 years agonewlib: phoenix: drop missing machine subdirs
Mike Frysinger [Thu, 10 Feb 2022 08:32:51 +0000 (03:32 -0500)]
newlib: phoenix: drop missing machine subdirs

These were never added to the tree, and as we transition from autoconf
to automake, it really wants the latter subdirs to always exist.  These
don't, so delete the logic.

2 years agonewlib: phoenix: move some logic from configure to the Makefile
Mike Frysinger [Thu, 10 Feb 2022 06:38:17 +0000 (01:38 -0500)]
newlib: phoenix: move some logic from configure to the Makefile

These configure scripts hardcode some settings, so move them to the
Makefile to simplify so we can drop the configure scripts entirely.

2 years agoImprove lgammaf range for very small cases
Andoni Arregi [Fri, 11 Feb 2022 11:16:00 +0000 (12:16 +0100)]
Improve lgammaf range for very small cases

The original cut for small arguments at |x|<2**-70 (copied from the
double version) produces that when computing nadj we get a subnormal
number for t*x and thus, the division of pi/subnormal will be INF and
the logarithm of it too, which is wrong as a result for lgammaf in this
range.
The proposed new limit seems to be safe and has been tested to
produce accurate results.
(Courtesy of Andreas Jung, ESA)

2 years agoCygwin: console: Set console mode even if stdin/stdout is redirected.
Takashi Yano [Sun, 13 Feb 2022 08:11:02 +0000 (17:11 +0900)]
Cygwin: console: Set console mode even if stdin/stdout is redirected.

- When non-cygwin app is started in console, console mode is set to
  tty::native. However, if stdin is redirected, current code does not
  set the input mode of the console. In this case, if the app opens
  "CONIN$", the console mode will not be appropriate for non-cygwin
  app. This patch fixes the issue.

Addresses:
https://github.com/GitCredentialManager/git-credential-manager/issues/576

2 years agoCygwin: console: Fix console mode for non-cygwin inferior of GDB.
Takashi Yano [Sun, 13 Feb 2022 03:03:45 +0000 (12:03 +0900)]
Cygwin: console: Fix console mode for non-cygwin inferior of GDB.

- Currently, there is no chance to change console mode for non-cygwin
  inferior of GDB. With this patch, the console mode is changed to
  tty::native in CreateProcess() and ContinueDebugEvent() hooked in
  fhandler_console.

2 years agoCygwin: pty: Fix a bug in tty_min::segpgid().
Takashi Yano [Sat, 12 Feb 2022 20:12:18 +0000 (05:12 +0900)]
Cygwin: pty: Fix a bug in tty_min::segpgid().

- In tty_min::setpgid(), a pointer to fhandler instance is casted to
  fhandler_pty_slave and accessed even if terminal is not a pty slave.
  This patch fixes the issue.

2 years agoCygwin: pty: Discard input in from_master_nat pipe on signal as well.
Takashi Yano [Sat, 12 Feb 2022 17:16:32 +0000 (02:16 +0900)]
Cygwin: pty: Discard input in from_master_nat pipe on signal as well.

- Currently, pty discards input only in from_master pipe on signal.
  Due to this, if pty is started without pseudo console support and
  start a non-cygwin process from cmd.exe, type adhead input is not
  discarded on signals such as Ctrl-C. This patch fixes the issue.

2 years agoCygwin: pty: Revise the code to wait for completion of forwarding.
Takashi Yano [Thu, 10 Feb 2022 08:47:51 +0000 (17:47 +0900)]
Cygwin: pty: Revise the code to wait for completion of forwarding.

- With this patch, the code to wait for completion of forwarding of
  output from non-cygwin app is revised so that it can more reliably
  detect the completion.

2 years agoCygwin: pty: Prevent deadlock on echo output.
Takashi Yano [Thu, 10 Feb 2022 08:22:11 +0000 (17:22 +0900)]
Cygwin: pty: Prevent deadlock on echo output.

- If the slave process writes a lot of text output, doecho() can
  cause deadlock. This is because output_mutex is held in slave::
  write() and if WriteFile() is blocked due to pipe full, doecho()
  tries to acquire output_mutex and gets into deadlock. With this
  patch, the deadlock is prevented on the sacrifice of atomicity
  of doecho().

2 years agoCygwin: pty: Pass Ctrl-Z (EOF) to non-cygwin apps with disable_pcon.
Takashi Yano [Sat, 12 Feb 2022 08:51:55 +0000 (17:51 +0900)]
Cygwin: pty: Pass Ctrl-Z (EOF) to non-cygwin apps with disable_pcon.

- Previously, non-cygwin app running in pty started without pseudo
  console support was suspended by Ctrl-Z rather than sending EOF.
  Even worse, suspended app could not be resumed by fg command. With
  this patch, Ctrl-Z (EOF for non-cygwin apps) is passed to non-cygwin
  app instead of suspending that app. This patch also handles Ctrl-\
  (QUIT) and Ctrl-D (EOF) as well.

2 years agoCygwin: pty, console: Fix Ctrl-C handling for non-cygwin apps.
Takashi Yano [Thu, 10 Feb 2022 07:53:47 +0000 (16:53 +0900)]
Cygwin: pty, console: Fix Ctrl-C handling for non-cygwin apps.

- Currently, if cat is started from cmd.exe which is started in cygwin
  console, Ctrl-C terminates not only cat but also cmd.exe. This also
  happens in pty in which pseudo console is disabled. This patch fixes
  the issue.

2 years agolibgloss: bfin: fix various warnings
Mike Frysinger [Sat, 12 Feb 2022 06:34:21 +0000 (01:34 -0500)]
libgloss: bfin: fix various warnings

No functional changes here, just fix warnings the compiler noticed.

bfin/syscalls.c:156:13: warning: conflicting types for built-in function ‘memset’

bfin/syscalls.c: In function ‘_unlink’:
bfin/syscalls.c:193:3: warning: passing argument 2 of ‘do_syscall’ discards qualifiers from pointer target type
bfin/syscalls.c:33:1: note: expected ‘void *’ but argument is of type ‘const char *’

bfin/syscalls.c: In function ‘_exit’:
bfin/syscalls.c:104:1: warning: ‘noreturn’ function does return

2 years agolibgloss: bfin: fix local header usage after automake move
Mike Frysinger [Sat, 12 Feb 2022 06:29:33 +0000 (01:29 -0500)]
libgloss: bfin: fix local header usage after automake move

Compiling the basiccrt .S files missed an include to the local bfin/
headers causing the build to break when installing anew.

Reported-by: Jeff Law <jeffreyalaw@gmail.com>
2 years agonewlib: remove unused fenv flags
Mike Frysinger [Thu, 10 Feb 2022 05:49:08 +0000 (00:49 -0500)]
newlib: remove unused fenv flags

These look like they were just copied & pasted from common/Makefile.am.
The funcs in this dir are all stubs that don't actually call any math
or builtin functions, and a simple compile shows they produce identical
object code.  So delete to simplify the build rules.

2 years agolibgloss: merge csky configure script up a level
Mike Frysinger [Wed, 9 Feb 2022 05:20:41 +0000 (00:20 -0500)]
libgloss: merge csky configure script up a level

Now that the csky-specific logic ($DO) has been deleted, we can fold
it up a level easily enough.

2 years agolibgloss: merge bfin into top-level Makefile
Mike Frysinger [Wed, 2 Feb 2022 06:06:21 +0000 (01:06 -0500)]
libgloss: merge bfin into top-level Makefile

Avoid a recursive make to speed things up a bit.

2 years agolibgloss: merge iq2000 into top-level Makefile
Mike Frysinger [Wed, 2 Feb 2022 05:23:50 +0000 (00:23 -0500)]
libgloss: merge iq2000 into top-level Makefile

Avoid a recursive make to speed things up a bit.

2 years agolibgloss: merge libnosys into top-level Makefile
Mike Frysinger [Wed, 2 Feb 2022 05:01:43 +0000 (00:01 -0500)]
libgloss: merge libnosys into top-level Makefile

Avoid a recursive make to speed things up a bit.

2 years agolibgloss: csky: clean up unused m68k logic
Mike Frysinger [Wed, 9 Feb 2022 04:51:17 +0000 (23:51 -0500)]
libgloss: csky: clean up unused m68k logic

It looks like csky was created by copying & pasting the m68k port,
but m68k-specific stuff was left over related to target selection.
The makefile doesn't do anything with it, so punt it all to make
the file much simpler.

2 years agoCygwin: console: Maintain ENABLE_(INSERT|QUICK_EDIT)_MODE flags.
Mitchell Hentges [Thu, 10 Feb 2022 15:38:08 +0000 (10:38 -0500)]
Cygwin: console: Maintain ENABLE_(INSERT|QUICK_EDIT)_MODE flags.

- Currently, ENABLE_INSERT_MODE and ENABLE_QUICK_EDIT_MODE are cleared
  if cygwin is started in console. These flags will not be recovered
  even when exiting from cygwin. Also note that if ENABLE_EXTENDED_FLAGS
  is once unset, then the flag ENABLE_QUICK_EDIT_MODE it's associated
  with will no longer be preserved. Unfortunately, we're accidentally
  stepping on this in fhandler_console::set_input_mode().

  This patch solves this by carrying forward these flags in the place
  where it had been ignoring them. Since the previous behaviour of
  leaving these flags unset would essentially maintain their existing
  state, adding the carry-over of the flags now should not alter console
  behaviour.

2 years agoFix expf overflow limit
Andoni Arregi [Wed, 9 Feb 2022 13:52:07 +0000 (14:52 +0100)]
Fix expf overflow limit

Correct the overflow limit in the variable o_threshold to be consistent
with the FLT_UWORD_LOG_MAX variable used by the internal implementation
of the expf algorithm itself.
The u_threshold variable has also been modified to be written in the
same format.

Note that this fix improves the situation but does not completely
correct the inconsistencies regarding the overflow and underflow limits
between the expf wrapper (wf_exp.c) and the expf algorithm itself
(ef_exp.c).

Currently these limits are different for the
_FLT_LARGEST_EXPONENT_IS_NORMAL and _FLT_NO_DENORMALS cases as well as
for the case where __OBSOLETE_MATH is not defined (only for the
underflow limit in this case).

2 years agonewlib: delete unused autotool regen scripts
Mike Frysinger [Thu, 10 Feb 2022 06:38:37 +0000 (01:38 -0500)]
newlib: delete unused autotool regen scripts

These don't work at all now that we've completely upgraded autotools.

2 years agonewlib: libm: fix rebase conflicts
Mike Frysinger [Thu, 10 Feb 2022 05:36:34 +0000 (00:36 -0500)]
newlib: libm: fix rebase conflicts

I missed this cleanup when rebasing on top of the latest branch.

2 years agonewlib: libm: move configure into top-level
Mike Frysinger [Tue, 1 Feb 2022 07:32:17 +0000 (02:32 -0500)]
newlib: libm: move configure into top-level

This kills off the last configure script under libm/ and folds it
into the top newlib configure script.  The vast majority of logic
was already in the top configure script, so move the little that
is left into a libm/acinclude.m4 file.

2 years agonewlib: drop support for $oext
Mike Frysinger [Mon, 7 Feb 2022 10:25:19 +0000 (05:25 -0500)]
newlib: drop support for $oext

This was needed only to support libtool in case objects ended in .lo
instead of .o, but we dropped libtool, so drop this too.

2 years agonewlib: drop support for $aext
Mike Frysinger [Mon, 7 Feb 2022 10:22:24 +0000 (05:22 -0500)]
newlib: drop support for $aext

This was needed only to support libtool in case the library ended in
.la instead of .a, but we dropped libtool, so drop this too.

2 years agonewlib: fix mkdoc dependencies
Mike Frysinger [Thu, 10 Feb 2022 04:26:19 +0000 (23:26 -0500)]
newlib: fix mkdoc dependencies

Make sure we depend on the right name of mkdoc all the time, and that
the rules that need it (e.g. .def files) depend on it.

Reported-by: Jon Turney <jon.turney@dronecode.org.uk>
2 years agonewlib: drop libtool support
Mike Frysinger [Mon, 7 Feb 2022 10:12:05 +0000 (05:12 -0500)]
newlib: drop libtool support

This was only ever used for i?86-pc-linux-gnu targets, but that's been
broken for years, and has since been dropped.  So clean this up too.

This also deletes the funky objectlist logic since it only existed for
the libtool libraries.  Since it was the only thing left in the small
Makefile.shared file, we can punt that too.

2 years agonewlib: punt sys/linux support
Mike Frysinger [Mon, 7 Feb 2022 09:57:29 +0000 (04:57 -0500)]
newlib: punt sys/linux support

This was only used by the i?86-pc-linux-gnu target which we've removed,
and even though it's using a "sys/linux/" dir to make it sound like it
only depends on the Linux kernel, it's actually tied to glibc APIs built
on top of Linux.  Since the code relies on internal glibc APIs and has
been broken for some time, punt it all.  If someone wants to bring it
back, they can try and actually keep the Linux-vs-glibc APIs separate.

2 years agonewlib: drop unused iconvdata
Mike Frysinger [Mon, 7 Feb 2022 10:05:27 +0000 (05:05 -0500)]
newlib: drop unused iconvdata

This was only ever used for i?86-pc-linux-gnu targets, but that's been
broken for years, and has since been dropped.  So clean this up too.

2 years agonewlib: drop i?86-pc-linux-* target support
Mike Frysinger [Mon, 7 Feb 2022 09:57:29 +0000 (04:57 -0500)]
newlib: drop i?86-pc-linux-* target support

This was added 20+ years ago.  It seems to have very few (or no users)
as it only works on 32-bit x86 GNU/Linux (i.e. glibc) systems, and even
then only with old versions of glibc.  It hasn't compiled in at least 5
years, but most likely been broken for more like 15 years -- it relies
on internal glibc APIs (like linuxthreads), and that code has changed
and been deleted significantly since.

This single target ends up dragging in a lot of non-trivial code that is
hard to keep working, and currently impossible to verify -- the libtool
and iconvdata and sys/linux/ code isn't used by anything else, but ends
up touching just about every build file in the tree.  Punt the target so
we can start stripping out all these unique code paths.

This commit by itself just disables the target.  We'll start deleting the
individual unused pieces in followups.

2 years agolibgloss: merge doc into top-level Makefile
Mike Frysinger [Wed, 2 Feb 2022 04:46:57 +0000 (23:46 -0500)]
libgloss: merge doc into top-level Makefile

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

2 years agolibgloss: convert top level to automake
Mike Frysinger [Mon, 17 Jan 2022 09:12:11 +0000 (04:12 -0500)]
libgloss: convert top level to automake

The top level dir isn't doing anything interesting, just recursing into
subdirs.  So this change isn't terribly exciting.  But it sets us up for
doing more fun stuff in follow up commits.

[TODO] Check test targets

2 years agolibgloss: m68k: rename $DO to $TARGET
Mike Frysinger [Wed, 9 Feb 2022 04:53:13 +0000 (23:53 -0500)]
libgloss: m68k: rename $DO to $TARGET

The common $DO variable is used by the multilib logic to control which
target to multiplex.  But the m68k subdir is also using $DO to control
which target (m68k or fido) to build.  As we flatten things to automake,
this conflict shows up and breaks the m68k build.  Just rename the m68k
variable to something unique to avoid it.

2 years agonewlib: switch to standard AC_PROG_RANLIB
Mike Frysinger [Sat, 5 Feb 2022 07:22:54 +0000 (02:22 -0500)]
newlib: switch to standard AC_PROG_RANLIB

This is basically a noop, but switch to the autoconf macro for finding
a suitable ranlib tool.

2 years agonewlib: drop autoconf-2.13 hack
Mike Frysinger [Sat, 5 Feb 2022 07:21:25 +0000 (02:21 -0500)]
newlib: drop autoconf-2.13 hack

We require autoconf-2.69 now, so we don't need this old install hack.

2 years agonewlib: drop cygnus EXEEXT hack
Mike Frysinger [Sat, 5 Feb 2022 07:19:42 +0000 (02:19 -0500)]
newlib: drop cygnus EXEEXT hack

Now that we rely on AC_NO_EXECUTABLES to disable link tests, we don't
need this hack to disable exeext probing.

2 years agonewlib: switch to AM_PROG_AR
Mike Frysinger [Sat, 29 Jan 2022 07:41:03 +0000 (02:41 -0500)]
newlib: switch to AM_PROG_AR

Now that we require automake-1.15, we can use this macro rather than
do the tool search ourselves.

2 years agonewlib: switch to standard AM_PROG_AS
Mike Frysinger [Sat, 5 Feb 2022 06:43:41 +0000 (01:43 -0500)]
newlib: switch to standard AM_PROG_AS

Now that we require a recent automake version, rely on it to provide AS
and CCAS and CCASFLAGS for us.

2 years agonewlib: switch to standard AC_PROG_CC
Mike Frysinger [Sat, 5 Feb 2022 06:14:50 +0000 (01:14 -0500)]
newlib: switch to standard AC_PROG_CC

Now that we use AC_NO_EXECUTABLES, and we require a recent version of
autoconf, we don't need to define our own copies of these macros.  So
switch to the standard AC_PROG_CC.

2 years agonewlib: move AC_NO_EXECUTABLES logic up to common code
Mike Frysinger [Sat, 5 Feb 2022 06:05:06 +0000 (01:05 -0500)]
newlib: move AC_NO_EXECUTABLES logic up to common code

This logic was added to libc & libm to get it working again after some
reworks in the CPP handling, but now that that's settled, let's move
this to the common newlib configure logic.  This will make it easier
to consolidate all the configure calls into the top-level newlib dir.

This does create a lot of noise in the generate scripts, but that's
because of the ordering of the calls, not because of correctness. We
will try to draw that back down in follow up commits as we modernize
the toolchain calls in here.

2 years agonewlib: simplify nds32 automake checks
Mike Frysinger [Mon, 7 Feb 2022 06:15:00 +0000 (01:15 -0500)]
newlib: simplify nds32 automake checks

This code is a bit more convoluted than it needs to be.  GPR_SOURCES
is never set to anything, and the automake checks use negative logic
to add the SP & DP source files to dedicated variables that are only
expanded once.  Get rid of the unused variable, use normal boolean
logic, and collapse the source settings into a single variable.

2 years agonewlib: drop unused xscale subdir
Mike Frysinger [Mon, 7 Feb 2022 10:19:36 +0000 (05:19 -0500)]
newlib: drop unused xscale subdir

This target was deleted in 2011 in 25fa7e5ad63d97d00deef1c9eddb346d11,
but this directory was missed.  Punt it too.

2 years agoCygwin: wincap: Add capabilities for Windows 10 2004 and newer.
Takashi Yano [Sat, 5 Feb 2022 05:47:26 +0000 (14:47 +0900)]
Cygwin: wincap: Add capabilities for Windows 10 2004 and newer.

- The capability changes since Windows 10 2004 have been reflected
  in wincap.cc. (has_con_broken_il_dl has been changed to false.)

2 years agoCygwin: drop dllfixdbg script
Corinna Vinschen [Sat, 5 Feb 2022 09:41:35 +0000 (10:41 +0100)]
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>
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.

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