From 5f621325f57235cfd1e1450865c8360f0fd0a1e4 Mon Sep 17 00:00:00 2001 From: shirely16 Date: Sat, 20 Mar 2021 15:49:05 +0800 Subject: [PATCH] slove the problem of security scanning of options Signed-off-by: shirely16 (cherry picked from commit 04125f7411252dc72c830444b8aa2ee3156979d0) --- ...RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch | 80 +++++++++++++++++++ syslinux.spec | 10 ++- 2 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 backport-add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch diff --git a/backport-add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch b/backport-add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch new file mode 100644 index 0000000..9d2f037 --- /dev/null +++ b/backport-add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch @@ -0,0 +1,80 @@ +From 5c24d725d5a5f50f0544fbcc544f08a3f9e90e5d Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 8 Aug 2019 05:41:36 -0400 +Subject: [PATCH] Add 'RPMOPTFLAGS' to CFLAGS for some stuff. + +reason:Add 'RPMOPTFLAGS' to CFLAGS for some stuff + +Conflict:NA +Reference:https://github.com/mer-tools/syslinux/blob/tar_git/rpm/0004-Add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch +--- + extlinux/Makefile | 4 ++-- + linux/Makefile | 4 ++-- + mtools/Makefile | 4 ++-- + utils/Makefile | 4 ++-- + 4 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/extlinux/Makefile b/extlinux/Makefile +index 1721ee54aff..d504e23133e 100644 +--- a/extlinux/Makefile ++++ b/extlinux/Makefile +@@ -18,9 +18,9 @@ include $(MAKEDIR)/syslinux.mk + + OPTFLAGS = -g -Os + INCLUDES = -I$(SRC) -I$(objdir) -I$(SRC)/../libinstaller +-CFLAGS = $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \ ++CFLAGS = $(RPMCFLAGS) $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \ + $(OPTFLAGS) $(INCLUDES) +-LDFLAGS = ++LDFLAGS = $(RPMLDFLAGS) + + SRCS = main.c \ + mountinfo.c \ +diff --git a/linux/Makefile b/linux/Makefile +index 5a49d813de1..9fed68d02c6 100644 +--- a/linux/Makefile ++++ b/linux/Makefile +@@ -18,8 +18,8 @@ include $(MAKEDIR)/syslinux.mk + + OPTFLAGS = -g -Os + INCLUDES = -I$(SRC) -I$(objdir) -I$(SRC)/../libinstaller +-CFLAGS = $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) +-LDFLAGS = ++CFLAGS = $(RPMCFLAGS) $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) ++LDFLAGS = $(RPMLDFLAGS) + + SRCS = syslinux.c \ + ../libinstaller/syslxopt.c \ +diff --git a/mtools/Makefile b/mtools/Makefile +index 632b185ba2f..b6e5ebdba6b 100755 +--- a/mtools/Makefile ++++ b/mtools/Makefile +@@ -2,8 +2,8 @@ include $(MAKEDIR)/syslinux.mk + + OPTFLAGS = -g -Os + INCLUDES = -I$(SRC) -I$(objdir) -I$(SRC)/../libfat -I$(SRC)/../libinstaller +-CFLAGS = $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) +-LDFLAGS = ++CFLAGS = $(RPMCFLAGS) $(GCCWARN) -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES) ++LDFLAGS = $(RPMLDFLAGS) + + SRCS = syslinux.c \ + ../libinstaller/fs.c \ +diff --git a/utils/Makefile b/utils/Makefile +index dfe625902ce..b4962353f20 100644 +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -17,8 +17,8 @@ + VPATH = $(SRC) + include $(MAKEDIR)/syslinux.mk + +-CFLAGS = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC) +-LDFLAGS = -O2 ++CFLAGS = $(RPMCFLAGS) $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC) ++LDFLAGS = $(RPMLDFLAGS) -O2 + + C_TARGETS = isohybrid gethostip memdiskfind + SCRIPT_TARGETS = mkdiskimage +-- +2.21.0 + diff --git a/syslinux.spec b/syslinux.spec index f9e121b..ecf96ed 100644 --- a/syslinux.spec +++ b/syslinux.spec @@ -2,7 +2,7 @@ Name: syslinux Version: 6.04 -Release: 6 +Release: 7 License: GPLv2+ Summary: The Syslinux boot loader collection URL: http://syslinux.zytor.com/wiki/index.php/The_Syslinux_Project @@ -24,6 +24,7 @@ Patch0002: 0002-ext4-64bit-feature.patch Patch0003: 0003-include-sysmacros-h.patch Patch0004: backport-replace-builtin-strlen-that-appears-to-get-optimized.patch +Patch0005: backport-add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch %description The Syslinux Project covers lightweight bootloaders for MS-DOS FAT filesystems (SYSLINUX), @@ -96,8 +97,8 @@ Help document for the syslinux package. %autosetup -n syslinux-6.04-pre1 -p1 %build -make bios clean all -make efi64 clean all +make RPMCFLAGS='%{optflags}' RPMLDFLAGS='%{build_ldflags}' bios clean all +make RPMCFLAGS='%{optflags}' RPMLDFLAGS='%{build_ldflags}' efi64 clean all %install rm -rf %{buildroot} @@ -166,6 +167,9 @@ fi %{_datadir}/doc/syslinux/sample/sample.msg %changelog +* Sat Mar 20 2021 hanhui - 6.04-7 +- slove the problem of security scanning of options + * Sun Feb 7 2021 jinzhimin - 6.04-6 - add patch to replace builtin strlen -- Gitee