Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/Mk/Scripts/check_have_symbols.sh
16460 views
1
#!/bin/sh
2
3
set -eu
4
5
# the 3 implementations of readelf we can use have different output, but they all have a similarity
6
# for the .gnu.version_d section they all have the symbol version in last element of their output
7
# and have "Name:" or "vda_name": in the 10th position, no other section displayed have this
8
# it means that if there are no symbols exported then nothing matches this search pattern.
9
10
STAGEDIR=$1
11
shift
12
ret=0
13
failed=""
14
for lib; do
15
if ! /usr/bin/readelf -V ${STAGEDIR}$lib | awk 'BEGIN { ret=1 } $10 == "Name:" || $10 == "vda_name:" { ret=0; exit 0 } END { exit ret }'; then
16
ret=1
17
failed="${failed} ${lib}"
18
fi
19
done
20
if [ "$failed" != "" ]; then
21
echo "the following libraries are supposed to have symbols versioning but they don't" >&2
22
for l in ${failed}; do
23
echo "- $l" >&2
24
done
25
fi
26
exit $ret
27
28