From c1533040c4058eed984d889d0734c0d4c886c430 Mon Sep 17 00:00:00 2001 From: garyschulte Date: Thu, 19 Sep 2024 11:26:39 -0700 Subject: [PATCH] link against static libconstantine rather than shared object Signed-off-by: garyschulte --- build.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index eb7241d..e5ff192 100755 --- a/build.sh +++ b/build.sh @@ -362,9 +362,11 @@ build_constantine() { # Compile the native library if [[ "$OSTYPE" == "darwin"* ]]; then - gcc -shared -o "$SCRIPTDIR/constantine/build/${OSARCH}/lib/libconstantinebindings.dylib" jna_ethereum_evm_precompiles.c -Iconstantine/include -I. -Lconstantine/lib/ -lconstantine + # link against the static libconstantine.a so we do not have to deal with multiple libraries in jni/jna: + clang -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/darwin" -shared -o "$SCRIPTDIR/constantine/build/${OSARCH}/lib/libconstantinebindings.dylib" jna_ethereum_evm_precompiles.c -Iconstantine/include -I. constantine/lib/libconstantine.a elif [[ "$OSTYPE" == "linux-gnu"* ]]; then - gcc -fPIC -shared -o "$SCRIPTDIR/constantine/build/${OSARCH}/lib/libconstantinebindings.so" jna_ethereum_evm_precompiles.c -Iconstantine/include -I. -Lconstantine/lib/ constantine/lib/libconstantine.so + # link against the static libconstantine.a so we do not have to deal with multiple libraries in jni/jna: + gcc -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/linux" -fPIC -shared -o "$SCRIPTDIR/constantine/build/${OSARCH}/lib/libconstantinebindings.so" jna_ethereum_evm_precompiles.c -Iconstantine/include -I. -Lconstantine/lib constantine/lib/libconstantine.a else echo "Unsupported OS/architecture: ${OSARCH}" exit 1