dtc rpm包会生成dtc bin和libfdt.so,-fPIE不作用于libfdt.so,其他应用(如qemu)调用libfdt.so时会出现段错误,使用-fPIC代替-fPIE。
30 lines
1.0 KiB
Diff
30 lines
1.0 KiB
Diff
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
|
||
|