forked from M-Labs/nac3
standalone: link externfns at runtime
This commit is contained in:
parent
b667b4ade0
commit
7ec36e80f7
@ -42,11 +42,14 @@ done
|
||||
|
||||
if [ -n "$debug" ] && [ -e ../../target/debug/nac3standalone ]; then
|
||||
nac3standalone=../../target/debug/nac3standalone
|
||||
externfns=../../target/debug/deps/libexternfns.so
|
||||
elif [ -e ../../target/release/nac3standalone ]; then
|
||||
nac3standalone=../../target/release/nac3standalone
|
||||
externfns=../../target/release/deps/libexternfns.so
|
||||
else
|
||||
# used by Nix builds
|
||||
nac3standalone=../../target/x86_64-unknown-linux-gnu/release/nac3standalone
|
||||
externfns=../../target/x86_64-unknown-linux-gnu/release/deps/libexternfns.so
|
||||
fi
|
||||
|
||||
rm -f ./*.o ./*.bc demo
|
||||
@ -54,7 +57,7 @@ if [ -z "$use_lli" ]; then
|
||||
$nac3standalone "${nac3args[@]}"
|
||||
|
||||
clang -c -std=gnu11 -Wall -Wextra -O3 -o demo.o demo.c
|
||||
clang -lm -o demo module.o demo.o
|
||||
clang -lm -o demo module.o demo.o $externfns
|
||||
|
||||
if [ -z "$outfile" ]; then
|
||||
./demo
|
||||
@ -71,8 +74,8 @@ else
|
||||
shopt -u nullglob
|
||||
|
||||
if [ -z "$outfile" ]; then
|
||||
lli --extra-module demo.bc --extra-module irrt.bc nac3out.bc
|
||||
lli -load=$externfns --extra-module demo.bc --extra-module irrt.bc nac3out.bc
|
||||
else
|
||||
lli --extra-module demo.bc --extra-module irrt.bc nac3out.bc > "$outfile"
|
||||
lli -load=$externfns --extra-module demo.bc --extra-module irrt.bc nac3out.bc > "$outfile"
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user