!15 [sync] PR-14: Add D_FORTIFY_SOURCE compile option

From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2023-09-04 10:32:26 +00:00 committed by Gitee
commit 8f73327d8b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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