From 0126fa578c466d1ded28d7e7c04e3743431d4571 Mon Sep 17 00:00:00 2001
From: Sam Thursfield <sam.thursfield@codethink.co.uk>
Date: Thu, 31 Aug 2017 17:13:41 +0000
Subject: gnu-toolchain: Fix debug stripping for cross-builds of stage2

The stage2 elements were all using the default strip-commands which
don't take into account the fact that we might be cross-compiling.
An `objcopy` build for one architecture will ignore binaries for
other architectures that it doesn't understand, so in practice no
stripping was taking place for the stage2 components when we were
doing cross-builds.

With this change, a stage2 sysroot containing just the 'runtime' and
'devel' domains has gone from 889MB to 306MB.
---
 elements/gnu-toolchain/stage2-glibc.bst | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'elements/gnu-toolchain/stage2-glibc.bst')

diff --git a/elements/gnu-toolchain/stage2-glibc.bst b/elements/gnu-toolchain/stage2-glibc.bst
index 8c75e788..fd2c9b88 100644
--- a/elements/gnu-toolchain/stage2-glibc.bst
+++ b/elements/gnu-toolchain/stage2-glibc.bst
@@ -129,3 +129,7 @@ config:
       [ -z $loader ] && ( echo "Bug in stage2-glibc ld.so symlinks" ; exit 1 )
       ln -s "%{prefix}/lib/$loader" "%{install-root}/lib/$loader"
     esac
+
+  strip-commands:
+  - |
+    %{stage2-strip-binaries}
-- 
cgit v1.2.1

