diff options
author | Felix Fietkau <nbd@nbd.name> | 2021-02-15 17:49:46 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-02-15 18:47:21 +0100 |
commit | 075fa4cd9ae2ee5e9715fad2f70b2092ddc9ac2d (patch) | |
tree | b7209cf91bf7c0313a83b17d1cac06e084cd394f /scripts | |
parent | 26a899e3e84199db9e2807d6584e5fd6e11a702c (diff) | |
download | upstream-075fa4cd9ae2ee5e9715fad2f70b2092ddc9ac2d.tar.gz upstream-075fa4cd9ae2ee5e9715fad2f70b2092ddc9ac2d.tar.bz2 upstream-075fa4cd9ae2ee5e9715fad2f70b2092ddc9ac2d.zip |
Mostly revert "build: add support for fixing up library soname"
This reverts commit b12288fa69b171f7c9405518c9bed3581a06f7ce.
The patchelf approach is too fragile, and the only users of this have been
converted to make patching unnecessary
Leave the abi_version_str variable in place in rules.mk
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/set-abi-version.sh | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/scripts/set-abi-version.sh b/scripts/set-abi-version.sh deleted file mode 100755 index a61c842c6d..0000000000 --- a/scripts/set-abi-version.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (C) 2020 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -SELF=${0##*/} - -[ -n "$PATCHELF" ] || { - echo "$SELF: patchelf command not defined (PATCHELF variable not set)" - exit 1 -} - -ABI_VER="$1" -PATCH_DIR="$2" -REF_LIST="$3" - -[ -n "$ABI_VER" -a -n "$PATCH_DIR" ] || { - echo "$SELF: no ABI version or files/directories specified" - echo "usage: $SELF <VERSION> [<PATH>...]" - exit 1 -} - -cmd() { - echo "$@" >&2 - "$@" || exit 1 -} - -gen_lib_list() { - while read F; do - F="${F##*/}" - case "$F" in - lib*.so*);; - *) continue;; - esac - echo -n "$F:" - done < "$REF_LIST" -} - -find "$PATCH_DIR" -type f -a -name 'lib*.so*' | \ -( - while read F; do - NEW_F="${F%%.so*}.so.$ABI_VER" - NEW_NAME="${NEW_F##*/}" - [ "$NEW_F" != "$F" ] || continue - cmd mv "$F" "$NEW_F" - [ "$REF_LIST" ] || cmd ln -s "$NEW_NAME" "$F" - cmd $PATCHELF --set-soname "$NEW_NAME" "$NEW_F" - done -) - -[ -n "$REF_LIST" ] || exit 0 - -LIBS="$(gen_lib_list)" -LIBS="${LIBS%%:}" -find "$PATCH_DIR" -type f -a -exec file {} \; | \ - sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared object\).*,.*/\1:\2/p' | \ -( - IFS=":" - while read F S; do - $PATCHELF --print-needed "$F" | while read L; do - BASE_L="${L%%.so*}" - for lib in $LIBS; do - base_lib="${lib%%.so*}" - [ "$BASE_L" = "$base_lib" ] || continue - [ "$l" = "$lib" ] && continue - cmd $PATCHELF --replace-needed "$L" "$lib" "$F" - done - done - done - true -) |