summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package.bbclass29
1 files changed, 23 insertions, 6 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 2053d46395..7dc759699f 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -52,7 +52,8 @@ LOCALE_SECTION ?= ''
52ALL_MULTILIB_PACKAGE_ARCHS = "${@all_multilib_tune_values(d, 'PACKAGE_ARCHS')}" 52ALL_MULTILIB_PACKAGE_ARCHS = "${@all_multilib_tune_values(d, 'PACKAGE_ARCHS')}"
53 53
54# rpm is used for the per-file dependency identification 54# rpm is used for the per-file dependency identification
55PACKAGE_DEPENDS += "rpm-native" 55# dwarfsrcfiles is used to determine the list of debug source files
56PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native"
56 57
57 58
58# If your postinstall can execute at rootfs creation time rather than on 59# If your postinstall can execute at rootfs creation time rather than on
@@ -334,6 +335,16 @@ def checkbuildpath(file, d):
334 335
335 return False 336 return False
336 337
338def parse_debugsources_from_dwarfsrcfiles_output(dwarfsrcfiles_output):
339 debugfiles = {}
340
341 for line in dwarfsrcfiles_output.splitlines():
342 if line.startswith("\t"):
343 debugfiles[os.path.normpath(line.split()[0])] = ""
344
345 return debugfiles.keys()
346
347
337def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d): 348def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d):
338 # Function to split a single file into two components, one is the stripped 349 # Function to split a single file into two components, one is the stripped
339 # target system binary, the other contains any debugging information. The 350 # target system binary, the other contains any debugging information. The
@@ -345,7 +356,6 @@ def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d):
345 356
346 dvar = d.getVar('PKGD') 357 dvar = d.getVar('PKGD')
347 objcopy = d.getVar("OBJCOPY") 358 objcopy = d.getVar("OBJCOPY")
348 debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/debugedit")
349 359
350 # We ignore kernel modules, we don't generate debug info files. 360 # We ignore kernel modules, we don't generate debug info files.
351 if file.find("/lib/modules/") != -1 and file.endswith(".ko"): 361 if file.find("/lib/modules/") != -1 and file.endswith(".ko"):
@@ -359,10 +369,18 @@ def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d):
359 369
360 # We need to extract the debug src information here... 370 # We need to extract the debug src information here...
361 if debugsrcdir: 371 if debugsrcdir:
362 cmd = "'%s' -i -l '%s' '%s'" % (debugedit, sourcefile, file) 372 cmd = "'dwarfsrcfiles' '%s'" % (file)
363 (retval, output) = oe.utils.getstatusoutput(cmd) 373 (retval, output) = oe.utils.getstatusoutput(cmd)
364 if retval: 374 # 255 means a specific file wasn't fully parsed to get the debug file list, which is not a fatal failure
365 bb.fatal("debugedit failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else "")) 375 if retval != 0 and retval != 255:
376 bb.fatal("dwarfsrcfiles failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
377
378 debugsources = parse_debugsources_from_dwarfsrcfiles_output(output)
379 # filenames are null-separated - this is an artefact of the previous use
380 # of rpm's debugedit, which was writing them out that way, and the code elsewhere
381 # is still assuming that.
382 debuglistoutput = '\0'.join(debugsources) + '\0'
383 open(sourcefile, 'a').write(debuglistoutput)
366 384
367 bb.utils.mkdirhier(os.path.dirname(debugfile)) 385 bb.utils.mkdirhier(os.path.dirname(debugfile))
368 386
@@ -393,7 +411,6 @@ def copydebugsources(debugsrcdir, d):
393 dvar = d.getVar('PKGD') 411 dvar = d.getVar('PKGD')
394 strip = d.getVar("STRIP") 412 strip = d.getVar("STRIP")
395 objcopy = d.getVar("OBJCOPY") 413 objcopy = d.getVar("OBJCOPY")
396 debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
397 workdir = d.getVar("WORKDIR") 414 workdir = d.getVar("WORKDIR")
398 workparentdir = os.path.dirname(os.path.dirname(workdir)) 415 workparentdir = os.path.dirname(os.path.dirname(workdir))
399 workbasedir = os.path.basename(os.path.dirname(workdir)) + "/" + os.path.basename(workdir) 416 workbasedir = os.path.basename(os.path.dirname(workdir)) + "/" + os.path.basename(workdir)