!29 Fix secure compile option error in Makefile

From: @ni-yingjun 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
This commit is contained in:
openeuler-ci-bot 2024-07-24 04:22:59 +00:00 committed by Gitee
commit 19b8b83dc0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 37 additions and 1 deletions

View File

@ -2,7 +2,7 @@
Name: dtc
Version: 1.7.0
Release: 2
Release: 3
Summary: Device tree compiler
License: GPLv2+
URL: https://devicetree.org/
@ -16,6 +16,10 @@ Obsoletes: libfdt
Patch1: openEuler-add-secure-compile-option-in-Makefile.patch
Patch2: remove-ldflags-in-cflags.patch
%ifarch ppc64le
Patch3: fix-secure-compile-option-error-in-Makefile.patch
%endif
%description
The devicetree is a data structure for describing hardware. Rather than hard coding
every detail of a device into an operating system, many aspects of the hardware can
@ -92,6 +96,9 @@ export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%doc Documentation/manual.txt
%changelog
* Thu Jul 18 2024 yingjun ni <yingjun.ni@shingroup.cn> - 1.7.0-3
- fix secure compile option error in Makefile
* Fri Jul 14 2023 dillon chen <dillon.chen@gmail.com> - 1.7.0-2
- add clang build from jammyjellyfish PR

View File

@ -0,0 +1,29 @@
From de1f376fd21c7a8f46d67597fca57cfd2be66cd8 Mon Sep 17 00:00:00 2001
From: Yingjun Ni <yingjun.ni@shingroup.cn>
Date: Thu, 18 Jul 2024 10:40:34 +0800
Subject: [PATCH] Fix secure compile option error in Makefile.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
dtc rpm包会生成dtc bin和libfdt.so-fPIE不作用于libfdt.so其他应用(如qemu)调用libfdt.so时会出现段错误使用-fPIC代替-fPIE。
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 5ef6edd..d2124da 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ CONFIG_LOCALVERSION =
# See libfdt_internal.h for details
ASSUME_MASK ?= 0
-EXTRA_CFLAGS += -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fPIE
+EXTRA_CFLAGS += -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fPIC
LDFLAGS += -Wl,-z,now -pie
CPPFLAGS = -I libfdt -I . -DFDT_ASSUME_MASK=$(ASSUME_MASK)
WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs -Wsign-compare \
--
2.43.0