1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-04 16:48:04 +03:00

[ELF] Do not print out an error of ldd --version

Some `ldd` impls don't support the --version option. We do not
want to show the error message but instead just skip the test
entirely.

https://github.com/rui314/mold/pull/385
This commit is contained in:
Rui Ueyama 2022-03-09 14:53:09 +09:00
parent 37f6ef2081
commit 98edd441ce
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ echo 'int main() {}' | $CC -o $t/exe -xc -
ldd $t/exe | grep -q ld-musl && { echo OK; exit; }
# -static-pie works only with a newer version of glibc
ldd --version | grep -Pq 'Copyright \(C\) 202[2-9]' || { echo skipped; exit; }
ldd --version 2>&1 | grep -Pq 'Copyright \(C\) 202[2-9]' || { echo skipped; exit; }
cat <<EOF | $CC -o $t/a.o -c -xc - -fPIE
#include <stdio.h>

View File

@ -18,7 +18,7 @@ echo 'int main() {}' | $CC -o $t/exe -xc -
ldd $t/exe | grep -q ld-musl && { echo OK; exit; }
# -static-pie works only with a newer version of glibc
ldd --version | grep -Pq 'Copyright \(C\) 202[2-9]' || { echo skipped; exit; }
ldd --version 2>&1 | grep -Pq 'Copyright \(C\) 202[2-9]' || { echo skipped; exit; }
cat <<EOF | $CC -o $t/a.o -c -xc - -fPIC
#include <stdio.h>