Skip to contentSkip to conversation

util-linux: backport patch to skip build of unused objects

PATCH Superseded Luca Bocassi 1 participant 2 messages Mar 16, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 util-linux: backport patch to skip build of unused objects

From: Luca Boccassi <[email protected]>

util-linux-uuid does not need libtcolors.a and libcommon.a but they get build regardless. Backport a patch from upstream to skip them and save some compilation time.

https://github.com/karelzak/util-linux/commit/c65953d72bbc7412f32e566d9fa6e780d84f0696

---
autoconf is still the major bottleneck, but it's a tiny patch and it was accepted upstream, so probably worth having even if it helps only a little

 meta/recipes-core/util-linux/util-linux.inc   |  1 +
 ...RA_LTLIBRARIES-instead-of-noinst_LTL.patch | 40 +++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 meta/recipes-core/util-linux/util-linux/Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch
meta/recipes-core/util-linux/util-linux.inc +1 -0
index b4f817ed82..4031c586c9 100644
@@ -37,5 +37,6 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz
            file://run-ptest \
            file://display_testname_for_subtest.patch \
            file://avoid_parallel_tests.patch \
+           file://Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch \
            "
 SRC_URI[sha256sum] = "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f"
meta/recipes-core/util-linux/util-linux/Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch new file +40 -0
new file mode 100644
index 0000000000..9fe3c47d58
@@ -0,0 +1,40 @@
+Author: Luca Boccassi <[email protected]>
+Description: Automake: use EXTRA_LTLIBRARIES instead of noinst_LTLIBRARIES
+ noinst_LTLIBRARIES causes the libraries to be always built
+ unconditionally. EXTRA_LTLIBRARIES causes them to be built
+ only if other build target needs them.
+ In other words, avoid building libcommon.a and libtcolors.a
+ unless they are needed by another library/executable and
+ save some build time.
+Upstream-Status: backport, commit:c65953d72bbc7412f32e566d9fa6e780d84f0696
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -39,7 +39,7 @@ bashcompletiondir = @bashcompletiondir@
+ 
+ dist_noinst_HEADERS =
+ noinst_PROGRAMS =
+-noinst_LTLIBRARIES =
++EXTRA_LTLIBRARIES =
+ usrbin_exec_PROGRAMS =
+ usrsbin_exec_PROGRAMS =
+ dist_man_MANS =
+--- a/lib/Makemodule.am
++++ b/lib/Makemodule.am
+@@ -9,7 +9,7 @@
+ # Note that you need "make install-strip" (or proper rpm / Debian build)
+ # to generate binaries with only relevant stuff.
+ #
+-noinst_LTLIBRARIES += libcommon.la
++EXTRA_LTLIBRARIES += libcommon.la
+ libcommon_la_CFLAGS = $(AM_CFLAGS)
+ libcommon_la_SOURCES = \
+ 	lib/blkdev.c \
+@@ -59,7 +59,7 @@ libcommon_la_SOURCES += lib/sysfs.c
+ endif
+ endif
+ 
+-noinst_LTLIBRARIES += libtcolors.la
++EXTRA_LTLIBRARIES += libtcolors.la
+ libtcolors_la_CFLAGS = $(AM_CFLAGS)
+ libtcolors_la_SOURCES = lib/colors.c lib/color-names.c include/colors.h include/color-names.h
+ libtcolors_la_LIBADD =
Signature · 1 line
2.29.2
#1 lore raw

PATCH v2 1/1 util-linux: backport patch to skip build of unused objects

From: Luca Boccassi <[email protected]>

util-linux-uuid does not need libtcolors.a and libcommon.a but they get build regardless. Backport a patch from upstream to skip them and save some compilation time.

https://github.com/karelzak/util-linux/commit/c65953d72bbc7412f32e566d9fa6e780d84f0696

---
autoconf is still the major bottleneck, but it's a tiny patch and it was accepted upstream, so probably worth having even if it helps only a little

v2: add EXTRA_LTLIBRARIES to CLEANFILES, which does not happen automatically
unlike noinst_LTLIBRARIES. Necessary for make distcheck.

 meta/recipes-core/util-linux/util-linux.inc   |  1 +
 ...RA_LTLIBRARIES-instead-of-noinst_LTL.patch | 49 +++++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 meta/recipes-core/util-linux/util-linux/Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch
meta/recipes-core/util-linux/util-linux.inc +1 -0
index b4f817ed82..4031c586c9 100644
@@ -37,5 +37,6 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz
            file://run-ptest \
            file://display_testname_for_subtest.patch \
            file://avoid_parallel_tests.patch \
+           file://Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch \
            "
 SRC_URI[sha256sum] = "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f"
meta/recipes-core/util-linux/util-linux/Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.29.2