From a9f26ac2e2a8eb7dac651d145dfb92f859bd196b Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Tue, 24 Feb 2015 09:02:52 +0100 Subject: [PATCH 1/2] run dwz if we have multiple binary files --- scram-project-build.file | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scram-project-build.file b/scram-project-build.file index 16a709333c5..5b7f1de52db 100755 --- a/scram-project-build.file +++ b/scram-project-build.file @@ -299,7 +299,9 @@ for DIR in $ELF_DIRS $DROP_SYMBOLS_DIRS; do # ELF binaries ELF_BINS=$(file * | grep ELF | cut -d':' -f1) if [ ! -z "$ELF_BINS" ]; then - dwz -m .debug/common-symbols.debug -M common-symbols.debug $ELF_BINS + if [ `echo $ELF_BINS | wc -w` -gt 1 ] ; then + dwz -m .debug/common-symbols.debug -M common-symbols.debug $ELF_BINS + fi echo "$ELF_BINS" | xargs -t -n1 -P%{compiling_processes} -I% sh -c 'objcopy --compress-debug-sections --only-keep-debug % .debug/%.debug; objcopy --strip-debug --add-gnu-debuglink=.debug/%.debug %' fi popd From 7e94bc2d6792cb2938080fa6eb734a7f67e8a8d8 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Tue, 24 Feb 2015 10:49:48 +0100 Subject: [PATCH 2/2] replce `` with $() --- scram-project-build.file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scram-project-build.file b/scram-project-build.file index 5b7f1de52db..bbec7667cec 100755 --- a/scram-project-build.file +++ b/scram-project-build.file @@ -299,7 +299,7 @@ for DIR in $ELF_DIRS $DROP_SYMBOLS_DIRS; do # ELF binaries ELF_BINS=$(file * | grep ELF | cut -d':' -f1) if [ ! -z "$ELF_BINS" ]; then - if [ `echo $ELF_BINS | wc -w` -gt 1 ] ; then + if [ $(echo $ELF_BINS | wc -w) -gt 1 ] ; then dwz -m .debug/common-symbols.debug -M common-symbols.debug $ELF_BINS fi echo "$ELF_BINS" | xargs -t -n1 -P%{compiling_processes} -I% sh -c 'objcopy --compress-debug-sections --only-keep-debug % .debug/%.debug; objcopy --strip-debug --add-gnu-debuglink=.debug/%.debug %'