[elbe-devel] [PATCH 14/37] sdk: Add missing run/debug components

Benedikt Spranger b.spranger at linutronix.de
Wed Feb 7 15:28:41 CET 2024


From: John Ogness <john.ogness at linutronix.de>

A toolchain typically contains everything necessary to build, run,
and debug software. Although the ELBE SDK contains everything
necessary to build, it does not contain everything necessary to
run and debug the software. The missing components are:

ldconfig: To setup the dynamic loader cache on the target.

gdbserver: To perform remote debugging on the target.

glibc debug symbols: To debug the libraries provided by the
toolchain.

Add these 3 missing components.

Signed-off-by: John Ogness <john.ogness at linutronix.de>
Reviewed-by: Kurt Kanzenbach <kurt at linutronix.de>
---
 elbepack/elbeproject.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index dc0009e6..e83934dd 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -222,6 +222,8 @@ class ElbeProject:
         paths = [
             './usr/include',
             './usr/include/' + triplet,
+            './usr/bin/gdbserver',
+            './usr/sbin/ldconfig',
             './etc/ld.so.conf*',
             './opt/*/lib/*.so',
             './opt/*lib/*.so.*',
@@ -249,6 +251,10 @@ class ElbeProject:
         self.sysrootenv.import_keys()
         logging.info("Keys imported")
 
+        self.xml.add_target_package("libc-bin")
+        self.xml.add_target_package("libc6-dbg")
+        self.xml.add_target_package("gdbserver")
+
         self.install_packages(self.sysrootenv, buildenv=False)
 
         # ignore packages from debootstrap
@@ -300,7 +306,10 @@ class ElbeProject:
         # include /lib if it is a symlink (buster and later)
         if os.path.islink(self.sysrootpath + '/lib'):
             with open(sysrootfilelist, 'a') as filelist_fd:
-                filelist_fd.write('./lib')
+                filelist_fd.write('./lib\n')
+        if os.path.islink(self.sysrootpath + '/sbin'):
+            with open(sysrootfilelist, 'a') as filelist_fd:
+                filelist_fd.write('./sbin\n')
 
         do(
             f"tar cfJ {self.builddir}/sysroot.tar.xz "
-- 
2.43.0



More information about the elbe-devel mailing list