Skip to contentSkip to conversation

eglibc: Move perl- and bash-using scripts to separate recipes

RFC PATCH Superseded Phil Blundell 3 participants 4 messages Sep 23, 2012 – Sep 24, 2012

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 eglibc: Move perl- and bash-using scripts to separate recipes

This removes the dependency of eglibc.bb itself on perl and bash which, in turn, eliminates the need to build those two recipes if the scripts which need them are not going to be installed.

---
 meta/recipes-core/eglibc/eglibc-collateral.inc  |   11 ++++++++
 meta/recipes-core/eglibc/eglibc-locale.inc      |   11 +--------
 meta/recipes-core/eglibc/eglibc-mtrace.inc      |   12 +++++++++
 meta/recipes-core/eglibc/eglibc-mtrace_2.16.bb  |    1 +
 meta/recipes-core/eglibc/eglibc-package.inc     |   29 +++++++++++++++++-----
 meta/recipes-core/eglibc/eglibc-scripts.inc     |   17 +++++++++++++
 meta/recipes-core/eglibc/eglibc-scripts_2.16.bb |    1 +
 meta/recipes-core/eglibc/eglibc_2.16.bb         |    2 +-
 8 files changed, 66 insertions(+), 18 deletions(-)
 create mode 100644 meta/recipes-core/eglibc/eglibc-collateral.inc
 create mode 100644 meta/recipes-core/eglibc/eglibc-mtrace.inc
 create mode 100644 meta/recipes-core/eglibc/eglibc-mtrace_2.16.bb
 create mode 100644 meta/recipes-core/eglibc/eglibc-scripts.inc
 create mode 100644 meta/recipes-core/eglibc/eglibc-scripts_2.16.bb
meta/recipes-core/eglibc/eglibc-collateral.inc new file +11 -0
new file mode 100644
index 0000000..b770bb0
@@ -0,0 +1,11 @@
+INHIBIT_DEFAULT_DEPS = "1"
+LICENSE = "GPLv2 & LGPLv2.1"
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot"
+
meta/recipes-core/eglibc/eglibc-locale.inc +1 -10
index 296afde..729e9e6 100644
@@ -1,15 +1,8 @@
-INHIBIT_DEFAULT_DEPS = "1"
-LICENSE = "GPLv2 & LGPLv2.1"
+include eglibc-collateral.inc
 
 BPN = "eglibc"
 LOCALEBASEPN = "eglibc"
 
-do_fetch[noexec] = "1"
-do_unpack[noexec] = "1"
-do_patch[noexec] = "1"
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
-
 # Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
 # is set. The idea is to avoid running localedef on the target (at first boot)
 # to decrease initial boot time and avoid localedef being killed by the OOM
