heguanhui opened a new pull request, #64171:
URL: https://github.com/apache/doris/pull/64171
### What problem does this PR solve?
Issue Number: close #64170
Related PR: #xxx
Problem Summary: On aarch64, building Doris BE with LSAN/ASAN/ASAN_UT
sanitizer modes fails during CMake configuration. The OpenBLAS getarch
build-time tool inherits sanitizer flags from the parent CMake context, causing
LeakSanitizer to detect memory leaks in OpenBLAS's detect() function (strdup
without free on aarch64). This makes getarch exit with non-zero code and CMake
configuration fails.
Additionally, -mcmodel=medium (x86_64-specific) leaks into OpenBLAS/FAISS
build context on aarch64, causing compilation failures in UBSAN mode.
Also fix __lsan_ignore_object declaration: previously only enabled under
ADDRESS_SANITIZER, but LEAK_SANITIZER also provides this symbol, so the empty
stub was incorrectly used under LSAN mode causing link errors.
The fix strips sanitizer flags (-fsanitize=*, -fno-sanitize=*,
-fsanitize-ignorelist=*, -D*SANITIZER) and -mcmodel= from CMAKE_C_FLAGS and
CMAKE_CXX_FLAGS in the cmake-protect CMakeLists.txt before building OpenBLAS
and FAISS.
### Release note
None
### Check List (For Author)
- Test
- [ ] Regression test
- [ ] Unit Test
- [x] Manual test (Verified LSAN/ASAN/ASAN_UT BE UT can build and run
successfully on aarch64)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [x] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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]