mirror of
https://github.com/corda/corda.git
synced 2025-01-01 10:46:46 +00:00
28 lines
601 B
Bash
28 lines
601 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
# Pipe the output of make when stubsyms.cpp is empty to this script:
|
||
|
#
|
||
|
# sgx-experiments/enclave$ make 2>&1 | ../enclave/gen-stubsyms.sh
|
||
|
|
||
|
workdir=`pwd`/../enclave
|
||
|
o=$workdir/stubsyms.cpp
|
||
|
|
||
|
grep "undefined reference to" | tr -d "'"'`' | grep -o '[^ ]*$' | sort | uniq >$workdir/stubsyms.txt
|
||
|
|
||
|
cat <<EOF >$o
|
||
|
// Generated by gen-stubsyms.sh
|
||
|
|
||
|
extern "C" {
|
||
|
|
||
|
extern void debug_print(const char *str);
|
||
|
extern void abort();
|
||
|
|
||
|
#define STUB(x) void x() { debug_print(#x); abort(); }
|
||
|
|
||
|
EOF
|
||
|
|
||
|
cat $workdir/stubsyms.txt | while read; do
|
||
|
echo "STUB($REPLY)" >>$o
|
||
|
done
|
||
|
|
||
|
echo "} // extern C" >>$o
|