github-actions[bot] commented on code in PR #64241:
URL: https://github.com/apache/doris/pull/64241#discussion_r3408206664


##########
be/CMakeLists.txt:
##########
@@ -761,11 +761,14 @@ endif()
 
 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
     set(ASAN_LIBS -static-libasan)
-    set(LSAN_LIBS -static-liblsan)
-    set(UBSAN_LIBS -static-libubsan ${MALLOCLIB})
+    set(LSAN_LIBS -static-liblsan -lgcc_eh)
+    set(UBSAN_LIBS -static-libubsan -lgcc_eh ${MALLOCLIB})
     set(TSAN_LIBS -static-libtsan)
 else ()
-    set(UBSAN_LIBS -rtlib=compiler-rt ${MALLOCLIB})
+    set(ASAN_LIBS -rtlib=compiler-rt -lgcc_eh)

Review Comment:
   This Clang branch is also used on macOS. `.github/workflows/be-ut-mac.yml` 
runs `./run-be-ut.sh`, and `run-be-ut.sh` defaults `BUILD_TYPE_UT=ASAN` then 
passes `CMAKE_BUILD_TYPE=ASAN_UT`; that path appends `ASAN_LIBS` from here. On 
Darwin there is no `libgcc_eh`, so the macOS BE UT link will fail with a 
missing `gcc_eh` library even though it worked before this change. Please scope 
`-lgcc_eh` to the Linux sanitizer path, or otherwise select a 
platform-appropriate unwind provider for Darwin.



##########
cloud/CMakeLists.txt:
##########
@@ -357,11 +357,14 @@ endif()
 
 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
     set(ASAN_LIBS -static-libasan)
-    set(LSAN_LIBS -static-liblsan)
-    set(UBSAN_LIBS -static-libubsan ${MALLOCLIB})
+    set(LSAN_LIBS -static-liblsan -lgcc_eh)
+    set(UBSAN_LIBS -static-libubsan -lgcc_eh ${MALLOCLIB})
     set(TSAN_LIBS -static-libtsan)
 else ()
-    set(UBSAN_LIBS -rtlib=compiler-rt ${MALLOCLIB})
+    set(ASAN_LIBS -rtlib=compiler-rt -lgcc_eh)

Review Comment:
   Same issue in the Cloud CMake path: this `else()` covers Darwin Clang as 
well as Linux Clang, but `-lgcc_eh` is a Linux/GCC unwind library. 
`cloud/CMakeLists.txt` explicitly has an Apple test path, and local 
`run-cloud-ut.sh` sanitizer builds also use these variables, so Cloud sanitizer 
links on macOS will now fail looking for `gcc_eh`. Please guard `-lgcc_eh` to 
Linux or choose the Darwin unwind/runtime behavior separately.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to