Skip to content

Commit c751088

Browse files
committed
fix incorrect libpulsarwithdeps.a
1 parent 643c8c0 commit c751088

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

build-support/merge_archives.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ for ITEM in $ITEMS; do
4545
cd ..
4646
done
4747

48+
rm -f $MERGED_LIBRARY
4849
ar -qc $MERGED_LIBRARY $LIBS
4950

5051

build-support/merge_archives_vcpkg.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,19 @@ if [[ $# -lt 1 ]]; then
2727
fi
2828

2929
CMAKE_BUILD_DIRECTORY=$1
30+
31+
# libprotoc.a is the protobuf compiler (protoc) tool library, not the runtime.
32+
# It pulls in google::protobuf::compiler::java::* and absl debugging/VDSO symbols
33+
# that are not needed by client code and cannot be satisfied without additional deps.
34+
# libprotobuf-lite.a is a subset of libprotobuf.a and causes duplicate symbols.
35+
EXCLUDE_PATTERN="libprotoc.a\|libprotobuf-lite.a"
36+
3037
if [[ $VCPKG_TRIPLET ]]; then
3138
./merge_archives.sh $CMAKE_BUILD_DIRECTORY/libpulsarwithdeps.a \
3239
$CMAKE_BUILD_DIRECTORY/lib/libpulsar.a \
33-
$(find "$CMAKE_BUILD_DIRECTORY/vcpkg_installed/$VCPKG_TRIPLET" -name "*.a" | grep -v debug)
40+
$(find "$CMAKE_BUILD_DIRECTORY/vcpkg_installed/$VCPKG_TRIPLET" -name "*.a" | grep -v '/debug/' | grep -v "$EXCLUDE_PATTERN")
3441
else
3542
./merge_archives.sh $CMAKE_BUILD_DIRECTORY/libpulsarwithdeps.a \
3643
$CMAKE_BUILD_DIRECTORY/lib/libpulsar.a \
37-
$(find "$CMAKE_BUILD_DIRECTORY/vcpkg_installed" -name "*.a" | grep -v debug)
44+
$(find "$CMAKE_BUILD_DIRECTORY/vcpkg_installed" -name "*.a" | grep -v '/debug/' | grep -v "$EXCLUDE_PATTERN")
3845
fi

0 commit comments

Comments
 (0)