summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-20 08:31:59 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-24 11:52:27 +0100
commitbc6b668e6048950e8449b6ba415ae1c4f682f986 (patch)
tree515cd3f97227036f19b9fe9446513f1a2a900cea /meta
parent0e6a662ba2d03d6339593880b1c21c5455b59316 (diff)
downloadpoky-bc6b668e6048950e8449b6ba415ae1c4f682f986.tar.gz
package: Allow parallel processing of debug splitting
Adjust the code so that the splitting of debug symbols from files happens in parallel. To to this we need to move some path handling code into the main function and pass more parameters in. (From OE-Core rev: 9f0c2ed5d44a16e8268ac521236c4752f930f26a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/package.bbclass24
1 files changed, 13 insertions, 11 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 02914b52bb..03fe18de58 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -367,10 +367,12 @@ def append_source_info(file, sourcefile, d, fatal=True):
367 # of rpm's debugedit, which was writing them out that way, and the code elsewhere 367 # of rpm's debugedit, which was writing them out that way, and the code elsewhere
368 # is still assuming that. 368 # is still assuming that.
369 debuglistoutput = '\0'.join(debugsources) + '\0' 369 debuglistoutput = '\0'.join(debugsources) + '\0'
370 lf = bb.utils.lockfile(sourcefile + ".lock")
370 open(sourcefile, 'a').write(debuglistoutput) 371 open(sourcefile, 'a').write(debuglistoutput)
372 bb.utils.unlockfile(lf)
371 373
372 374
373def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d): 375def splitdebuginfo(file, dvar, debugdir, debuglibdir, debugappend, debugsrcdir, sourcefile, d):
374 # Function to split a single file into two components, one is the stripped 376 # Function to split a single file into two components, one is the stripped
375 # target system binary, the other contains any debugging information. The 377 # target system binary, the other contains any debugging information. The
376 # two files are linked to reference each other. 378 # two files are linked to reference each other.
@@ -379,6 +381,15 @@ def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d):
379 381
380 import stat 382 import stat
381 383
384 src = file[len(dvar):]
385 dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
386 debugfile = dvar + dest
387
388 # Split the file...
389 bb.utils.mkdirhier(os.path.dirname(debugfile))
390 #bb.note("Split %s -> %s" % (file, debugfile))
391 # Only store off the hard link reference if we successfully split!
392
382 dvar = d.getVar('PKGD') 393 dvar = d.getVar('PKGD')
383 objcopy = d.getVar("OBJCOPY") 394 objcopy = d.getVar("OBJCOPY")
384 395
@@ -1046,16 +1057,7 @@ python split_and_strip_files () {
1046 # First lets process debug splitting 1057 # First lets process debug splitting
1047 # 1058 #
1048 if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT') != '1'): 1059 if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT') != '1'):
1049 for file in elffiles: 1060 oe.utils.multiprocess_launch(splitdebuginfo, list(elffiles), d, extraargs=(dvar, debugdir, debuglibdir, debugappend, debugsrcdir, sourcefile, d))
1050 src = file[len(dvar):]
1051 dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
1052 fpath = dvar + dest
1053
1054 # Split the file...
1055 bb.utils.mkdirhier(os.path.dirname(fpath))
1056 #bb.note("Split %s -> %s" % (file, fpath))
1057 # Only store off the hard link reference if we successfully split!
1058 splitdebuginfo(file, fpath, debugsrcdir, sourcefile, d)
1059 1061
1060 if debugsrcdir and not targetos.startswith("mingw"): 1062 if debugsrcdir and not targetos.startswith("mingw"):
1061 for file in staticlibs: 1063 for file in staticlibs: