From 9c73da714bc61f0b06dbc78a144e087d6affb25e Mon Sep 17 00:00:00 2001 From: milescoviello Date: Thu, 22 Oct 2026 09:22:49 +0000 Subject: [PATCH] fix(build): link the ATRAC9 gradient test with libm atrac9_gradient_tests is a C program linked against the static atrac9 library, whose band_extension.c calls pow. The test never listed libm. The default Linux build links tests statically with --gc-sections, which drops the unreferenced band extension code before pow has to resolve, so the missing library went unnoticed. A shared link, as in an ANYPS5_ENABLE_ASAN build, resolves symbols before collecting sections: ld finds pow only in the libm.so.6 that libasan pulls in and stops with "DSO missing from command line", so the test is never built and ctest reports it as not run. Link libm outside Windows, as atrac9_config_data_tests next to it already does. Co-Authored-By: Claude Opus 5.5 --- core/libs/prx/libSceAjm.native/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/libs/prx/libSceAjm.native/CMakeLists.txt b/core/libs/prx/libSceAjm.native/CMakeLists.txt index 20f6cf1f20..5dbf8f7d66 100644 --- a/core/libs/prx/libSceAjm.native/CMakeLists.txt +++ b/core/libs/prx/libSceAjm.native/CMakeLists.txt @@ -36,6 +36,9 @@ if(BUILD_TESTING) add_test_executable(atrac9_gradient_tests tests/Atrac9Gradient.c ${LIBATRAC9_DIR}/bit_reader.c) target_include_directories(atrac9_gradient_tests PRIVATE ${LIBATRAC9_PATCHED_DIR} ${LIBATRAC9_DIR}) target_link_libraries(atrac9_gradient_tests PRIVATE atrac9) + if(NOT WIN32) + target_link_libraries(atrac9_gradient_tests PRIVATE m) + endif() target_compile_options(atrac9_gradient_tests PRIVATE -ffunction-sections -fdata-sections) if(APPLE) target_link_options(atrac9_gradient_tests PRIVATE LINKER:-dead_strip)