diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2024-09-07 14:55:46 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska@appnovation.com> | 2024-09-07 14:55:46 +0000 |
| commit | 1559cbe1ebcea1dac3f5c3a40a51efedd7766ffc (patch) | |
| tree | 8a8d1e0c31e3328c9897c3727a555c693ef8a2fc /glibc/finalize.sh | |
| download | ToolchainFactory-1559cbe1ebcea1dac3f5c3a40a51efedd7766ffc.tar.gz | |
Initial commit
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'glibc/finalize.sh')
| -rwxr-xr-x | glibc/finalize.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/glibc/finalize.sh b/glibc/finalize.sh new file mode 100755 index 0000000..6cdb23b --- /dev/null +++ b/glibc/finalize.sh @@ -0,0 +1,31 @@ +#!/bin/sh -e + +WD=`realpath \`dirname "$0"\`` +cd "$WD" + +what="$1" + +triplet=`cat targets/$what/triplet` +version=`grep ^GCC_VER < ../config | awk '{print $3;}'` +name="${triplet}_${what}" +O="$WD/out/cross/$name" +WO="$WD/out/cross/${what}.tmp" +buildstrip="strip -R .note -R .comment" +targetstrip="$WO/bin/${triplet}-strip -R .note -R .comment" + +for i in "$WO/bin/"* "$WO/libexec/gcc/$triplet/$version/install-tools/fixincl" "$WO/libexec/gcc/$triplet/$version/plugin/"* ; do + $buildstrip "$i" || true +done +for i in `ls -1 "$WO/libexec/gcc/$triplet/$version" | grep -vF -e install-tools -e plugin | grep -v '\.a$' | grep -v '\.la$'` ; do + $buildstrip "$WO/libexec/gcc/$triplet/$version/$i" || true +done +for i in "$WO/$triplet/lib/"*.[oa] "$WO/lib/gcc/$triplet/$version/"*.[oa] ; do + $targetstrip -x "$i" || true +done +for i in `ls -1 "$WO/$triplet/lib" | grep -F .so. | grep -v '\.py$'` ; do + $targetstrip "$WO/$triplet/lib/$i" || true +done + +rm -rf "$WO/share/man" "$O" "${O}-${version}" +mv "$WO" "${O}-${version}" +ln -sf "${name}-${version}" "$O" |
