From ff7a37b201729b47871074bec0a6d4c9c9237d8a Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Tue, 20 Aug 2024 10:57:10 +0900 Subject: packaging: Add '-fno-merge-all-constants' build flag for asan The '-fmerge-all-constants' build flag makes asan detect constexpr variable not properly in global data and, so asan reports stack-use-after-scope issue. To remove the asan issue, for asan build, replace the '-fmerge-all-constants' flag with '-fno-merge-all-constants'. Change-Id: I637f3ded3ad049bf967bdc35caa5df52bbd3fd94 Signed-off-by: Seung-Woo Kim --- packaging/libjxl.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packaging/libjxl.spec b/packaging/libjxl.spec index 92af1d7..d09134a 100644 --- a/packaging/libjxl.spec +++ b/packaging/libjxl.spec @@ -44,6 +44,9 @@ Description: JPEG XL encoder and decoder library (tools) cp %{SOURCE1} . %build +%if "%{asan}" == "1" +sed -i 's/-fmerge-all-constants/-fno-merge-all-constants/g' lib/CMakeLists.txt +%endif %cmake . -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=OFF \ %if %{enable_tools} -- cgit v1.2.3