Skip to content

Commit f5f2e4c

Browse files
committed
ceph.spec.in: set CMAKE_EXE_LINKER_FLAGS to -lstdc++
because the gcc-toolset-13 always links against the `libstdc++_nonshared.a`, which misses the simple symbols. so we have to link against libstdc++ explicitly to assure that the executables have access to them when compiling with the gcc-toolset toolchain. see ``` /opt/rh/gcc-toolset-13/root/usr/bin/c++ -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -rdynamic -pie CMakeFiles/ceph_scratchtool.dir/scratchtool.c.o -o ../../bin/ceph_scratchtool -Wl,-rpath,/home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos9/DIST/centos9/MACHINE_SIZE/gigantic/release/19.0.0-1977-gb0c1f7e8/rpm/el9/BUILD/ceph-19.0.0-1977-gb0c1f7e8/redhat-linux-build/lib: ../../lib/librados.so.2.0.0 ../../lib/libglobal.a ../../lib/libceph-common.so.2 ../../lib/libjson_spirit.a ../../lib/libcommon_utf8.a ../../lib/liberasure_code.a ../../lib/libextblkdev.a -lcap ../../boost/lib/libboost_thread.a ../../boost/lib/libboost_chrono.a ../../boost/lib/libboost_atomic.a ../../boost/lib/libboost_system.a ../../boost/lib/libboost_random.a ../../boost/lib/libboost_program_options.a ../../boost/lib/libboost_date_time.a ../../boost/lib/libboost_iostreams.a ../../boost/lib/libboost_regex.a /usr/lib64/libblkid.so /usr/lib64/libcrypto.so /usr/lib64/libudev.so /usr/lib64/libibverbs.so /usr/lib64/librdmacm.so /usr/lib64/libz.so ../opentelemetry-cpp/sdk/src/trace/libopentelemetry_trace.a ../opentelemetry-cpp/sdk/src/resource/libopentelemetry_resources.a ../opentelemetry-cpp/sdk/src/common/libopentelemetry_common.a ../opentelemetry-cpp/exporters/jaeger/libopentelemetry_exporter_jaeger_trace.a ../opentelemetry-cpp/ext/src/http/client/curl/libopentelemetry_http_client_curl.a /usr/lib64/libcurl.so /usr/lib64/libthrift.so -ldl /usr/lib64/librt.a -lresolv -Wl,--as-needed -latomic /opt/rh/gcc-toolset-13/root/usr/libexec/gcc/x86_64-redhat-linux/13/ld: /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/libstdc++_nonshared.a(ios_init.o): undefined reference to symbol '_ZNSt8ios_base4InitD1Ev@@GLIBCXX_3.4' /opt/rh/gcc-toolset-13/root/usr/libexec/gcc/x86_64-redhat-linux/13/ld: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line ``` this change prepares us for switching to gts-13. Signed-off-by: Kefu Chai <[email protected]>
1 parent c8e37d1 commit f5f2e4c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ceph.spec.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,9 @@ cmake .. \
13751375
%if 0%{?suse_version} == 1500
13761376
-DCMAKE_C_COMPILER=gcc-11 \
13771377
-DCMAKE_CXX_COMPILER=g++-11 \
1378+
%endif
1379+
%if 0%{?gts_version} == 13
1380+
-DCMAKE_EXE_LINKER_FLAGS=-lstdc++ \
13781381
%endif
13791382
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
13801383
-DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \

0 commit comments

Comments
 (0)