1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-26 21:20:46 +03:00
mold/test/elf/run-clang.sh
Rui Ueyama 2b67afb8a3 Simplify
We no longer use `sold` as a command name.
2024-05-03 15:55:26 +09:00

24 lines
469 B
Bash
Executable File

#!/bin/bash
. $(dirname $0)/common.inc
[ "$CC" = cc ] || skip
# ASAN doesn't work with LD_PRELOAD
nm mold-wrapper.so | grep -q '__[at]san_init' && skip
clang --version >& /dev/null || skip
cat <<'EOF' | $CC -xc -c -o $t/a.o -
#include <stdio.h>
int main() {
printf("Hello\n");
return 0;
}
EOF
LD_PRELOAD=`pwd`/mold-wrapper.so MOLD_PATH=`pwd`/mold \
clang -no-pie -o $t/exe $t/a.o -fuse-ld=/usr/bin/ld
readelf -p .comment $t/exe > $t/log
grep -q mold $t/log