Add D_FORTIFY_SOURCE compile option

(cherry picked from commit 8fa31860176771a0c3ad63d1ed34901724fec41b)
This commit is contained in:
lyn1001 2023-09-04 17:52:10 +08:00 committed by openeuler-sync-bot
parent b646605b84
commit 0aad106fc0
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff -Nur a/buildflags.mak b/buildflags.mak
--- a/buildflags.mak 2018-05-08 03:44:29.000000000 +0800
+++ b/buildflags.mak 2023-09-04 19:15:30.274937794 +0800
@@ -141,7 +141,7 @@
#
# feature test macros for drand48_r
#
-BASECFLAGS += -D_DEFAULT_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
+BASECFLAGS += -D_DEFAULT_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_FORTIFY_SOURCE=2
ifneq (,${HFI_BRAKE_DEBUG})
BASECFLAGS += -DHFI_BRAKE_DEBUG

View File

@ -1,6 +1,6 @@
Name: libpsm2
Version: 10.3.58
Release: 10
Release: 11
Summary: Intel PSM Libraries
License: BSD or GPLv2
URL: https://github.com/01org/opa-psm2/
@ -12,6 +12,7 @@ Patch1: fix-stringop-truncation-build-error.patch
Patch2: Fix-opa-psm2-gcc10.patch
Patch3: Fix-missing-extern.patch
Patch4: Fix-opa-psm2-gcc12-ips_cmpxchg-remove-compile-breaking-bad.patch
Patch5: Add-D_FORTIFY_SOURCE-compile-option.patch
ExclusiveArch: x86_64
BuildRequires: libuuid-devel numactl-devel gcc systemd-udev
@ -76,6 +77,9 @@ rm -f %{buildroot}%{_libdir}/*.a
%{_sysconfdir}/modprobe.d/libpsm2-compat.conf
%changelog
* Mon Sep 4 2023 liyanan <thistleslyn@163.com> - 10.3.58-11
- Add D_FORTIFY_SOURC compile option to solve self-compilation failure problem
* Fri Jul 14 2023 yaoxin <yao_xin001@hoperun.com> - 10.3.58-10
- Fix complication failed due to gcc update to 12.3.1