* [PATCH] newlib: libm: merge machine/ trampoline up a level
@ 2022-01-23 0:59 Mike Frysinger
2022-01-23 5:49 ` Mike Frysinger
0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2022-01-23 0:59 UTC (permalink / raw)
To: newlib
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.
---
newlib/libm/Makefile.am | 5 +-
newlib/libm/Makefile.in | 6 +-
newlib/libm/common/Makefile.in | 1 +
newlib/libm/complex/Makefile.in | 1 +
newlib/libm/configure | 63 +-
newlib/libm/configure.ac | 23 +-
newlib/libm/fenv/Makefile.in | 1 +
newlib/libm/machine/Makefile.am | 26 -
newlib/libm/machine/Makefile.in | 650 --
newlib/libm/machine/aclocal.m4 | 1178 ---
newlib/libm/machine/configure | 14383 -----------------------------
newlib/libm/machine/configure.ac | 53 -
newlib/libm/math/Makefile.in | 1 +
newlib/libm/mathfp/Makefile.in | 1 +
14 files changed, 91 insertions(+), 16301 deletions(-)
delete mode 100644 newlib/libm/machine/Makefile.am
delete mode 100644 newlib/libm/machine/Makefile.in
delete mode 100644 newlib/libm/machine/aclocal.m4
delete mode 100755 newlib/libm/machine/configure
delete mode 100644 newlib/libm/machine/configure.ac
diff --git a/newlib/libm/Makefile.am b/newlib/libm/Makefile.am
index 8d355cbf6f69..5165ff34b9c0 100644
--- a/newlib/libm/Makefile.am
+++ b/newlib/libm/Makefile.am
@@ -6,7 +6,10 @@ else
MATHDIR = math
endif
-SUBDIRS = $(MATHDIR) common complex fenv machine
+SUBDIRS = $(MATHDIR) common complex fenv
+if HAVE_LIBM_MACHINE_DIR
+SUBDIRS += $(LIBM_MACHINE_DIR)
+endif
libm_la_LDFLAGS = -Xcompiler -nostdlib
diff --git a/newlib/libm/configure.ac b/newlib/libm/configure.ac
index 3f9c01e1563f..500a542f64f1 100644
--- a/newlib/libm/configure.ac
+++ b/newlib/libm/configure.ac
@@ -34,13 +34,30 @@ AM_CONDITIONAL(HAVE_LONG_DOUBLE, test x"$ac_cv_type_long_double" = x"yes")
LIBM_MACHINE_LIB=
if test -n "${libm_machine_dir}"; then
+ case ${libm_machine_dir} in
+ aarch64) AC_CONFIG_SUBDIRS(machine/aarch64) ;;
+ arm) AC_CONFIG_SUBDIRS(machine/arm) ;;
+ i386) AC_CONFIG_SUBDIRS(machine/i386) ;;
+ nds32) AC_CONFIG_SUBDIRS(machine/nds32) ;;
+ pru) AC_CONFIG_SUBDIRS(machine/pru) ;;
+ spu) AC_CONFIG_SUBDIRS(machine/spu) ;;
+ riscv) AC_CONFIG_SUBDIRS(machine/riscv) ;;
+ x86_64) AC_CONFIG_SUBDIRS(machine/x86_64) ;;
+ powerpc) AC_CONFIG_SUBDIRS(machine/powerpc) ;;
+ sparc) AC_CONFIG_SUBDIRS(machine/sparc) ;;
+ mips) AC_CONFIG_SUBDIRS(machine/mips) ;;
+ *) AC_MSG_ERROR([unsupported libm_machine_dir "${libm_machine_dir}"]) ;;
+ esac
+
+ LIBM_MACHINE_DIR=machine/${libm_machine_dir}
if test "${use_libtool}" = "yes"; then
- LIBM_MACHINE_LIB=machine/${libm_machine_dir}/lib${libm_machine_dir}.${aext}
+ LIBM_MACHINE_LIB=${LIBM_MACHINE_DIR}/lib${libm_machine_dir}.${aext}
else
- LIBM_MACHINE_LIB=machine/lib.${aext}
+ LIBM_MACHINE_LIB=${LIBM_MACHINE_DIR}/lib.${aext}
fi
fi
-
+AM_CONDITIONAL(HAVE_LIBM_MACHINE_DIR, test "x${LIBM_MACHINE_DIR}" != x)
+AC_SUBST(LIBM_MACHINE_DIR)
AC_SUBST(LIBM_MACHINE_LIB)
AC_CONFIG_FILES([Makefile math/Makefile mathfp/Makefile common/Makefile complex/Makefile fenv/Makefile])
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] newlib: libm: merge machine/ trampoline up a level
2022-01-23 0:59 [PATCH] newlib: libm: merge machine/ trampoline up a level Mike Frysinger
@ 2022-01-23 5:49 ` Mike Frysinger
0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2022-01-23 5:49 UTC (permalink / raw)
To: newlib
[-- Attachment #1: Type: text/plain, Size: 110 bytes --]
actually, disregard this one. i'm going to send a patch series with
this in it, so let's review there.
-mike
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-23 5:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-23 0:59 [PATCH] newlib: libm: merge machine/ trampoline up a level Mike Frysinger
2022-01-23 5:49 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).