pdbg: add patch fixing the build on Blackfin
PATCH 1/1 pdbg: add patch fixing the build on Blackfin
This commit adds a patch to pdbg that fixes the build on the Blackfin architecture. The build failure was due to the recently introduced assembly code to embed the DTB into an object file. This code was not taking into account the fact that Blackfin has a non-empty __USER_LABEL_PREFIX__.
The patch has been submitted upstream.
Fixes:
http://autobuild.buildroot.net/results/2bf6f56303453fd2ba7e86882168d406ded4cc80/
--- ...fix-to-build-on-architecture-with-non-emp.patch | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 package/pdbg/0001-template.S-fix-to-build-on-architecture-with-non-emp.patch
package/pdbg/0001-template.S-fix-to-build-on-architecture-with-non-emp.patch new file +63 -0
@@ -0,0 +1,63 @@ +From 50ae93273376ede704012030009c29bd58d6a569 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni <[email protected]> +Date: Sun, 26 Nov 2017 16:22:25 +0100 +Subject: [PATCH] template.S: fix to build on architecture with non-empty + __USER_LABEL_PREFIX__ + +Blackfin has a non-empty __USER_LABEL_PREFIX__, which means that a +symbol called "foo" in C must be named "_foo" in assembler. + +Interestingly, it seems like "$(CC) -xassembler - -c" doesn't pass the +input source file through the C preprocessor, so we do this +explicitly. + +Submitted-upstream: https://github.com/open-power/pdbg/pull/26 +Signed-off-by: Thomas Petazzoni <[email protected]> +--- + Makefile.am | 2 +- + template.S | 22 +++++++++++++++------- + 2 files changed, 16 insertions(+), 8 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 9d34bff..82e0856 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -62,4 +62,4 @@ p9z-fsi.dtb.o: p9z-fsi.dts p9-fsi.dtsi + %.dtb.o: %.dts + dtc -i$(dir $@) -I dts $< -O dtb > [email protected] + symbol_prefix=`echo $@ | tr '.-' '_'` ; \ +- sed "s%SYMBOL_PREFIX%$${symbol_prefix}%g; s%FILENAME%[email protected]%g" $(top_srcdir)/template.S | $(CC) -xassembler - -c -o $@ ++ sed "s%SYMBOL_PREFIX%$${symbol_prefix}%g; s%FILENAME%[email protected]%g" $(top_srcdir)/template.S | $(CPP) - | $(CC) -xassembler - -c -o $@ +diff --git a/template.S b/template.S +index 2e6cbdb..1407a7c 100644 +--- a/template.S ++++ b/template.S +@@ -1,10 +1,18 @@ ++#ifdef __USER_LABEL_PREFIX__ ++#define CONCAT1(a, b) CONCAT2(a, b) ++#define CONCAT2(a, b) a ## b ++#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) ++#else ++#define SYM(x) x ++#endif ++ + .section .data +-_binary_SYMBOL_PREFIX_start: ++SYM(_binary_SYMBOL_PREFIX_start): + .incbin "FILENAME" + .align 4 +-_binary_SYMBOL_PREFIX_end: +-_binary_SYMBOL_PREFIX_size: +- .long _binary_SYMBOL_PREFIX_end - _binary_SYMBOL_PREFIX_start +-.globl _binary_SYMBOL_PREFIX_start +-.globl _binary_SYMBOL_PREFIX_end +-.globl _binary_SYMBOL_PREFIX_size ++SYM(_binary_SYMBOL_PREFIX_end): ++SYM(_binary_SYMBOL_PREFIX_size): ++ .long SYM(_binary_SYMBOL_PREFIX_end) - SYM(_binary_SYMBOL_PREFIX_start) ++.globl SYM(_binary_SYMBOL_PREFIX_start) ++.globl SYM(_binary_SYMBOL_PREFIX_end) ++.globl SYM(_binary_SYMBOL_PREFIX_size) +-- +2.13.6 +
Signature · 1 line
2.13.6
Thomas Petazzoni
AppliedPATCH 1/1 pdbg: add patch fixing the build on Blackfin
Hello,
Quoted 10 lines · Thomas Petazzoni
This commit adds a patch to pdbg that fixes the build on the Blackfin architecture. The build failure was due to the recently introduced assembly code to embed the DTB into an object file. This code was not taking into account the fact that Blackfin has a non-empty
__USER_LABEL_PREFIX__.The patch has been submitted upstream.
Fixes:
Quoted 7 lines
http://autobuild.buildroot.net/results/2bf6f56303453fd2ba7e86882168d406ded4cc80/
Signed-off-by Thomas Petazzoni <[email protected]>--- ...fix-to-build-on-architecture-with-non-emp.patch | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 package/pdbg/0001-template.S-fix-to-build-on-architecture-with-non-emp.patch
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com