From eb1144ea4f09f03d1f18951a44e097d8ba395bf3 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 8 Jul 2024 10:18:20 +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。 (cherry picked from commit ab331cd570d21fd494bb63a81ea9a1c6e958e65c) --- dtc.spec | 11 ++++++- ...ure-compile-option-error-in-Makefile.patch | 30 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 fix-secure-compile-option-error-in-Makefile.patch diff --git a/dtc.spec b/dtc.spec index b3fe97e..314f1d1 100644 --- a/dtc.spec +++ b/dtc.spec @@ -2,7 +2,7 @@ Name: dtc Version: 1.6.1 -Release: 3 +Release: 4 Summary: Device tree compiler License: GPLv2+ URL: https://devicetree.org/ @@ -15,6 +15,9 @@ Obsoletes: libfdt Patch1: openEuler-add-secure-compile-option-in-Makefile.patch +%ifarch ppc64le +Patch2: fix-secure-compile-option-error-in-Makefile.patch +%endif %description The devicetree is a data structure for describing hardware. Rather than hard coding @@ -83,6 +86,12 @@ make install DESTDIR=$RPM_BUILD_ROOT PREFIX=$RPM_BUILD_ROOT/usr \ %doc Documentation/manual.txt %changelog +* Mon Jul 8 2024 fuanan - 1.6.1-4 +- Type: bugfix +- ID: NA +- SUG: NA +- DESC: fix secure compile option error in Makefile + * Thu May 25 2023 fuanan - 1.6.1-3 - Type: bugfix - ID: NA diff --git a/fix-secure-compile-option-error-in-Makefile.patch b/fix-secure-compile-option-error-in-Makefile.patch new file mode 100644 index 0000000..cb5b478 --- /dev/null +++ b/fix-secure-compile-option-error-in-Makefile.patch @@ -0,0 +1,30 @@ +From 5a190c01ddc7b7f8d8eb44595d2b478582463ae9 Mon Sep 17 00:00:00 2001 +From: Yingjun Ni +Date: Mon, 8 Jul 2024 09:57:55 +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 5b72f66..278692d 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 -Wl,-z,now -fPIE ++EXTRA_CFLAGS += -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,now -fPIC + LDFLAGS += -Wl,-z,now -pie + CPPFLAGS = -I libfdt -I . -DFDT_ASSUME_MASK=$(ASSUME_MASK) + WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \ +-- +2.33.0 + -- Gitee