Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.

Commit e32b90d

Browse files
author
Isaac Hier
committed
Try tip from Bazel build to link -lstdc++
Signed-off-by: Isaac Hier <ihier@uber.com>
1 parent c013e48 commit e32b90d

File tree

2 files changed

+7
-26
lines changed

2 files changed

+7
-26
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchain.cmake"
88

99
set(HUNTER_CONFIGURATION_TYPES "Release;Debug" CACHE STRING
1010
"Configuration types used when building Hunter dependencies")
11+
option(HUNTER_KEEP_PACKAGE_SOURCES
12+
"Keep third party sources in Hunter for debugging"
13+
OFF)
1114

1215
include(CMakeDependentOption)
1316
include(HunterGate)

scripts/build-plugin.sh

+4-26
Original file line numberDiff line numberDiff line change
@@ -22,53 +22,31 @@ EOF
2222
cmake -DCMAKE_BUILD_TYPE=Release \
2323
-DCMAKE_INSTALL_PREFIX="${BUILD_DIR}/install" \
2424
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
25-
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--version-script=export.map" \
2625
-DBUILD_SHARED_LIBS=OFF \
2726
-DBUILD_TESTING=OFF \
2827
-DJAEGERTRACING_COVERAGE=OFF \
2928
-DJAEGERTRACING_BUILD_CROSSDOCK=OFF \
3029
-DJAEGERTRACING_WITH_YAML_CPP=ON \
3130
-DHUNTER_CONFIGURATION_TYPES=Release \
31+
-DHUNTER_KEEP_PACKAGE_SOURCES=ON \
3232
..
3333
make -j3
3434
make install
3535

3636
local hunter_install_root_dir
3737
hunter_install_root_dir=$(cat "_3rdParty/Hunter/install-root-dir")
3838

39-
gcc -shared -o libjaegertracing_plugin.so \
39+
gcc -shared -pthread -static-libgcc -static-libstdc++ \
40+
-o libjaegertracing_plugin.so \
4041
-Wl,--version-script=export.map \
4142
-Wl,--whole-archive \
4243
${BUILD_DIR}/install/lib/libjaegertracing.a \
4344
-Wl,--no-whole-archive \
4445
${hunter_install_root_dir}/lib/libopentracing.a \
4546
${hunter_install_root_dir}/lib/libthrift.a \
4647
${hunter_install_root_dir}/lib/libyaml-cpp.a \
47-
-static-libstdc++ -pthread -static-libgcc
48-
(ldd libjaegertracing_plugin.so |
49-
cut -d ' ' -f1 |
50-
sed -e 's/\s\+//g' \
51-
-e 's/lib//g' \
52-
-e 's/\.so\.[0-9]//g' \
53-
-e 's/\/64\///g' |
54-
sort) > ldd-output.txt
55-
cat <<EOF > ldd-expected.txt
56-
c
57-
ld-linux-x86-64
58-
linux-vdso
59-
pthread
60-
EOF
61-
diff ldd-output.txt ldd-expected.txt # Non-zero exits due to set -e above.
48+
-lstdc++
6249
cp libjaegertracing_plugin.so /
63-
64-
git clone https://github.com/opentracing/opentracing-cpp.git
65-
cd opentracing-cpp
66-
mkdir build
67-
cd build
68-
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MOCKTRACER=OFF ..
69-
make -j3
70-
./example/dynamic_load/dynamic_load-example /libjaegertracing_plugin.so \
71-
${project_dir}/examples/config.yml
7250
}
7351

7452
main

0 commit comments

Comments
 (0)