From 96bf4d9e96bd8c6c0d0be98d22e4ac570d790e73 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Fri, 26 Mar 2021 11:30:11 +0900 Subject: [PATCH] support sanitizer --- gnome-commander.spec | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/gnome-commander.spec b/gnome-commander.spec index ddd046b..05c1a64 100644 --- a/gnome-commander.spec +++ b/gnome-commander.spec @@ -13,6 +13,7 @@ %global update_po 0 %global if_pre 0 +%global use_gcc_strict_sanitize 1 %global use_release 0 %global use_gitbare 1 @@ -22,6 +23,11 @@ %global use_release 1 %endif +%global flagrel %{nil} +%if 0%{?use_gcc_strict_sanitize} >= 1 +%global flagrel %{flagrel}.san +%endif + %if 0%{?use_gitbare} %global gittardate 20210319 %global gittartime 1025 @@ -33,7 +39,7 @@ %global if_pre 1 %endif -%global mainrel 0.1 +%global mainrel 0.1.100 %if 0%{?use_release} >= 1 %global fedorarel %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}} @@ -60,7 +66,7 @@ Name: gnome-commander Version: 1.12 # Downgrade 3 times, sorry... Epoch: 4 -Release: %{fedorarel}%{?dist} +Release: %{fedorarel}%{flagrel}%{?dist} Summary: A nice and fast file manager for the GNOME desktop Summary(pl): Menadżer plików dla GNOME oparty o Norton Commander'a (TM) Summary(sv): GNOME Commander är en snabb och smidig filhanderare för GNOME @@ -80,6 +86,10 @@ Source10: mimeedit-svn%{mimeedit_rev}.sh Patch1: gnome-commander-1.6.0-path-fedora-specific.patch BuildRequires: gcc-c++ +%if 0%{?use_gcc_strict_sanitize} +BuildRequires: libasan +BuildRequires: libubsan +%endif BuildRequires: desktop-file-utils BuildRequires: gettext @@ -211,6 +221,12 @@ popd export PATH=$(pwd)/TMPBINDIR:$PATH export BUILD_TOP_DIR=$(pwd) +%set_build_flags +%if 0%{?use_gcc_strict_sanitize} +export CC="${CC} -fsanitize=address -fsanitize=undefined" +export CXX="${CXX} -fsanitize=address -fsanitize=undefined" +%endif + %if 0%{?use_gitbare} pushd %{name} %endif