diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-12-05 11:14:38 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-12-21 12:23:24 +0100 |
commit | 1fd409d8acc795a80ef4f8ec8edbda694707ef41 (patch) | |
tree | c2825644102be3486f6b55f8d42d7b3faee75289 /src/compilers/gcc-13-musl-static.TARGETS | |
parent | ee44c27d7161976ccccf893ba3f889b533080347 (diff) | |
download | bootstrappable-toolchain-1fd409d8acc795a80ef4f8ec8edbda694707ef41.tar.gz |
gcc-musl: Fix stripping of binaries and libs
... by using a single strip tool (for host) that supports
all target types.
Diffstat (limited to 'src/compilers/gcc-13-musl-static.TARGETS')
-rw-r--r-- | src/compilers/gcc-13-musl-static.TARGETS | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/compilers/gcc-13-musl-static.TARGETS b/src/compilers/gcc-13-musl-static.TARGETS index 4193ae8..6f7ee9c 100644 --- a/src/compilers/gcc-13-musl-static.TARGETS +++ b/src/compilers/gcc-13-musl-static.TARGETS @@ -28,9 +28,20 @@ , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"] , "target": "libgcc_s" } +, "strip_for_host": + { "type": "configure" + , "arguments_config": ["ARCH"] + , "config": + { "type": "singleton_map" + , "key": "TARGET_ARCH" + , "value": {"type": "var", "name": "ARCH"} + } + , "target": ["@", "binutils", "", "multi-target strip"] + } , "gcc-musl-static": { "type": ["@", "rules", "CC/foreign/shell", "data"] , "project": [["@", "gcc-musl", "", "combined_patched_sources"]] + , "localbase": ["strip_for_host"] , "arguments_config": ["BUILD_ARCH"] , "cmds": { "type": "let*" @@ -72,11 +83,11 @@ , "${MAKE} -j${NJOBS} TARGET=${TARGET} CC=${TMPDIR}/cc CXX=${TMPDIR}/c++ LDFLAGS='-static' LDFLAGS_FOR_TARGET='-static' >build.log 2>&1 || (cat build.log && exit 1)" , "${MAKE} -j${NJOBS} TARGET=${TARGET} CC=${TMPDIR}/cc CXX=${TMPDIR}/c++ LDFLAGS='-static' LDFLAGS_FOR_TARGET='-static' OUTPUT= DESTDIR=${DESTDIR} install >>build.log 2>&1 || (cat build.log && exit 1)" , "cd ${DESTDIR}" - , "TARGET_STRIP=./bin/${TARGET}-strip" - , "find ./bin/ ./${TARGET}/bin/ ./libexec/gcc/ -type f -exec sh -c \"strip {} 2>/dev/null\" \\;" - , "find . -type f -name '*.so*' -exec sh -c \"${TARGET_STRIP} {} 2>/dev/null\" \\;" - , "find . -type f -name '*.a' -exec sh -c \"${TARGET_STRIP} -g {}\" \\;" - , "find . -type f -name '*.o' -exec sh -c \"${TARGET_STRIP} -g {}\" \\;" + , "STRIP=${LOCALBASE}/bin/strip" + , "find ./bin/ ./${TARGET}/bin/ ./libexec/gcc/ -type f -exec sh -c \"${STRIP} {} 2>/dev/null\" \\;" + , "find . -type f -name '*.so*' -exec sh -c \"${STRIP} {} 2>/dev/null\" \\;" + , "find . -type f -name '*.a' -exec sh -c \"${STRIP} -g {} 2>/dev/null\" \\;" + , "find . -type f -name '*.o' -exec sh -c \"${STRIP} -g {} 2>/dev/null\" \\;" , "for f in $(ls ./bin/${TARGET}-*); do" , " ln -s $(basename $f) $(echo $f | sed 's|/'${TARGET}-'|/|g')" , "done" |