Files
libmali-rockchip/scripts/normalize.sh
Jeffy Chen 6e1c5cbcf5 Refactor for mixed platforms
Major changes:
1/ Allow mixed platforms, e.g. x11-wayland-gbm.
2/ Move extra features, e.g. without-cl, from subversion to platform.
3/ Rename all libraries with GBM API to libmali-*-gbm.so

Change-Id: I9364f8298080788b41c5f3a3cf69aec9a2859ff5
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2022-07-14 17:13:02 +08:00

34 lines
806 B
Bash
Executable File

#!/bin/sh
SONAME=libmali.so.1
LIBS=$(find optimize_*/ -name "*.so")
for lib in $LIBS; do
DEPS=$(readelf -d $lib)
# Hack out-dated deps
for dep in libffi.so.6 libcrypto.so.1.0.0; do
echo $DEPS | grep -wq $dep &&
patchelf $lib --replace-needed $dep ${dep%.so*}.so
done
# Set a common soname
echo $DEPS | grep -q "Library soname: \[$SONAME\]" ||
patchelf --set-soname $SONAME $lib
# Increase .dynsym's sh_info to workaround local symbol warning:
# 'found local symbol in global part of symbol table'
#
# depends on lief (pip3 install lief)
readelf -s $lib 2>&1 | grep -q Warning && \
scripts/fixup_dynsym.py $lib&
# Normalize library name
mv $lib "${lib%/*}/$(scripts/parse_name.sh --format $lib)" 2>/dev/null
done
# Update debian control and rules
scripts/update_debian.sh
wait