@@ -90,6 +83,4 @@ do_install () {
 
 inherit libc-package
 
-do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot"
-
 BBCLASSEXTEND = "nativesdk"
meta/recipes-core/eglibc/eglibc-mtrace.inc new file +12 -0
new file mode 100644
index 0000000..321de7b
@@ -0,0 +1,12 @@
+include eglibc-collateral.inc
+
+SUMMARY = "mtrace utility provided by eglibc"
+DESCRIPTION = "mtrace utility provided by eglibc"
+RDEPENDS_${PN} = "perl"
+
+SRC = "${STAGING_INCDIR}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
+
+do_install() {
+	install -d -m 0755 ${D}${bindir}
+	install -m 0755 ${SRC}/mtrace ${D}${bindir}/
+}
meta/recipes-core/eglibc/eglibc-mtrace_2.16.bb new file +1 -0
new file mode 100644
index 0000000..6fa2be9
@@ -0,0 +1 @@
+require eglibc-mtrace.inc
meta/recipes-core/eglibc/eglibc-package.inc +22 -7
index ab7540a..c74665d 100644
@@ -17,7 +17,7 @@ python __anonymous () {
 # Set this to zero if you don't want ldconfig in the output package
 USE_LDCONFIG ?= "1"
 
-PACKAGES = "${PN}-dbg catchsegv sln nscd ldd ${PN}-mtrace ${PN}-utils eglibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} eglibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd eglibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} eglibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
 
 # The ld.so in this eglibc supports the GNU_HASH
 RPROVIDES_${PN} = "glibc rtld(GNU_HASH)"
@@ -51,8 +51,6 @@ FILES_${PN}-utils = "${bindir}/* ${sbindir}/*"
 FILES_${PN}-dbg += "${libexecdir}/*/.debug ${libdir}/audit/.debug"
 FILES_catchsegv = "${bindir}/catchsegv"
 RDEPENDS_catchsegv = "libsegfault"
-RDEPENDS_${PN}-utils += "bash"
-RDEPENDS_${PN}-mtrace += "perl"
 FILES_${PN}-pcprofile = "${base_libdir}/libpcprofile.so"
 FILES_eglibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so"
 RPROVIDES_${PN}-dev += "libc-dev"
@@ -65,11 +63,9 @@ DESCRIPTION_nscd = "nscd, name service cache daemon, caches name service lookups
 SUMMARY_eglibc-extra-nss = "hesiod, NIS and NIS+ nss libraries"
 DESCRIPTION_eglibc-extra-nss = "eglibc: nis, nisplus and hesiod search services."
 SUMMARY_ldd = "print shared library dependencies"
-DESCRIPTION_ldd = "/usr/bin/ldd prints shared library dependencies for each program or shared library specified on the command line."
+DESCRIPTION_ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line."
 SUMMARY_${PN}-utils = "Miscellaneous utilities provided by eglibc"
 DESCRIPTION_${PN}-utils = "Miscellaneous utilities including getconf, iconf, locale, gencat, tzselect, zic, rpcinfo, ..."
-SUMMARY_${PN}-mtrace = "mtrace utility provided by eglibc"
-DESCRIPTION_${PN}-mtrace = "mtrace utility provided by eglibc"
 DESCRIPTION_libsotruss = "Library to support sotruss which traces calls through PLTs"
 
 inherit libc-common multilib_header
@@ -109,10 +105,29 @@ do_install_locale () {
 
 addtask do_install_locale after do_install before do_populate_sysroot do_package
 
+bashscripts = "mtrace sotruss xtrace"
+
+do_evacuate_scripts () {
+	target=${D}${includedir}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}
+	mkdir -p $target
+	for i in ${bashscripts}; do
+		cp ${D}${bindir}/$i $target/
+	done
+}
+
+do_evacuate_scripts_pn-eglibc-initial () {
+	:
+}
+
+addtask evacuate_scripts after do_install before do_populate_sysroot do_package
+
 PACKAGE_PREPROCESS_FUNCS += "eglibc_package_preprocess"
 
 eglibc_package_preprocess () {
 	rm -rf ${PKGD}/${includedir}/eglibc-locale-internal-${MULTIMACH_TARGET_SYS}
+	rm -rf ${PKGD}/${includedir}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}
 	rm -rf ${PKGD}/${libdir}/locale
+	for i in ${bashscripts}; do
+	    rm -f ${PKGD}${bindir}/$i
+	done
 }
-
meta/recipes-core/eglibc/eglibc-scripts.inc new file +17 -0
new file mode 100644
index 0000000..a020961
@@ -0,0 +1,17 @@
+include eglibc-collateral.inc
+
+SUMMARY = "utility scripts provided by eglibc"
+DESCRIPTION = "utility scripts provided by eglibc"
+RDEPENDS_${PN} = "bash"
+RDEPENDS_ldd = "bash"
+
+SRC = "${STAGING_INCDIR}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
+
+bashscripts = "mtrace sotruss xtrace"
+
+do_install() {
+	install -d -m 0755 ${D}${bindir}
+	for i in ${bashscripts}; do
+		install -m 0755 ${SRC}/$i ${D}${bindir}/
+	done
+}
meta/recipes-core/eglibc/eglibc-scripts_2.16.bb new file +1 -0
new file mode 100644
index 0000000..3113362
@@ -0,0 +1 @@
+require eglibc-scripts.inc
meta/recipes-core/eglibc/eglibc_2.16.bb +1 -1
index 72d134a..3a7ae50 100644
@@ -3,7 +3,7 @@ require eglibc.inc
 SRCREV = "20393"
 
 DEPENDS += "gperf-native kconfig-frontends-native"
-PR = "r10"
+PR = "r11"
 PR_append = "+svnr${SRCPV}"
 
 EGLIBC_BRANCH="eglibc-2_16"
Signature · 1 line
1.7.9
#1 lore raw
Quoted 4 lines · Phil Blundell

This removes the dependency of eglibc.bb itself on perl and bash which, in turn, eliminates the need to build those two recipes if the scripts which need them are not going to be installed.

I think this is a good patch.

Quoted 1 line

...

meta/recipes-core/eglibc/eglibc-scripts.inc line 6

Quoted 9 lines
meta/recipes-core/eglibc/eglibc-scripts.inc new file +6 -0
@@ -0,0 +1,17 @@
+include eglibc-collateral.inc
+
+SUMMARY = "utility scripts provided by eglibc"
+DESCRIPTION = "utility scripts provided by eglibc"
+RDEPENDS_${PN} = "bash"
+RDEPENDS_ldd = "bash"

we do not ask for bash see
sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in in eglibc.inc

Quoted 41 lines
meta/recipes-core/eglibc/eglibc-scripts.inc new file +11 -0
+
+SRC = "${STAGING_INCDIR}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
+
+bashscripts = "mtrace sotruss xtrace"
+
+do_install() {
+       install -d -m 0755 ${D}${bindir}
+       for i in ${bashscripts}; do
+               install -m 0755 ${SRC}/$i ${D}${bindir}/
+       done
+}
meta/recipes-core/eglibc/eglibc-scripts_2.16.bb new file +1 -0
new file mode 100644
index 0000000..3113362
@@ -0,0 +1 @@
+require eglibc-scripts.inc
meta/recipes-core/eglibc/eglibc_2.16.bb +1 -2
index 72d134a..3a7ae50 100644
@@ -3,7 +3,7 @@ require eglibc.inc
 SRCREV = "20393"
 
 DEPENDS += "gperf-native kconfig-frontends-native"
-PR = "r10"
+PR = "r11"
 PR_append = "+svnr${SRCPV}"
 
 EGLIBC_BRANCH="eglibc-2_16"
--

1.7.9

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#2 lore raw
Quoted 8 lines · Khem Raj
Quoted 4 lines · Phil Blundell

This removes the dependency of eglibc.bb itself on perl and bash which, in turn, eliminates the need to build those two recipes if the scripts which need them are not going to be installed.

I think this is a good patch.

This causes issues with world build and will likely also cause toolchain build failures since eglibc-utils is included in a couple of packagegroups (self-hosted and core-lsb), it's also listed in the tclibc-eglibc.inc LIBC_DEPENDENCIES.

I am not sure this is a candidate for 1.3 at this point either since we are starting the RC2 this week, so it might get held up from master, I know this is the RFC, so when the real patch comes.

Sau!

Quoted 67 lines
Quoted 1 line

...

meta/recipes-core/eglibc/eglibc-scripts.inc line 6

Quoted 9 lines
meta/recipes-core/eglibc/eglibc-scripts.inc new file +6 -0
@@ -0,0 +1,17 @@
+include eglibc-collateral.inc
+
+SUMMARY = "utility scripts provided by eglibc"
+DESCRIPTION = "utility scripts provided by eglibc"
+RDEPENDS_${PN} = "bash"
+RDEPENDS_ldd = "bash"

we do not ask for bash see
sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in in eglibc.inc

Quoted 37 lines
meta/recipes-core/eglibc/eglibc-scripts.inc new file +11 -0
+
+SRC = "${STAGING_INCDIR}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
+
+bashscripts = "mtrace sotruss xtrace"
+
+do_install() {
+       install -d -m 0755 ${D}${bindir}
+       for i in ${bashscripts}; do
+               install -m 0755 ${SRC}/$i ${D}${bindir}/
+       done
+}
meta/recipes-core/eglibc/eglibc-scripts_2.16.bb new file +1 -0
new file mode 100644
index 0000000..3113362
@@ -0,0 +1 @@
+require eglibc-scripts.inc
meta/recipes-core/eglibc/eglibc_2.16.bb +1 -2
index 72d134a..3a7ae50 100644
@@ -3,7 +3,7 @@ require eglibc.inc
  SRCREV = "20393"
 
  DEPENDS += "gperf-native kconfig-frontends-native"
-PR = "r10"
+PR = "r11"
  PR_append = "+svnr${SRCPV}"
 
  EGLIBC_BRANCH="eglibc-2_16"
--

1.7.9

Quoted 4 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 7 lines · Saul Wold
Quoted 6 lines · Khem Raj
Quoted 4 lines · Phil Blundell

This removes the dependency of eglibc.bb itself on perl and bash which, in turn, eliminates the need to build those two recipes if the scripts which need them are not going to be installed.

Quoted 6 lines
Quoted 2 lines

I think this is a good patch.

This causes issues with world build and will likely also cause toolchain build failures since eglibc-utils is included in a couple of packagegroups (self-hosted and core-lsb), it's also listed in the tclibc-eglibc.inc LIBC_DEPENDENCIES.

Ah, whoops. eglibc-utils shouldn't have been removed from PACKAGES, that was an error. I'll send a new version of the patch which reinstates it.

p.