]> code.ossystems Code Review - openembedded-core.git/commitdiff
Add automatic generation of -dbg packages. These contain the debug symbols that are...
authorRichard Purdie <richard@openedhand.com>
Mon, 24 Jul 2006 08:35:37 +0000 (08:35 +0000)
committerRichard Purdie <richard@openedhand.com>
Mon, 24 Jul 2006 08:35:37 +0000 (08:35 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@546 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/classes/package.bbclass
meta/conf/bitbake.conf

index 9edcc1e5edce4b85826a8210790b3e68e022fdb7..63657489567d102e4409306b3ad3811a2b684cce 100644 (file)
@@ -177,8 +177,10 @@ runstrip() {
                        ro=1
                        chmod +w "$1"
                }
+               '${OBJCOPY}' --only-keep-debug "$1" "$1.dbg"
                '${STRIP}' "$1"
                st=$?
+               '${OBJCOPY}' --add-gnu-debuglink="$1.dbg" "$1"
                test -n "$ro" && chmod -w "$1"
                if test $st -ne 0
                then
@@ -249,6 +251,21 @@ python populate_packages () {
                        bb.error("%s is listed in PACKAGES mutliple times. Undefined behaviour will result." % pkg)
                pkgs += pkg
 
+       if (bb.data.getVar('INHIBIT_PACKAGE_STRIP', d, 1) != '1'):
+               stripfunc = ""
+               for root, dirs, files in os.walk(dvar):
+                       for f in files:
+                               file = os.path.join(root, f)
+                               if not os.path.islink(file) and isexec(file):
+                                       stripfunc += "\trunstrip %s || st=1\n" % (file)
+               if not stripfunc == "":
+                       from bb import build
+                       localdata = bb.data.createCopy(d)
+                       # strip
+                       bb.data.setVar('RUNSTRIP', '\tlocal st\n\tst=0\n%s\treturn $st' % stripfunc, localdata)
+                       bb.data.setVarFlag('RUNSTRIP', 'func', 1, localdata)
+                       bb.build.exec_func('RUNSTRIP', localdata)
+
        for pkg in packages.split():
                localdata = bb.data.createCopy(d)
                root = os.path.join(workdir, "install", pkg)
@@ -273,7 +290,6 @@ python populate_packages () {
                bb.mkdirhier(root)
                filesvar = bb.data.getVar('FILES', localdata, 1) or ""
                files = filesvar.split()
-               stripfunc = ""
                for file in files:
                        if os.path.isabs(file):
                                file = '.' + file
@@ -293,17 +309,9 @@ python populate_packages () {
                        fpath = os.path.join(root,file)
                        dpath = os.path.dirname(fpath)
                        bb.mkdirhier(dpath)
-                       if (bb.data.getVar('INHIBIT_PACKAGE_STRIP', d, 1) != '1') and not os.path.islink(file) and isexec(file):
-                               stripfunc += "\trunstrip %s || st=1\n" % fpath
                        ret = bb.movefile(file,fpath)
                        if ret is None or ret == 0:
                                raise bb.build.FuncFailed("File population failed")
-               if not stripfunc == "":
-                       from bb import build
-                       # strip
-                       bb.data.setVar('RUNSTRIP', '\tlocal st\n\tst=0\n%s\treturn $st' % stripfunc, localdata)
-                       bb.data.setVarFlag('RUNSTRIP', 'func', 1, localdata)
-                       bb.build.exec_func('RUNSTRIP', localdata)
                del localdata
        os.chdir(workdir)
 
index 529405a3eb306796911cdfde404ef4f39801e76e..6c15ef71b43cd8245f9cb942283bffebc5e512d1 100644 (file)
@@ -102,7 +102,7 @@ PROVIDES = ""
 PROVIDES_prepend = "${P} ${PF} ${PN} "
 RPROVIDES = ""
 
-PACKAGES = "${PN} ${PN}-doc ${PN}-dev ${PN}-locale"
+PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-dev ${PN}-locale"
 FILES = ""
 FILES_${PN} = "${bindir} ${sbindir} ${libexecdir} ${libdir}/lib*.so.* \
             ${sysconfdir} ${sharedstatedir} ${localstatedir} \
@@ -118,6 +118,8 @@ FILES_${PN}-dev = "${includedir} ${libdir}/lib*.so ${libdir}/*.la \
                 ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig \
                 /lib/*.a /lib/*.o ${datadir}/aclocal"
 FILES_${PN}-locale = "${datadir}/locale"
+FILES_${PN}-dbg = "${bindir}/*.dbg ${sbindir}/*.dbg ${libexecdir}/*.dbg ${libdir}/lib*.so.*.dbg \
+            /bin/*.dbg /sbin/*.dbg /lib/*.so*.dbg ${libdir}/${PN}/*.dbg"
 
 # File manifest
 
@@ -222,6 +224,7 @@ export AR = "${HOST_PREFIX}ar"
 export AS = "${HOST_PREFIX}as"
 export RANLIB = "${HOST_PREFIX}ranlib"
 export STRIP = "${HOST_PREFIX}strip"
+export OBJCOPY = "${HOST_PREFIX}objcopy"
 
 export BUILD_CC = "${CCACHE}${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}"
 export BUILD_CXX = "${CCACHE}${BUILD_PREFIX}g++ ${BUILD_CC_ARCH}"