morningman opened a new issue, #67445: URL: https://github.com/apache/doris/issues/67445
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version master (`ddbaaab1388`) ### What's Wrong? `be/src/storage/index/snii/encoding/crc32c.cpp` tests `SNII_CRC32C_X86` with `#if`, but only defines the macro on x86: ```c #if defined(__x86_64__) || defined(_M_X64) #define SNII_CRC32C_X86 1 #include <cpuid.h> #include <nmmintrin.h> #endif ``` On any non-x86 target the macro is never defined, so the four `#if SNII_CRC32C_X86` sites (lines 105, 239, 253, 268) trip `-Wundef`, which the BE builds with `-Werror`: ``` be/src/storage/index/snii/encoding/crc32c.cpp:105:5: error: 'SNII_CRC32C_X86' is not defined, evaluates to 0 [-Werror,-Wundef] be/src/storage/index/snii/encoding/crc32c.cpp:239:5: error: ... be/src/storage/index/snii/encoding/crc32c.cpp:253:5: error: ... be/src/storage/index/snii/encoding/crc32c.cpp:268:5: error: ... ``` The whole file is wrapped in `#ifdef BE_TEST`, so only unit-test builds compile it. ### What You Expected? `./run-be-ut.sh` builds on aarch64. ### How to Reproduce? On an aarch64 host (Apple Silicon or Linux arm64): ```bash BUILD_TYPE_UT=Debug ./run-be-ut.sh ``` ### Anything Else? **CI does not cover this.** The only aarch64 workflow is `be-ut-mac.yml` (`runs-on: macos-15`), and it builds with `-DMAKE_TEST=OFF`, so nothing under `be/test` is compiled and `BE_TEST` is never defined there. The Linux workflows run on `ubuntu-22.04`/`ubuntu-latest` (x86_64), where the macro is defined. So this only blocks developers building BE unit tests on an arm64 machine. Two equivalent fixes: ```c #if defined(SNII_CRC32C_X86) // or #ifdef ``` or give the macro a value on the other branch: ```c #else #define SNII_CRC32C_X86 0 #endif ``` Found while running BE unit tests for #67366. ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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]
