Skip to content

Commit 4e187a0

Browse files
committed
some documentation about building/using the static libs
1 parent d5412ff commit 4e187a0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

scripts/static-build-script.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
#git clone --single-branch --branch benchmarking-static-lib https://github.com/ewasm/hera
3+
# cd hera
4+
# git submodule update --init
5+
6+
mkdir -p build
7+
cd build
8+
cmake -DBUILD_SHARED_LIBS=OFF -DHERA_BINARYEN=ON -DHERA_WABT=ON -DHERA_WAVM=ON -DHERA_DEBUGGING=OFF ..
9+
cmake --build .
10+
11+
cd deps/src/binaryen-build/lib/
12+
for f in *.a; do ar x $f; done
13+
ar r -s -c libbinaryenfull.a *.o
14+
rm *.o
15+
cd ../../../../
16+
17+
18+
cd deps/src/wavm-build/lib
19+
for f in *.a; do ar x $f; done
20+
ar r -s -c libwavm.a *.o
21+
rm *.o
22+
cd ../../../../
23+
24+
# apt-get install llvm-6.0-dev
25+
# llvm .so file is needed for libwavm.a to be usable
26+
27+
# some flags might be unnecessary
28+
#cgo LDFLAGS: /root/hera/build/src/libhera.a -L/root/hera/build/src/ -lhera -L/root/hera/build/deps/src/wabt-build/ -lwabt /root/hera/build/deps/src/binaryen-build/lib/libbinaryenfull.a /root/hera/build/deps/src/wavm-build/lib/libwavm.a -L/usr/lib/llvm-6.0/build/lib/ -lLLVM -rdynamic -lstdc++ -Wl,-unresolved-symbols=ignore-all
29+

0 commit comments

Comments
 (0)