Commit b1857379 authored by Jakub Jirutka's avatar Jakub Jirutka

testing/rust: fix check-rustc, dynamic exec *must* have INTERP

parent 8dfdf48e
......@@ -191,4 +191,4 @@ f436fddf7ab70ca5f1424081f5b75450270b200b3d997231323863e11addf76e1d65831a7ca09e3a
19cc2725d68db3e359e0e3016028374e5818a97fdba24d0103f7d1706601c8b17c4dd95a3152e64f982f98e95ad3e949acddbea8a39ed0ba8dd4f702acc2704d move-py-scripts-to-share.patch
8d6206f8c50856724cf7b4c1854ec82547f040358a1c7d44abeacc27a5c205a963b1fec51e58ec06c68d85bd2f68a9e6e27ebe457f39e8dd043de17758f5063f change-rpath-to-rustlib.patch
a330fa913faeadb98cb95e644f434ddef4fbbea32bcd11b6621fb9e08f7b0d8c71fae702207465489af3cf793eade0af694a8c515fc1bed49624da25103a4862 fix-jemalloc-musl.patch
770cf8d2d3d55647ba551ae98314af6b6c09e5994cfae0c2ef7ee05ccbf8efa05308887d61a017ab53dee18723db3a5177ce145e43af20326cf156dd2bd0e360 check-rustc"
74911ab235e64ad297778786943f54cee397dfd7d199264f0aaea39f17942c03620047fa6ebe2c91d80713670c53c1a0474f2a55c1879e1982c4a0cdda7b0fbb check-rustc"
#!/bin/sh
# vim: set ts=4:
set -eu
RUSTC="$1"
......@@ -21,17 +22,12 @@ fail() {
failed=$(( failed + 1 ))
}
# Checks if the given file is a statically linked binary.
is_static() {
! readelf -l "$1" | grep -Fq INTERP \
&& ! readelf -d "$1" | grep -Fq NEEDED
}
assert_dynamic() {
test -f "$1" && ! is_static "$1" || {
fail "$1 is not a dynamic executable!"
readelf -ld "$1"
}
readelf -l "$1" | grep -Fqw INTERP \
&& readelf -d "$1" | grep -Fqw NEEDED || {
fail "$1 is not a dynamic executable!"
readelf -ld "$1"
}
}
assert_ok() {
......@@ -39,17 +35,19 @@ assert_ok() {
}
assert_pie() {
readelf -d "$1" | grep FLAGS_1 | grep -q PIE || {
readelf -d "$1" | grep -Fw FLAGS_1 | grep -Fqw PIE || {
fail "$1 is not a PIE executable!"
readelf -d "$1"
}
}
assert_static() {
test -f "$1" && is_static "$1" || {
fail "$1 is not a static executable!"
readelf -ld "$1"
}
test -f "$1" \
&& ! readelf -l "$1" | grep -Fqw INTERP \
&& ! readelf -d "$1" | grep -Fqw NEEDED || {
fail "$1 is not a static executable!"
readelf -ld "$1"
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment