When building AArch64 code, cpp gets run with the -undef flag which on Fedora 40 with gcc version 14.1.1 20240607 (Red Hat 14.1.1-5) causes __has_builtin to be undefined. When running the check for __builtin_unreachable in Base.h it causes an error "missing binary operator before token "("".
Check that we have __has_builtin before trying to use it.
[ ] Breaking change?
Breaking change - Will this cause a break in build or boot behavior?
Examples: Add a new library class or move a module to a different repo.
[ ] Impacts security?
Security - Does the change have a direct security impact?
Examples: Crypto algorithm change or buffer overflow fix.
[ ] Includes tests?
Tests - Does the change include any explicit test code?
Examples: Unit tests or integration tests.
How This Was Tested
Built code on Fedora Server 40 before and after this change and verified the build now succeeds.
Description
When building AArch64 code, cpp gets run with the
-undef
flag which on Fedora 40 with gcc version 14.1.1 20240607 (Red Hat 14.1.1-5) causes __has_builtin to be undefined. When running the check for __builtin_unreachable in Base.h it causes an error "missing binary operator before token "("".Check that we have __has_builtin before trying to use it.
How This Was Tested
Built code on Fedora Server 40 before and after this change and verified the build now succeeds.
Integration Instructions
N/A