Skip to content

Commit

Permalink
[fix](thirdparty) fix compile error: missing libbrpc.a (apache#11353)
Browse files Browse the repository at this point in the history
fix compile error, add fpic to brpc dependency library
  • Loading branch information
luozenglin authored Jul 31, 2022
1 parent 407a6b5 commit ab7e651
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions thirdparty/build-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ build_protobuf() {
ldflags="-L${TP_LIB_DIR} -static-libstdc++ -static-libgcc -Wl,--undefined=pthread_create"
fi

CXXFLAGS="-O2 -I${TP_INCLUDE_DIR}" \
CXXFLAGS="-fPIC -O2 -I${TP_INCLUDE_DIR}" \
LDFLAGS="${ldflags}" \
./configure --prefix="${TP_INSTALL_DIR}" --disable-shared --enable-static --with-zlib="${TP_INSTALL_DIR}/include"

Expand Down Expand Up @@ -385,8 +385,9 @@ build_glog() {
rm -rf config.*
autoreconf -i

CPPFLAGS="-I${TP_INCLUDE_DIR} -fpermissive" \
CPPFLAGS="-I${TP_INCLUDE_DIR} -fpermissive -fPIC" \
LDFLAGS="-L${TP_LIB_DIR}" \
CFLAGS="-fPIC" \
./configure --prefix="${TP_INSTALL_DIR}" --enable-frame-pointers --disable-shared --enable-static
make -j "${PARALLEL}" && make install
}
Expand Down Expand Up @@ -458,6 +459,7 @@ build_zlib() {

CPPFLAGS="-I${TP_INCLUDE_DIR}" \
LDFLAGS="-L${TP_LIB_DIR}" \
CFLAGS="-fPIC" \
./configure --prefix="${TP_INSTALL_DIR}" --static
make -j "${PARALLEL}" && make install

Expand Down Expand Up @@ -550,7 +552,7 @@ build_hyperscan() {
cd $TP_SOURCE_DIR/$HYPERSCAN_SOURCE
mkdir -p $BUILD_DIR && cd $BUILD_DIR
PATH=$TP_INSTALL_DIR/bin:$PATH ${CMAKE_CMD} -G "${GENERATOR}" -DBUILD_SHARED_LIBS=0 \
-DBOOST_ROOT=$BOOST_SOURCE -DCMAKE_INSTALL_PREFIX=$TP_INSTALL_DIR ..
-DBOOST_ROOT=$BOOST_SOURCE -DCMAKE_INSTALL_PREFIX=$TP_INSTALL_DIR -DBUILD_EXAMPLES=OFF ..
${BUILD_SYSTEM} -j $PARALLEL install
}

Expand Down Expand Up @@ -621,7 +623,7 @@ build_leveldb() {
mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}"
rm -rf CMakeCache.txt CMakeFiles/

"${CMAKE_CMD}" -G "${GENERATOR}" -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" -DLEVELDB_BUILD_BENCHMARKS=OFF \
CXXFLAGS="-fPIC" "${CMAKE_CMD}" -G "${GENERATOR}" -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" -DLEVELDB_BUILD_BENCHMARKS=OFF \
-DLEVELDB_BUILD_TESTS=OFF ..
"${BUILD_SYSTEM}" -j "${PARALLEL}" install
}
Expand Down

0 comments on commit ab7e651

Please sign in to comment.