Skip to contentSkip to conversation

uboot-tools: add patch to fix (no)stripping on non-ELF platforms

PATCH New Thomas Petazzoni 2 participants 2 messages Aug 27, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uboot-tools: add patch to fix (no)stripping on non-ELF platforms

On Blackfin FLAT, stripping does not exist, but recent U-Boot versions nonetheless try to strip and fail if they cannot do so. This commit adds a U-Boot patch (submitted upstream) that solves this issue.

Fixes:

http://autobuild.buildroot.org/results/153/1530f8247d1652da5779994f298141b1572ce74f/

---
 package/uboot-tools/uboot-tools-02-nostrip.patch | 61 ++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 package/uboot-tools/uboot-tools-02-nostrip.patch
package/uboot-tools/uboot-tools-02-nostrip.patch new file +61 -0
new file mode 100644
index 0000000..7333f41
@@ -0,0 +1,61 @@
+From 17e0d6ddd1dc5d04b8032bde2f2076134b0c6dd7 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Wed, 27 Aug 2014 14:21:32 +0200
+Subject: [PATCH] tools/env: change stripping strategy to allow no-stripping
+
+When building the U-Boot tools for non-ELF platforms (such as Blackfin
+FLAT), since commit 79fc0c5f498c3982aa4740c273ab1a9255063d9c
+("tools/env: cross-compile fw_printenv without setting HOSTCC"), the
+build fails because it tries to strip a FLAT binary, which does not
+make sense.
+
+This commit solves this by changing the stripping logic in
+tools/env/Makefile to be similar to the one in tools/Makefile. This
+logic continues to apply strip to the final binary, but does not abort
+the build if it fails, and does the stripping in place on the final
+binary. This allows the logic to work fine if stripping doesn't work,
+as it leaves the final binary untouched.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+Cc: Masahiro Yamada <[email protected]>
+Cc: Sonic Zhang <[email protected]>
+---
+An improved solution would be to be able to override STRIP completely
+by setting it to /bin/true, but the main Makefile enforces STRIP =
+$(CROSS_COMPILE)strip.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ tools/env/Makefile | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/tools/env/Makefile b/tools/env/Makefile
+index f5368bc..d047aa5 100644
+--- a/tools/env/Makefile
++++ b/tools/env/Makefile
+@@ -21,14 +21,16 @@ HOST_EXTRACFLAGS += -DMTD_OLD
+ endif
+ 
+ always := fw_printenv
+-hostprogs-y := fw_printenv_unstripped
++hostprogs-y := fw_printenv
+ 
+-fw_printenv_unstripped-objs := fw_env.o fw_env_main.o \
++fw_printenv-objs := fw_env.o fw_env_main.o \
+ 	crc32.o ctype.o linux_string.o \
+ 	env_attr.o env_flags.o aes.o
+ 
+-quiet_cmd_strip = STRIP   $@
+-      cmd_strip = $(STRIP) -o $@ $<
++quiet_cmd_crosstools_strip = STRIP   $^
++      cmd_crosstools_strip = $(STRIP) $^; touch $@
+ 
+-$(obj)/fw_printenv: $(obj)/fw_printenv_unstripped FORCE
+-	$(call if_changed,strip)
++$(obj)/.strip: $(obj)/fw_printenv
++	$(call cmd,crosstools_strip)
++
++always += .strip
+-- 
+2.0.0
+
Signature · 1 line
2.0.0
#1 lore raw

PATCH 1/1 uboot-tools: add patch to fix (no)stripping on non-ELF platforms

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

On Blackfin FLAT, stripping does not exist, but recent U-Boot versions nonetheless try to strip and fail if they cannot do so. This commit adds a U-Boot patch (submitted upstream) that solves this issue.

Fixes:

http://autobuild.buildroot.org/results/153/1530f8247d1652da5779994f298141b1572ce74f/

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard