diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-09 22:11:06 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-09 22:12:39 +0200 |
commit | b1857379c710548b942e5169afe6bb600a49eab6 (patch) | |
tree | d066b0fbe632e25fb8028b54ee0f0dc0641da428 /testing/rust/check-rustc | |
parent | 8dfdf48e6dc99279902c482c33b6f055d9181e9e (diff) | |
download | aports-b1857379c710548b942e5169afe6bb600a49eab6.tar.bz2 aports-b1857379c710548b942e5169afe6bb600a49eab6.tar.xz |
testing/rust: fix check-rustc, dynamic exec *must* have INTERP
Diffstat (limited to 'testing/rust/check-rustc')
-rwxr-xr-x | testing/rust/check-rustc | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/testing/rust/check-rustc b/testing/rust/check-rustc index 015730dc0e..867666e503 100755 --- a/testing/rust/check-rustc +++ b/testing/rust/check-rustc @@ -1,4 +1,5 @@ #!/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" + } } |