Skip to content

Commit ced8d4e

Browse files
qzheng527jxiao1
authored andcommitted
Fix missing libraries issue in building Occlum aecs lib
Signed-off-by: Zheng, Qi <huaiqing.zq@antgroup.com>
1 parent 3cf2cf5 commit ced8d4e

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

client/cpp_occlum/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ link_directories(${LIBRARY_OUTPUT_PATH} ${OCCLUM_INSTALLDIR}/lib)
4141
include_directories(${UAL_TOP_DIR}/include/sgx)
4242

4343
# How to use UAL
44-
SET(UAL_LIBS_LINK -lual -lprotobuf -lcurl -lssl -lcrypto)
44+
SET(UAL_LIBS_LINK -lual -lprotobuf -lcurl_static -lssl -lcrypto)
4545
SET(UAL_LIBS_NAME ual)
4646

4747
# Only build the required libraries for aecs_client

client/cpp_occlum/occlum_build_prepare.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ GITGET_GRPC() {
7878
cd $GRPC_SRC_DIR/third_party/cares/cares
7979
git submodule update --init .
8080
git checkout tags/cares-1_15_0
81-
# cd $GRPC_SRC_DIR/third_party/protobuf
82-
# git submodule update --init .
83-
# git checkout tags/v3.21.6
81+
cd $GRPC_SRC_DIR/third_party/protobuf
82+
git submodule update --init .
83+
git checkout tags/v3.21.6
8484
cd $GRPC_SRC_DIR/third_party/abseil-cpp
8585
git submodule update --init .
8686
return 0
@@ -115,13 +115,12 @@ libcurl_build() {
115115
fi
116116
./configure \
117117
--prefix=$INSTALLDIR \
118-
--disable-shared \
119118
--with-openssl \
120119
--without-zlib && \
121120
make -j && make install
122121

123-
# Remove shared curl lib to force doing staticly link in next step
124-
rm -f $INSTALLDIR/lib/libcurl.so*
122+
# Rename static curl lib to force doing staticly link in next step
123+
cp $INSTALLDIR/lib/libcurl.a $INSTALLDIR/lib/libcurl_static.a
125124
}
126125

127126
protobuf_check() {

client/cpp_occlum/occlum_run_aecs_client.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ if [ "$ACTIONS" == "all" -o "$ACTIONS" == "build" ] ; then
4444
--file ${THISDIR}/bom_aecs_client_${OCCLUM_LIBC}.yaml \
4545
--root ./image
4646

47+
# workaround, to be fixed by future Occlum release
48+
cp /lib/x86_64-linux-gnu/libcrypt.so.1 image/opt/occlum/glibc/lib/
49+
4750
new_json="$(jq '.env.default += ["LD_LIBRARY_PATH=/opt/occlum/glibc/lib"]' Occlum.json)" && \
4851
echo "${new_json}" > Occlum.json
4952

0 commit comments

Comments
 (0)