[libunwind] Fix -Wunused-function for hasPAuthLR in ra_sign_state_lr (#236660)

hasPAuthLR() is a static function defined unconditionally in
ra_sign_state_lr.pass.cpp but it is only called from checkHasPAuthLR()
when _LIBUNWIND_HAVE_GETAUXVAL, LIBUNWIND_HAVE_ELF_AUX_INFO or
LIBUNWIND_IS_BAREMETAL is defined. On targets where none of these macros
are set (e.g. embedded AArch64 variants built against picolibc), the
#else branch is taken and hasPAuthLR() is unused causing a
-Werror,-Wunused-function build failure.

Guard hasPAuthLR() with the same preprocessor conditions as its
call-sites so it is only compiled when reachable.

Signed-off-by: Naveen <naveen.siddegowda@oss.qualcomm.com>
Co-authored-by: Naveen <naveen.siddegowda@oss.qualcomm.com>
Co-authored-by: Jack Styles <jack.styles@arm.com>
GitOrigin-RevId: 35926b63b5ca9199352cd3ba3183b7206b206281
1 file changed
tree: 60988977ca01e59ab67c00ada4e8348417c93b92
  1. cmake/
  2. docs/
  3. include/
  4. src/
  5. test/
  6. .clang-format
  7. CMakeLists.txt
  8. LICENSE.TXT