mirror of
https://github.com/corda/corda.git
synced 2024-12-30 17:57:02 +00:00
28 lines
601 B
Bash
Executable File
28 lines
601 B
Bash
Executable File
#!/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 |