Description: Link coretest against ykpers library when YubiKey support is enabled
 coretest links the static os library which may contain PWYubi.o referencing
 yk_*/ykp_* symbols (when HAVE_YKPERS_H is set). Unlike the pwsafe target,
 coretest's target_link_libraries did not include ${CMAKE_REQUIRED_LIBRARIES},
 causing undefined references at link time on arm64 (LTO archive extraction).
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: other
Forwarded: not-needed
Last-Update: 2026-10-23

--- passwordsafe-1.22.0+dfsg.orig/src/test/CMakeLists.txt
+++ passwordsafe-1.22.0+dfsg/src/test/CMakeLists.txt
@@ -28,7 +28,7 @@ target_link_libraries(coretest gtest cor
 elseif (APPLE)
 target_link_libraries(coretest gtest core os pthread ${wxWidgets_LIBRARIES} "-framework CoreFoundation" "-framework CoreServices")
 else ()
-target_link_libraries(coretest gtest core os uuid pthread magic ${wxWidgets_LIBRARIES} Xtst X11)
+target_link_libraries(coretest gtest core os uuid pthread magic ${wxWidgets_LIBRARIES} Xtst X11 ${CMAKE_REQUIRED_LIBRARIES})
 endif()
 if (XercesC_LIBRARY)
   target_link_libraries(coretest ${XercesC_LIBRARY})
