Skip to contentSkip to conversation

platform: generic: Enable FW_PIC=y as default

PATCH New [email protected] 2 participants 3 messages Apr 23, 2021 – Apr 27, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform: generic: Enable FW_PIC=y as default

From: Guo Ren <[email protected]>

Tested with qemu_rv32 & rv64, T-HEAD all hardwares. I think it's time to enable it as default.

Thx Vincent's commit: 0f20e8adcf42

---
 platform/generic/config.mk | 1 +
 1 file changed, 1 insertion(+)
platform/generic/config.mk +1 -0
index 8151974..61015a0 100644
@@ -21,6 +21,7 @@ platform-runcmd = qemu-system-riscv$(PLATFORM_RISCV_XLEN) -M virt -m 256M \
 FW_TEXT_START=0x80000000
 FW_DYNAMIC=y
 FW_JUMP=y
+FW_PIC=y
 ifeq ($(PLATFORM_RISCV_XLEN), 32)
   # This needs to be 4MB aligned for 32-bit system
   FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x400000)))
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 platform: generic: Enable FW_PIC=y as default

Quoted 6 lines · On Fri, Apr 23, 2021 at 1:08 PM <[email protected]> wrote:

From: Guo Ren <[email protected]>

Tested with qemu_rv32 & rv64, T-HEAD all hardwares. I think it's time to enable it as default.

Quoted 6 lines

Thx Vincent's commit: 0f20e8adcf42

Enabling FW_PIC by default only for generic platform breaks the compilation binary tarball using scripts/create-binary-archive.sh

I would suggest to have it globally enabled by default using below change. The platform support or users can explicitly disable it using "FW_PIC=n" in make command-line.

firmware/objects.mk +4 -0
index c1f632e..ce91c2f 100644
@@ -13,6 +13,10 @@ firmware-cflags-y +=
 firmware-asflags-y +=
 firmware-ldflags-y +=
 
+ifndef FW_PIC
+FW_PIC := y
+endif
+
 ifeq ($(FW_PIC),y)
 firmware-genflags-y += -DFW_PIC
 firmware-asflags-y  += -fpic

Regards,
Anup

Quoted 19 lines
---
 platform/generic/config.mk | 1 +
 1 file changed, 1 insertion(+)
platform/generic/config.mk +1 -1
index 8151974..61015a0 100644
@@ -21,6 +21,7 @@ platform-runcmd = qemu-system-riscv$(PLATFORM_RISCV_XLEN) -M virt -m 256M \
 FW_TEXT_START=0x80000000
 FW_DYNAMIC=y
 FW_JUMP=y
+FW_PIC=y
 ifeq ($(PLATFORM_RISCV_XLEN), 32)
   # This needs to be 4MB aligned for 32-bit system
   FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x400000)))
--

2.7.4

author
#2 lore raw

PATCH 1/1 platform: generic: Enable FW_PIC=y as default

Quoted 27 lines · Anup Patel
Quoted 6 lines · On Fri, Apr 23, 2021 at 1:08 PM <[email protected]> wrote:

From: Guo Ren <[email protected]>

Tested with qemu_rv32 & rv64, T-HEAD all hardwares. I think it's time to enable it as default.

Quoted 6 lines

Thx Vincent's commit: 0f20e8adcf42

Enabling FW_PIC by default only for generic platform breaks the compilation binary tarball using scripts/create-binary-archive.sh

I would suggest to have it globally enabled by default using below change. The platform support or users can explicitly disable it using "FW_PIC=n" in make command-line.

firmware/objects.mk +0 -0
index c1f632e..ce91c2f 100644

firmware/objects.mk firmware-cflags-y += · line 22

Quoted 10 lines
firmware/objects.mk +4 -0
@@ -13,6 +13,10 @@ firmware-cflags-y +=
 firmware-asflags-y +=
 firmware-ldflags-y +=
 
+ifndef FW_PIC
+FW_PIC := y
+endif
+
 ifeq ($(FW_PIC),y)
 firmware-genflags-y += -DFW_PIC
 firmware-asflags-y  += -fpic

Okay

Quoted 23 lines

Regards,
Anup

Quoted 19 lines
---
 platform/generic/config.mk | 1 +
 1 file changed, 1 insertion(+)
platform/generic/config.mk +1 -1
index 8151974..61015a0 100644
@@ -21,6 +21,7 @@ platform-runcmd = qemu-system-riscv$(PLATFORM_RISCV_XLEN) -M virt -m 256M \
 FW_TEXT_START=0x80000000
 FW_DYNAMIC=y
 FW_JUMP=y
+FW_PIC=y
 ifeq ($(PLATFORM_RISCV_XLEN), 32)
   # This needs to be 4MB aligned for 32-bit system
   FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x400000)))
--

2.7.4

Signature · 4 lines
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/