!385 backport upstream patch for fixing building issues with clang for 24.03 SP1

From: @jchzhou 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
This commit is contained in:
openeuler-ci-bot 2024-11-23 07:25:17 +00:00 committed by Gitee
commit 787fa0d076
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 66 additions and 1 deletions

View File

@ -1,7 +1,7 @@
%define _empty_manifest_terminate_build 0
Name: anaconda
Version: 36.16.5
Release: 40
Release: 41
Summary: Graphical system installer
License: GPLv2+ and MIT
URL: http://fedoraproject.org/wiki/Anaconda
@ -53,6 +53,8 @@ Patch6009: backport-Fix-the-systemd-generator-for-systemd-253-2165433.patch
Patch6010: backport-a-riscv64-enablement-patch-from-upstream.patch
# https://github.com/rhinstaller/anaconda/pull/3984
Patch6011: backport-Don-t-unnecessarily-use-cat-and-use-grep-E.patch
# https://github.com/rhinstaller/anaconda/pull/5884
Patch6012: backport-configure-only-append-fanalyzer-when-buildi.patch
Patch9023: bugfix-change-root-and-storage-interface-shows.patch
Patch9024: bugfix-revert-Set-default-entry-to-the-BLS-id-instead-of-the-entry-index.patch
@ -189,6 +191,8 @@ runtime on NFS/HTTP/FTP servers or local disks.
%autosetup -n %{name}-%{version} -p1
%build
rm -rvf ./configure
autoreconf -f -i -v
# use actual build-time release number, not tarball creation time release number
%if "%toolchain" == "clang"
%configure ANACONDA_RELEASE=%{release} CC=clang
@ -320,6 +324,13 @@ update-desktop-database &> /dev/null || :
%{_prefix}/libexec/anaconda/dd_*
%changelog
* Fri Sep 20 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 36.16.5-41
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: backport & adjust upstream patch for fixing building issues with clang
- run autoreconf before building
* Tue Nov 12 2024 zhangpeng <zhangpeng362@huawei.com> - 36.16.5-40
- Type:performance
- ID:NA

View File

@ -0,0 +1,54 @@
From 0cdaa2229fd4855ee61f68cd7f7172f585fb4572 Mon Sep 17 00:00:00 2001
From: jchzhou <zhoujiacheng@iscas.ac.cn>
Date: Thu, 19 Sep 2024 18:16:30 +0800
Subject: [PATCH] configure: only append -fanalyzer when building with gcc
Anaconda fails to build with clang as the compiler doesn't recognize -fanalyzer
introduced experimentally in #3482 for supplementing cppcheck. Only append that
when building with gcc instead.
Signed-off-by: jchzhou <zhoujiacheng@iscas.ac.cn>
---
configure | 6 +++++-
configure.ac | 7 ++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 05e4a1d..53c8ec8 100755
--- a/configure
+++ b/configure
@@ -15536,8 +15536,12 @@ fi
SHUT_UP_GCC="-Wno-unused-result"
# Add remaining compiler flags we want to use
-CFLAGS="$CFLAGS -Wall -Werror $SHUT_UP_GCC -fanalyzer"
+# only append -fanalyzer when building with gcc
+CFLAGS="$CFLAGS -Wall -Werror $SHUT_UP_GCC"
+if [[ "$CC" == "gcc" ]]; then
+ CFLAGS="$CFLAGS -fanalyzer"
+fi
# Perform arch related tests
diff --git a/configure.ac b/configure.ac
index 42cdae6..e515488 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,7 +97,12 @@ ANACONDA_PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.0.4])
SHUT_UP_GCC="-Wno-unused-result"
# Add remaining compiler flags we want to use
-CFLAGS="$CFLAGS -Wall -Werror $SHUT_UP_GCC -fanalyzer"
+# only append -fanalyzer when building with gcc
+CFLAGS="$CFLAGS -Wall -Werror $SHUT_UP_GCC"
+
+if [[ "$CC" == "gcc" ]]; then
+ CFLAGS="$CFLAGS -fanalyzer"
+fi
# Perform arch related tests
--
2.46.1