diff mbox series

[v4,1/3] package/cross-ldd: new package

Message ID 20220110124644.1388438-1-thierry.bultel@linatsea.fr
State Rejected
Headers show
Series [v4,1/3] package/cross-ldd: new package | expand

Commit Message

Thierry Bultel Jan. 10, 2022, 12:46 p.m. UTC
cross-ldd works just as ldd, but supports
other architectures. It is needed by dracut, for instance.
It is suffixed with "-ldd-buildroot" to avoid conflicts
with toolchains that already implement it.

Signed-off-by: Thierry Bultel <thierry.bultel@linatsea.fr>
---
Changes v1 -> v2:
  - simplified the download (suggested by Arnoult)
Changes v2 -> v3
  - changed the name to -ldd-cross, in order to avoid
    a conflict with the external toolchains that implement it
Changes v3 -> v4
  - No more Config.in. It is just a bind host-only package
  - cross-ldd.mk: added pointer to dracut documentation in
    the comment
  - Changed the suffix to -ldd-buildroot
  - No longer uses SED, but uses an actual patch for that

Signed-off-by: Thierry Bultel <thierry.bultel@linatsea.fr>
---
 .../cross-ldd/000-change-extension-name.patch | 12 ++++++++++
 package/cross-ldd/cross-ldd.mk                | 23 +++++++++++++++++++
 package/dracut/dracut                         | 15 ++++++++++++
 3 files changed, 50 insertions(+)
 create mode 100644 package/cross-ldd/000-change-extension-name.patch
 create mode 100644 package/cross-ldd/cross-ldd.mk
 create mode 100644 package/dracut/dracut
diff mbox series

Patch

diff --git a/package/cross-ldd/000-change-extension-name.patch b/package/cross-ldd/000-change-extension-name.patch
new file mode 100644
index 0000000000..74364adc88
--- /dev/null
+++ b/package/cross-ldd/000-change-extension-name.patch
@@ -0,0 +1,12 @@ 
+diff -purN host-cross-ldd-6c9c724ebd6a29c279c6e5734e44c07f067808ec.orig/cross-compile-ldd host-cross-ldd-6c9c724ebd6a29c279c6e5734e44c07f067808ec/cross-compile-ldd
+--- host-cross-ldd-6c9c724ebd6a29c279c6e5734e44c07f067808ec.orig/cross-compile-ldd	2022-01-06 12:25:40.144852639 +0000
++++ host-cross-ldd-6c9c724ebd6a29c279c6e5734e44c07f067808ec/cross-compile-ldd	2022-01-06 12:25:40.148852681 +0000
+@@ -19,7 +19,7 @@ sed="${SED:-sed}"
+ grep="${GREP:-grep}"
+ 
+ my_name="$( basename "${0}" )"
+-prefix="${0%-ldd}"
++prefix="${0%-ldd-buildroot}"
+ gcc="${prefix}-gcc"
+ readelf="${prefix}-readelf"
+ fake_load_addr_root="$((0xdeadbeef))"
diff --git a/package/cross-ldd/cross-ldd.mk b/package/cross-ldd/cross-ldd.mk
new file mode 100644
index 0000000000..845e819aee
--- /dev/null
+++ b/package/cross-ldd/cross-ldd.mk
@@ -0,0 +1,23 @@ 
+################################################################################
+#
+# cross-ldd
+#
+# ldd drop-in replacement for cross-compilation toolchains.
+# This is the officially supported version mentioned
+# in the dracut documentation (see dracut/docs/README.cross)
+#
+################################################################################
+
+CROSS_LDD_VERSION = 6c9c724ebd6a29c279c6e5734e44c07f067808ec
+CROSS_LDD_SOURCE = $(CROSS_LDD_VERSION).tar.gz
+CROSS_LDD_SITE = https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f/archive
+CROSS_LDD_LICENSE = GPL-2.0
+
+# Notice that we change the name to '-ldd-buildroot', in order to avoid conflict
+# with some external toolchains that implement it
+
+define HOST_CROSS_LDD_INSTALL_CMDS
+	install -D -m 755 $(@D)/cross-compile-ldd $(TARGET_CROSS)ldd-buildroot
+endef
+
+$(eval $(host-generic-package))
diff --git a/package/dracut/dracut b/package/dracut/dracut
new file mode 100644
index 0000000000..9d3db3b58e
--- /dev/null
+++ b/package/dracut/dracut
@@ -0,0 +1,15 @@ 
+#!/bin/bash
+
+set -e
+set -x
+
+if [ -z "$*" ]; then
+    echo "No argument supplied"
+    exit
+fi
+
+DRACUT_LDD=${TARGET_CROSS}ldd-cross \
+DRACUT_INSTALL="${HOST_DIR}/lib/dracut/dracut-install" \
+dracutbasedir=${HOST_DIR}/usr/lib/dracut \
+dracutsysrootdir=${TARGET_DIR} \
+${HOST_DIR}/bin/dracut "$@"