aboutsummaryrefslogtreecommitdiff
path: root/newlib
AgeCommit message (Collapse)AuthorFilesLines
2022-02-23newlib: fix multilib libg.a parallel buildsMike Frysinger2-6/+10
I split libg.a out into a sep target from libc.a for the main dir in commit f2b053f49ed2bd7b4da8cf4ed3a608dc2f425c2b ("newlib: separate out libg from libc"), but missed the multilib dirs. That leads to an uncommon parallel build failure: - libc.a rule runs & finishes - $(BUILD_MULTISUBDIR)/libc.a rule runs -> failure due to libg.a not yet existing - libg.a rule runs & finishes Split the multilib libg rule out from libc too so it can depend on the main libg directly and avoid this race.
2022-02-23newlib: libm: workaround ar duplicate member behaviorMike Frysinger2-5/+47
GNU ar has undocumented behavior where it doesn't dedupe its inputs if they're all on the same command line, so we have to dedupe ourselves.
2022-02-22Make __sdidinit unusedMatt Joyce8-20/+16
Remove dependency on __sdidinit member of struct _reent to check object initialization. Like __sdidinit, the __cleanup member of struct _reent is initialized in the __sinit() function. Checking initialization against __cleanup serves the same purpose and will reduce overhead in the __sfp() function in a follow up patch.
2022-02-18newlib: libc: delete crt0.o duplicationMike Frysinger111-143/+1
The crt0.o was handled in a subdir-by-subdir basis: it would be compiled in one (e.g. libc/sys/$arch/), then copied up one level (libc/sys/), then copied up another (libc/) before finally being copied & installed in the top newlib dir. The libc/sys/ copy was cleaned up, and then the top dir was changed to copy it directly out of the libc/sys/$arch/ dir. But the libc/sys/ copy to libc/ was left behind. Clean that up now too.
2022-02-18newlib: posix: use local includes for local headersMike Frysinger3-4/+4
These headers aren't installed, so use "" includes instead of <> so we don't search system header paths. This matches the style used elsewhere in the tree for these local headers, and makes it work w/out explicit -I flags (as needed with non-recursive make).
2022-02-17newlib: libm: merge build up a directoryMike Frysinger55-15121/+7868
Convert all the libm/ subdir makes into the top-level Makefile. This allows us to build all of libm from the top Makefile without using any recursive make calls. This is faster and avoids the funky lib.a logic where we unpack subdir archives to repack into a single libm.a. The machine override logic is maintained though by way of Makefile include ordering, and source file accumulation in libm_a_SOURCES. One thing to note is that this will require GNU Make because of: libm_a_CFLAGS = ... $(libm_a_CFLAGS_$(subst /,_,$(@D))) This was the only way I could find to supporting per-dir compiler settings, and I couldn't find a POSIX compatible way of transforming the variable content. I don't think this is a big deal as other Makefiles in the tree are using GNU Make-specific syntax, but I call this out as it's the only one so far in the new automake code that I've been writing. Automake doesn't provide precise control over the output object names (by design). This is fine by default as we get consistent names in all the subdirs: libm_a-<source>.o. But this relies on using the same set of compiler flags for all objects. We currently compile libm/common/ with different optimizations than the rest. If we want to compile objects differently, we can create an intermediate archive with the subset of objects with unique flags, and then add those objects to the main archive. But Automake will use a different prefix for the objects, and thus we can't rely on ordering to override. But if we leverage $@, we can turn Automake's CFLAGS into a multiplex on a per-dir (and even per-file if we wanted) basis. Unfortunately, since $@ contains /, Automake complains it's an invalid name. While GNU Make supports this, it's a POSIX extension, so Automake flags it. Using $(subst) avoids the Automake warning to get a POSIX compliant name, albeit with a GNU Make extension.
2022-02-17newlib: separate out libg from libcMike Frysinger2-12/+20
Make this a separate target from libc so that we can migrate libc over to automake more easily. Having it integrated into the libc target is difficult to handle when using automake rules which expect a one-to-one mapping between names & inputs.
2022-02-17newlib: libc: reshuffle include order for the manualMike Frysinger11-104/+115
When migrating the manual to the top-level, the include order was sorted by name of the subdir. But this changed the chapter order of the manual in the process. Change the sorting back to match existing chapters and update the comments to explain.
2022-02-17newlib: powerpc: switch to Automake conditionalsMike Frysinger2-72/+81
Using xxx_LIBADD, xxx_DEPENDENCIES, and EXTRA_xxx_SOURCES is one way of conditionally including files into a target. But it's meant more for the cases where the variables added to LIBADD & DEPENDENCIES are constructed via substitution (e.g. AC_SUBST) or other dynamic methods. With Automake conditionals, then the much simpler form is to conditionally append to the xxx_SOURCES variable and let Automake sort everything out.
2022-02-17newlib: use https:// URIs in more placesMike Frysinger1-3/+3
2022-02-16newlib: fix mips fenv.o handlingMike Frysinger2-3/+3
Commit 8fa73a9f8414a4926365324c2fe32a237c2eb91d changed how fenv.c is compiled wrt mips16 targets used the wrong variable to add fenv.o to libm.a. Fix that thinko so it's included in the build again.
2022-02-16newlib: rtems: drop redundant header installMike Frysinger2-45/+9
The top-level newlib dir already takes care of recursing into the sys/xxx/include/ subdirs and installing any headers found, so the rtems subdir doesn't need to do this itself.
2022-02-16newlib: add missing mkdir to header installMike Frysinger2-0/+2
Make sure these subdirs exist before trying to install headers into them.
2022-02-16newlib: powerpc: simplify reallocr & callocr build logicMike Frysinger4-14/+18
Replace the custom build rules (which require copying & pasting from the current Makefile) with small stub files. This allows us to drop the rules entirely and let Automake provide everything.
2022-02-16newlib: i386/xstormy16: drop unused -I libm/common flagMike Frysinger4-9/+4
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.
2022-02-15newlib/libgloss: drop unused $(CROSS_CFLAGS)Mike Frysinger242-272/+242
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.
2022-02-15newlib: drop support for decstation & sunos systemsMike Frysinger56-4744/+1
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.
2022-02-15newlib: rename doc/local.mk to Makefile.incMike Frysinger3-3/+3
For consistency across the whole tree.
2022-02-15newlib: phoenix: merge configure up to top-levelMike Frysinger118-6784/+319
Merge sys/phoenix/ configure logic into libc/ itself. This kills off the last lingering script in this tree (other than libc itself).
2022-02-15newlib: phoenix: merge machine/ configure scripts up a levelMike Frysinger8-6651/+34
The machine configure scripts are all effectively stub scripts that pass the higher level options to its own makefile.
2022-02-15newlib: phoenix: merge machine/ trampoline up a levelMike Frysinger9-7201/+44
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.
2022-02-15newlib: phoenix: drop missing machine subdirsMike Frysinger2-13/+1
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.
2022-02-15newlib: phoenix: move some logic from configure to the MakefileMike Frysinger8-22/+6
These configure scripts hardcode some settings, so move them to the Makefile to simplify so we can drop the configure scripts entirely.
2022-02-14Improve lgammaf range for very small casesAndoni Arregi1-1/+1
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)
2022-02-11newlib: remove unused fenv flagsMike Frysinger2-4/+2
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.
2022-02-10Fix expf overflow limitAndoni Arregi1-2/+2
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).
2022-02-10newlib: delete unused autotool regen scriptsMike Frysinger3-15/+0
These don't work at all now that we've completely upgraded autotools.
2022-02-10newlib: libm: fix rebase conflictsMike Frysinger2-10/+2
I missed this cleanup when rebasing on top of the latest branch.
2022-02-10newlib: libm: move configure into top-levelMike Frysinger25-6915/+652
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.
2022-02-09newlib: drop support for $oextMike Frysinger144-568/+423
This was needed only to support libtool in case objects ended in .lo instead of .o, but we dropped libtool, so drop this too.
2022-02-09newlib: drop support for $aextMike Frysinger143-193/+48
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.
2022-02-09newlib: fix mkdoc dependenciesMike Frysinger4-4/+8
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>
2022-02-09newlib: drop libtool supportMike Frysinger186-35199/+2186
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.
2022-02-09newlib: punt sys/linux supportMike Frysinger831-221915/+6
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.
2022-02-09newlib: drop unused iconvdataMike Frysinger17-15730/+36
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.
2022-02-09newlib: drop i?86-pc-linux-* target supportMike Frysinger5-83/+5
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.
2022-02-08newlib: switch to standard AC_PROG_RANLIBMike Frysinger1-1/+1
This is basically a noop, but switch to the autoconf macro for finding a suitable ranlib tool.
2022-02-08newlib: drop autoconf-2.13 hackMike Frysinger13-57/+18
We require autoconf-2.69 now, so we don't need this old install hack.
2022-02-08newlib: drop cygnus EXEEXT hackMike Frysinger13-174/+18
Now that we rely on AC_NO_EXECUTABLES to disable link tests, we don't need this hack to disable exeext probing.
2022-02-08newlib: switch to AM_PROG_ARMike Frysinger167-1132/+2957
Now that we require automake-1.15, we can use this macro rather than do the tool search ourselves.
2022-02-08newlib: switch to standard AM_PROG_ASMike Frysinger28-1280/+376
Now that we require a recent automake version, rely on it to provide AS and CCAS and CCASFLAGS for us.
2022-02-08newlib: switch to standard AC_PROG_CCMike Frysinger167-11192/+160
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.
2022-02-08newlib: move AC_NO_EXECUTABLES logic up to common codeMike Frysinger21-9463/+13881
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.
2022-02-08newlib: simplify nds32 automake checksMike Frysinger2-20/+15
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.
2022-02-08newlib: drop unused xscale subdirMike Frysinger14-1738/+0
This target was deleted in 2011 in 25fa7e5ad63d97d00deef1c9eddb346d11, but this directory was missed. Punt it too.
2022-02-05newlib: drop shared documentation rulesMike Frysinger50-1702/+47
Now that the top-level makefile handles these, don't need to copy these into every single subdir.
2022-02-05newlib: move man page generation into top-level buildMike Frysinger47-870/+203
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-04newlib: libc: move manual into top-level buildMike Frysinger63-868/+948
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-04newlib: libc: include all chapters all the time in the manualMike Frysinger113-711/+18
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-04newlib: libm: move manual into top-level buildMike Frysinger21-556/+634
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.