libsodiumでenclave.soのビルドができない⑥
dockerを一度落としてしまったので、再度やるのだけど、そもそも以下の環境変数の設定って必要?
code:sh
export SODIUM_LIB_DIR=/usr/local/lib/
export SODIUM_SHARED=1
一旦なしでやっていく。
12/3作業開始時点のMakefile
code:Makefile
SGX_SDK_RUST ?= $(HOME)/sgx
ANONIFY_ROOT_DIR := ..
FRAME_ROOT := $(ANONIFY_ROOT_DIR)/frame
CONFIG_DIR := $(ANONIFY_ROOT_DIR)/config
ANONIFY_BIN_DIR := $(ANONIFY_ROOT_DIR)/.anonify
ANONIFY_EDL_DIR := $(ANONIFY_ROOT_DIR)/edl
ANONIFY_BUILD_DIR := $(ANONIFY_ROOT_DIR)/build
SODIUM_ROOT := /root/libsodium-stable/src/libsodium
######## Settings for Circle CI ######
CARGO ?= cargo
BINDGEN ?= bindgen
RUSTFMT ?= rustfmt
######## SGX SDK Settings ########
SGX_SDK ?= /opt/sgxsdk
SGX_MODE ?= HW
SGX_ARCH ?= x64
ifeq ($(TEST), 1)
EDL_FILE := Anonify_test.edl
T_H_FILE := Anonify_test_t.h
T_C_FILE := Anonify_test_t.c
T_O_FILE := Anonify_test_t.o
U_H_FILE := Anonify_test_u.h
U_C_FILE := Anonify_test_u.c
U_O_FILE := Anonify_test_u.o
else
EDL_FILE := Anonify_common.edl
T_H_FILE := Anonify_common_t.h
T_C_FILE := Anonify_common_t.c
T_O_FILE := Anonify_common_t.o
U_H_FILE := Anonify_common_u.h
U_C_FILE := Anonify_common_u.c
U_O_FILE := Anonify_common_u.o
endif
ifeq ($(shell getconf LONG_BIT), 32)
SGX_ARCH := x86
else ifeq ($(findstring -m32, $(CXXFLAGS)), -m32)
SGX_ARCH := x86
endif
ifeq ($(SGX_ARCH), x86)
SGX_COMMON_CFLAGS := -m32
SGX_LIBRARY_PATH := $(SGX_SDK)/lib # /opt/sgxsdk/lib
SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x86/sgx_sign
SGX_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r
else
SGX_COMMON_CFLAGS := -m64
SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x64/sgx_sign
SGX_EDGER8R := $(SGX_SDK)/bin/x64/sgx_edger8r
endif
ifeq ($(DEBUG), 1)
ifeq ($(SGX_PRERELEASE), 1)
$(error Cannot set DEBUG and SGX_PRERELEASE at the same time!!)
endif
endif
ifeq ($(DEBUG), 1)
SGX_COMMON_CFLAGS += -O0 -g
Rust_target_dir := debug
else
SGX_COMMON_CFLAGS += -O2
Host_Rust_Flags := --release
Rust_target_dir := release
endif
Host_Rust_Flags += $(if $(JOBS),-j$(JOBS), )
######## CUSTOM Settings ########
CUSTOM_LIBRARY_PATH := $(ANONIFY_BUILD_DIR)/lib
CUSTOM_EDL_PATH := $(SGX_SDK_RUST)/edl
CUSTOM_COMMON_PATH := $(SGX_SDK_RUST)/common
######## EDL Settings ########
#Enclave_EDL_Files := $(ANONIFY_ENCLAVE_DIR)/$(T_C_FILE) $(ANONIFY_ENCLAVE_DIR)/$(T_H_FILE) $(ANONIFY_HOST_DIR)/$(U_C_FILE) $(ANONIFY_HOST_DIR)/$(U_H_FILE) Enclave_EDL_Files := TEMP_EDL_CONST
######## Enclave Settings ########
ifneq ($(SGX_MODE), HW)
Trts_Library_Name := sgx_trts_sim
Service_Library_Name := sgx_tservice_sim
else
Trts_Library_Name := sgx_trts
Service_Library_Name := sgx_tservice
endif
Crypto_Library_Name := sgx_tcrypto
RustEnclave_Include_Paths := -I$(CUSTOM_COMMON_PATH)/inc -I$(CUSTOM_EDL_PATH) -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport -I$(SGX_SDK)/include/epid -I $(ANONIFY_ENCLAVE_DIR) -I./include
RustEnclave_Link_Libs := -L$(CUSTOM_LIBRARY_PATH) -lenclave -L/usr/local/lib -lsodium
LibSodium_Include_Paths := -I$(SODIUM_ROOT)/include -I$(SODIUM_ROOT)/include/sodium -I$(SODIUM_ROOT)/include/sodium/private -I$(SODIUM_ROOT)/crypto_scalarmult/curve25519/sandy2x
RustEnclave_Compile_Flags := $(SGX_COMMON_CFLAGS) $(LibSodium_Include_Paths) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(RustEnclave_Include_Paths)
RustEnclave_Link_Flags := -Bdynamic $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-Wl,--start-group -lsgx_tstdc -l$(Service_Library_Name) -l$(Crypto_Library_Name) $(RustEnclave_Link_Libs) -Wl,--end-group \
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
-Wl,--defsym,__ImageBase=0 \
-Wl,--gc-sections \
-Wl,--version-script=$(CONFIG_DIR)/Enclave.lds
RustEnclave_Name := $(ANONIFY_BUILD_DIR)/enclave.so
Signed_RustEnclave_Name := $(ANONIFY_BIN_DIR)/enclave.signed.so
Rust_Enclave_Name := libenclave.a
Rust_Enclave_Files := $(wildcard src/*.rs)
LibSodium_Link_Libs := $(SODIUM_ROOT)/crypto_scalarmult/libsodium_la-crypto_scalarmult.o \
$(SODIUM_ROOT)/crypto_scalarmult/curve25519/libsodium_la-scalarmult_curve25519.o \
$(SODIUM_ROOT)/crypto_scalarmult/curve25519/sandy2x/libsodium_la-curve25519_sandy2x.o \
$(SODIUM_ROOT)/crypto_scalarmult/curve25519/sandy2x/libsodium_la-fe_frombytes_sandy2x.o \
$(SODIUM_ROOT)/crypto_scalarmult/curve25519/sandy2x/libsodium_la-fe51_invert.o \
$(SODIUM_ROOT)/crypto_scalarmult/curve25519/sandy2x/libsodium_la-sandy2x.o \
$(SODIUM_ROOT)/crypto_scalarmult/curve25519/ref10/libsodium_la-x25519_ref10.o \
$(SODIUM_ROOT)/crypto_core/ed25519/ref10/libsodium_la-ed25519_ref10.o \
$(SODIUM_ROOT)/sodium/libsodium_la-utils.o
.PHONY: all
all: $(Signed_RustEnclave_Name)
######## EDL Objects ########
$(Enclave_EDL_Files): $(SGX_EDGER8R) $(ANONIFY_EDL_DIR)/$(EDL_FILE)
mkdir -p $(ANONIFY_BUILD_DIR)
$(SGX_EDGER8R) --trusted $(ANONIFY_EDL_DIR)/$(EDL_FILE) --search-path $(SGX_SDK)/include --search-path $(CUSTOM_EDL_PATH) --trusted-dir $(ANONIFY_BUILD_DIR)
$(SGX_EDGER8R) --untrusted $(ANONIFY_EDL_DIR)/$(EDL_FILE) --search-path $(SGX_SDK)/include --search-path $(CUSTOM_EDL_PATH) --untrusted-dir $(ANONIFY_BUILD_DIR)
@echo "GEN => $(Enclave_EDL_Files)"
######## Enclave Objects ########
$(ANONIFY_BUILD_DIR)/$(T_O_FILE): $(Enclave_EDL_Files)
@#$(CC) $(RustEnclave_Compile_Flags) -c /root/libsodium-stable/src/libsodium/crypto_scalarmult/crypto_scalarmult.c -o $(ANONIFY_BUILD_DIR)/crypto_scalarmult.o
@#$(CC) $(RustEnclave_Compile_Flags) -c /root/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c -o $(ANONIFY_BUILD_DIR)/scalarmult_curve25519.o
@$(CC) $(RustEnclave_Compile_Flags) -c $(ANONIFY_BUILD_DIR)/$(T_C_FILE) -o $(ANONIFY_BUILD_DIR)/$(T_O_FILE)
@echo "CC <= $<"
$(Rust_Enclave_Name): $(Rust_Enclave_Files)
@echo "Rust_Enclave_Name <= $(PWD)"
@cd $(ANONIFY_ROOT_DIR)/$(ENCLAVE_DIR) && RUST_LOG=debug cargo build $(CARGO_FLAGS) $(FEATURE_FLAGS)
mkdir -p $(CUSTOM_LIBRARY_PATH)
@cp $(ANONIFY_ROOT_DIR)/target/$(Rust_target_dir)/libanonifyenclave.a $(CUSTOM_LIBRARY_PATH)/libenclave.a
$(RustEnclave_Name): $(Rust_Enclave_Name) $(ANONIFY_BUILD_DIR)/$(T_O_FILE)
@echo "RustEnclave_Link_Flags => $(RustEnclave_Link_Flags)" # -m64 -O0 -g -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L/opt/sgxsdk/lib64 -Wl,--whole-archive -lsgx_trts -Wl,--no-whole-archive -Wl,--start-group -lsgx_tstdc -lsgx_tservice -lsgx_tcrypto -lsodium -L../build/lib -lenclave -Wl,--end-group -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--defsym,__ImageBase=0 -Wl,--gc-sections -Wl,--version-script=../config/Enclave.lds
@#cp $(CUSTOM_LIBRARY_PATH)/libenclave.a ./
@#$(CXX) $^ -o $@ $(RustEnclave_Link_Flags)
@#$(CXX) -o $@ $(RustEnclave_Link_Flags) -l/root/libsodium-stable/src/libsodium/include/sodium /root/libsodium-stable/src/libsodium/crypto_scalarmult/crypto_scalarmult.c $(ANONIFY_BUILD_DIR)/$(T_O_FILE)
@#$(CXX) $(ANONIFY_BUILD_DIR)/crypto_scalarmult.o $(ANONIFY_BUILD_DIR)/scalarmult_curve25519.o $(ANONIFY_BUILD_DIR)/$(T_O_FILE) -o $@ $(RustEnclave_Link_Flags)
@$(CXX) $(LibSodium_Link_Libs) $(ANONIFY_BUILD_DIR)/$(T_O_FILE) -o $@ $(RustEnclave_Link_Flags)
@echo "LINK => $@"
$(Signed_RustEnclave_Name): $(RustEnclave_Name)
mkdir -p $(ANONIFY_BIN_DIR)
@$(SGX_ENCLAVE_SIGNER) sign -key $(CONFIG_DIR)/Test_Enclave_private.pem -enclave $(RustEnclave_Name) -out $@ -config $(CONFIG_DIR)/Enclave.config.xml
@echo "SIGN => $@"
Makefileを戻して一度ビルドしてみる。
code:sh
CC <= ../core/enclave/Anonify_common_t.c
/usr/local/bin/ld: ../build/lib/libenclave.a(libsodium_la-core.o): in function `sodium_crit_enter':
/root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/sodium/core.c:118: undefined reference to `pthread_mutex_lock'
/usr/local/bin/ld: ../build/lib/libenclave.a(libsodium_la-core.o): in function `sodium_crit_leave':
/root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/sodium/core.c:136: undefined reference to `pthread_mutex_unlock'
/usr/local/bin/ld: ../build/lib/libenclave.a(libsodium_la-utils.o): in function `sodium_memzero':
/root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/sodium/utils.c:127: undefined reference to `explicit_bzero'
/usr/local/bin/ld: ../build/lib/libenclave.a(libsodium_la-randombytes_sysrandom.o): in function `safe_read':
/root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:135: undefined reference to `read'
/usr/local/bin/ld: ../build/lib/libenclave.a(libsodium_la-randombytes_sysrandom.o): in function `randombytes_block_on_dev_random':
/root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:158: undefined reference to `open'
/usr/local/bin/ld: /root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:166: undefined reference to `poll'
/usr/local/bin/ld: /root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:169: undefined reference to `close'
/usr/local/bin/ld: /root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:173: undefined reference to `close'
/usr/local/bin/ld: ../build/lib/libenclave.a(libsodium_la-randombytes_sysrandom.o): in function `randombytes_sysrandom_random_dev_open':
/root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:197: undefined reference to `open'
/usr/local/bin/ld: /root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:199: undefined reference to `fstat'
/usr/local/bin/ld: /root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:209: undefined reference to `fcntl'
/usr/local/bin/ld: /root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:209: undefined reference to `fcntl'
/usr/local/bin/ld: /root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:213: undefined reference to `close'
/usr/local/bin/ld: ../build/lib/libenclave.a(libsodium_la-randombytes_sysrandom.o): in function `_randombytes_linux_getrandom':
/root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:233: undefined reference to `getrandom'
/usr/local/bin/ld: ../build/lib/libenclave.a(libsodium_la-randombytes_sysrandom.o): in function `randombytes_sysrandom_close':
/root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c:318: undefined reference to `close'
collect2: error: ld returned 1 exit status
Makefile:138: recipe for target '../build/enclave.so' failed
-lpthreadをつけてみる
code:sh
RustEnclave_Link_Flags := -lpthread $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
→変わらず
む。
code:sodiumoxide/libsodium-sys/build.rs
fn find_libsodium_env() {
let lib_dir = env::var("SODIUM_LIB_DIR").unwrap(); // cannot fail
println!("cargo:rustc-link-search=native={}", lib_dir);
let mode = if env::var("SODIUM_SHARED").is_ok() { // む?SODIUM_SHAREDはunsetしておかないとstaticにならない?
"dylib"
} else {
"static"
};
code:sh
unset SODIUM_SHARED
エラーが出ているやつ
code:sh
libsodium_la-core.o
libsodium_la-randombytes_sysrandom.o
足りないと言われるのはこれら
code:sh
pthread_mutex_lock
pthread_mutex_unlock
explicit_bzero
read
open
poll
close
fstat
fcntl
getrandom
Rustでビルドしたlibsodium_la-core.o
code:sh
root@21341777a65d:~/anonify/scripts# nm /root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/sodium/libsodium_la-core.o
U _GLOBAL_OFFSET_TABLE_
0000000000000000 r __PRETTY_FUNCTION__.4313
U __assert_fail
U _crypto_generichash_blake2b_pick_best_implementation
U _crypto_onetimeauth_poly1305_pick_best_implementation
U _crypto_pwhash_argon2_pick_best_implementation
U _crypto_scalarmult_curve25519_pick_best_implementation
U _crypto_stream_chacha20_pick_best_implementation
U _crypto_stream_salsa20_pick_best_implementation
0000000000000000 b _misuse_handler
U _sodium_alloc_init
0000000000000000 b _sodium_lock
U _sodium_runtime_get_cpu_features
U abort
0000000000000000 b initialized
0000000000000000 b locked
U pthread_mutex_lock
U pthread_mutex_unlock
U randombytes_stir
0000000000000000 T sodium_crit_enter
0000000000000000 T sodium_crit_leave
0000000000000000 T sodium_init
0000000000000000 T sodium_misuse
0000000000000000 T sodium_set_misuse_handler
自分でビルドしたlibsodium_la-core.o
code:sh
root@21341777a65d:~/libsodium-stable/src/libsodium# nm sodium/libsodium_la-core.o
0000000000000000 r .LC0
000000000000000e r .LC1
U _GLOBAL_OFFSET_TABLE_
0000000000000000 r __PRETTY_FUNCTION__.4778
U __assert_fail
U _crypto_generichash_blake2b_pick_best_implementation
U _crypto_onetimeauth_poly1305_pick_best_implementation
U _crypto_pwhash_argon2_pick_best_implementation
U _crypto_scalarmult_curve25519_pick_best_implementation
U _crypto_stream_chacha20_pick_best_implementation
U _crypto_stream_salsa20_pick_best_implementation
0000000000000000 b _misuse_handler
U _sodium_alloc_init
0000000000000020 b _sodium_lock
U _sodium_runtime_get_cpu_features
U abort
000000000000004c b initialized
0000000000000048 b locked
U pthread_mutex_lock
U pthread_mutex_unlock
U randombytes_stir
0000000000000000 T sodium_crit_enter
0000000000000120 T sodium_crit_leave
0000000000000050 T sodium_init
0000000000000150 T sodium_misuse
00000000000001a0 T sodium_set_misuse_handler
Rustでビルドしたlibsodium_la-randombytes_sysrandom.o
code:sh
root@21341777a65d:~/anonify/scripts# nm /root/anonify/target/debug/build/libsodium-sys-fb96fa707666c09b/out/source/libsodium/src/libsodium/randombytes/sysrandom/libsodium_la-randombytes_sysrandom.o
U _GLOBAL_OFFSET_TABLE_
0000000000000000 r __PRETTY_FUNCTION__.4018
0000000000000000 r __PRETTY_FUNCTION__.4047
0000000000000000 r __PRETTY_FUNCTION__.4056
U __assert_fail
U __errno_location
U __stack_chk_fail
0000000000000000 t _randombytes_linux_getrandom
U close
0000000000000000 d devices.4036
U fcntl
U fstat
U getrandom
U open
U poll
0000000000000000 t randombytes_block_on_dev_random
0000000000000000 t randombytes_linux_getrandom
0000000000000000 t randombytes_sysrandom
0000000000000000 t randombytes_sysrandom_buf
0000000000000000 t randombytes_sysrandom_close
0000000000000000 D randombytes_sysrandom_implementation
0000000000000000 t randombytes_sysrandom_implementation_name
0000000000000000 t randombytes_sysrandom_init
0000000000000000 t randombytes_sysrandom_random_dev_open
0000000000000000 t randombytes_sysrandom_stir
0000000000000000 t randombytes_sysrandom_stir_if_needed
U read
0000000000000000 t safe_read
U sodium_misuse
0000000000000000 d stream
自分でビルドしたlibsodium_la-randombytes_sysrandom.o
code:sh
root@21341777a65d:~/libsodium-stable/src/libsodium# nm randombytes/sysrandom/libsodium_la-randombytes_sysrandom.o
0000000000000000 r .LC0
0000000000000000 r .LC1
000000000000000a r .LC2
0000000000000023 r .LC3
000000000000002f r .LC4
0000000000000042 r .LC5
U _GLOBAL_OFFSET_TABLE_
0000000000000000 r __PRETTY_FUNCTION__.4597
0000000000000010 r __PRETTY_FUNCTION__.4635
U __assert_fail
U __errno_location
U __fxstat
U __stack_chk_fail
U close
0000000000000000 d devices.4615
U fcntl
U getrandom
U open
U poll
0000000000000080 t randombytes_linux_getrandom
0000000000000440 t randombytes_sysrandom
0000000000000320 t randombytes_sysrandom_buf
0000000000000010 t randombytes_sysrandom_close
0000000000000020 D randombytes_sysrandom_implementation
0000000000000000 t randombytes_sysrandom_implementation_name
0000000000000110 t randombytes_sysrandom_init
00000000000002f0 t randombytes_sysrandom_stir
U read
U sodium_misuse
0000000000000000 d stream
code:sh
@$(CXX) -Wl,-lpthread $(ANONIFY_BUILD_DIR)/$(T_O_FILE) -o $@ $(RustEnclave_Link_Flags)
にしても、pthread_mutex_lockのundefinedが消えない?
code:sh
root@21341777a65d:~/anonify/scripts# nm -o /lib/* /usr/lib/* /usr/lib/*/* \
/usr/local/lib/* 2> /dev/null | grep 'pthread_mutex_lock$'
/usr/lib/ocaml/libthreads.a:st_stubs_b.o: U pthread_mutex_lock
/usr/lib/ocaml/libthreadsnat.a:st_stubs_n.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libX11.a:locking.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libanl.a:gai_cancel.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libanl.a:gai_misc.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libanl.a:gai_suspend.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libanl.a:getaddrinfo_a.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libboost_thread.a:thread.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libboost_thread.a:once.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:cxa_thread_atexit_impl.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:sdlsym.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:sdlvsym.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:dl-lookup.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:dl-object.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:dl-fini.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:dl-open.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:dl-close.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:tlsdesc.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:dl-iteratephdr.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libc.a:dl-addr.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libcrypt.a:crypt_util.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libcurl.a:libcurl_la-asyn-thread.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libffi.a:closures.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libffi_pic.a:closures.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libglib-2.0.a:libglib_2_0_la-gthread-posix.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libharfbuzz.a:libharfbuzz_la-hb-blob.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libharfbuzz.a:libharfbuzz_la-hb-buffer.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libharfbuzz.a:libharfbuzz_la-hb-common.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libharfbuzz.a:libharfbuzz_la-hb-face.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libharfbuzz.a:libharfbuzz_la-hb-font.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libharfbuzz.a:libharfbuzz_la-hb-set.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libharfbuzz.a:libharfbuzz_la-hb-shape-plan.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libharfbuzz.a:libharfbuzz_la-hb-unicode.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libicuuc.a:umutex.ao: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/liblog4cpp.a:Appender.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/liblog4cpp.a:Category.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/liblog4cpp.a:HierarchyMaintainer.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libnsl.a:ypclnt.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libnsl.a:nis_call.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libnsl.a:nis_callback.o: w __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libpcre.a:libpcre_la-pcre_jit_compile.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libpcre16.a:libpcre16_la-pcre16_jit_compile.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libpcre32.a:libpcre32_la-pcre32_jit_compile.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libprotobuf-lite.a:common.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libprotobuf.a:common.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libpthread.a:pthread_create.o: U __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libpthread.a:pthread_mutex_lock.o:0000000000000670 T __pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libpthread.a:pthread_mutex_lock.o:0000000000000670 W pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/librt.a:aio_cancel.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/librt.a:aio_error.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/librt.a:aio_misc.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/librt.a:aio_suspend.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/librt.a:lio_listio.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/librt.a:timer_create.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/librt.a:timer_delete.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/librt.a:timer_routines.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libxcb.a:xcb_conn.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libxcb.a:xcb_out.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libxcb.a:xcb_in.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libxcb.a:xcb_ext.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libxcb.a:xcb_xid.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libxcb.a:xcb_auth.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libxml2.a:threads.o: w pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libzmq.a:src_libzmq_la-ctx.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libzmq.a:src_libzmq_la-epoll.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libzmq.a:src_libzmq_la-mailbox.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libzmq.a:src_libzmq_la-mailbox_safe.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libzmq.a:src_libzmq_la-pipe.o: U pthread_mutex_lock
/usr/lib/x86_64-linux-gnu/libzmq.a:src_libzmq_la-socket_base.o: U pthread_mutex_lock
/usr/local/lib/libsodium.a:libsodium_la-core.o: U pthread_mutex_lock
root@21341777a65d:~/anonify/scripts# nm -o /lib/* /usr/lib/* /usr/lib/*/* /usr/local/lib/* 2> /dev/null | grep 'pthread_mutex_lock$' | grep T
/usr/lib/x86_64-linux-gnu/libpthread.a:pthread_mutex_lock.o:0000000000000670 T __pthread_mutex_lock
code:sh
@$(CXX) /usr/lib/x86_64-linux-gnu/libpthread.a $(ANONIFY_BUILD_DIR)/$(T_O_FILE) -o $@ $(RustEnclave_Link_Flags)
にしてみたけど、だめか
code:sh
ldconfig
sudoしてもだめ