CMAKE - Fix ABSL in clang18+ (#106)
Please see:
- https://github.com/abseil/abseil-cpp/issues/1747
- https://github.com/llvm/llvm-project/issues/102443
When GRPC is compiled with different compiler from RDC - ABI broke.
Possibly because some templates were not instantiated.
Setting '-fclang-abi-compat=17' fixes the issue.
Change-Id: Ic6409cf413c87b135f334e5b03145cb1c63356d4
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
[ROCm/rdc commit: a8d479c147]
This commit is contained in:
committad av
GitHub
förälder
c5560793e8
incheckning
b4dd8b40ab
@@ -70,6 +70,7 @@ Below example installs gRPC into `/opt/grpc`
|
||||
-DgRPC_INSTALL=ON \
|
||||
-DgRPC_BUILD_TESTS=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,'$ORIGIN' \
|
||||
-DCMAKE_INSTALL_PREFIX="$GRPC_ROOT" \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
@@ -48,6 +48,16 @@ else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -O0 -DDEBUG")
|
||||
endif()
|
||||
|
||||
# Issue with ABI compatibility and gRPC.
|
||||
# See:
|
||||
# - https://github.com/llvm/llvm-project/issues/102443
|
||||
# - https://github.com/abseil/abseil-cpp/issues/1747
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18.0.0)
|
||||
message("Compiler is " ${CMAKE_CXX_COMPILER_ID} ":" ${CMAKE_CXX_COMPILER_VERSION})
|
||||
message("Applying abi patch...")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fclang-abi-compat=17")
|
||||
endif()
|
||||
|
||||
set(SRC_DIR "src")
|
||||
set(INC_DIR "include/rdc")
|
||||
|
||||
|
||||
Referens i nytt ärende
Block a user