From f007dec3573221a1b9a013624eb21ae268879caf Mon Sep 17 00:00:00 2001 From: yuncang123 <1050706328@qq.com> Date: Thu, 5 Sep 2024 23:59:05 +0800 Subject: [PATCH] backport and support clang build --- ...ix-missing-underline-in-iscsid_req.h.patch | 25 +++++++++++++++++++ open-iscsi.spec | 13 +++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0029-backport-fix-missing-underline-in-iscsid_req.h.patch diff --git a/0029-backport-fix-missing-underline-in-iscsid_req.h.patch b/0029-backport-fix-missing-underline-in-iscsid_req.h.patch new file mode 100644 index 0000000..d414834 --- /dev/null +++ b/0029-backport-fix-missing-underline-in-iscsid_req.h.patch @@ -0,0 +1,25 @@ +From edf9debf9764eb5173c744d51c42b973a77f636f Mon Sep 17 00:00:00 2001 +From: yuncang123 <1050706328@qq.com> +Date: Thu, 5 Sep 2024 19:45:09 +0800 +Subject: [PATCH] backport fix missing underline in iscsid_req.h + +--- + usr/iscsid_req.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/usr/iscsid_req.h b/usr/iscsid_req.h +index d580ed2..27d58e1 100644 +--- a/usr/iscsid_req.h ++++ b/usr/iscsid_req.h +@@ -19,7 +19,7 @@ + */ + + #ifndef ISCSID_REQ_H_ +-#define ISCSID_REQ_H ++#define ISCSID_REQ_H_ + + #define ISCSID_REQ_TIMEOUT 1000 + +-- +2.43.0 + diff --git a/open-iscsi.spec b/open-iscsi.spec index 7479529..686cc04 100644 --- a/open-iscsi.spec +++ b/open-iscsi.spec @@ -4,7 +4,7 @@ Name: open-iscsi Version: 2.1.5 -Release: 14 +Release: 15 Summary: ISCSI software initiator daemon and utility programs License: GPLv2+ and BSD URL: http://www.open-iscsi.com @@ -37,6 +37,7 @@ patch25: 0025-iscsid-iscsiuio-fix-OOM-adjustment-377.patch patch26: 0026-iscsid-clear-scanning-thread-s-PR_SET_IO_FLUSHER-fla.patch patch27: 0027-iscsid-stop-connection-for-recovery-if-error-is-not-.patch patch28: 0028-discoveryd-fix-format-overflow-warning-413.patch +patch29: 0029-backport-fix-missing-underline-in-iscsid_req.h.patch BuildRequires: flex bison doxygen kmod-devel systemd-units gcc git isns-utils-devel systemd-devel BuildRequires: autoconf automake libtool libmount-devel openssl-devel pkg-config @@ -91,7 +92,14 @@ This contains man files for the using of %{name}. perl -i -pe 's|^exec_prefix = /$|exec_prefix = %{_exec_prefix}|' Makefile %build +%if "%toolchain"=="clang" +CFLAGS="%{optflags} -DUSE_KMOD -fPIC -Wno-error=unused-command-line-argument -Wno-error=ignored-attributes -Wno-error=single-bit-bitfield-constant-conversion -Wno-error=unused-but-set-variable -Wno-error=gnu-variable-sized-type-not-at-end" \ +LDFLAGS="%{?__global_ldflags} -lkmod" \ +LIB_DIR=%{_libdir} +%make_build +%else %make_build OPTFLAGS="%{optflags} %{?__global_ldflags} -DUSE_KMOD -lkmod" LIB_DIR=%{_libdir} +%endif %install @@ -163,6 +171,9 @@ fi %{_mandir}/man8/* %changelog +* Thu Sep 5 2024 yuanchao <1050706328@qq.com> - 2.1.5-15 +- backport(fix missing underline in iscsid_req.h),separate compiler options and linker options,and add -Wno-error options to support clang build + * Tue Feb 20 2024 jiangjianjun - 2.1.5-14 - update open-iscsi.spec -- Gitee