From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jessica Clarke Date: Fri, 9 Jul 2021 20:34:21 +0100 Subject: [PATCH v4 3/5] firmware: Explicitly pass -pie to the linker, not just the driver In-Reply-To: <20210709193423.29712-1-jrtc27@jrtc27.com> References: <20210709193423.29712-1-jrtc27@jrtc27.com> Message-ID: <20210709193423.29712-4-jrtc27@jrtc27.com> List-Id: To: opensbi@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit When using Clang with a bare-metal triple, -pie does not get passed to the linker as it's not normally a thing that makes sense. However, in our case it is, and manually forwarding it on works as desired, so do so to fully support FW_PIC with Clang, including when linking with LLD. --- firmware/objects.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/objects.mk b/firmware/objects.mk index ce91c2f..3bc83cd 100644 --- a/firmware/objects.mk +++ b/firmware/objects.mk @@ -21,7 +21,7 @@ ifeq ($(FW_PIC),y) firmware-genflags-y += -DFW_PIC firmware-asflags-y += -fpic firmware-cflags-y += -fPIE -pie -firmware-ldflags-y += -Wl,--no-dynamic-linker +firmware-ldflags-y += -Wl,--no-dynamic-linker -Wl,-pie endif ifdef FW_TEXT_START -- 2.31.0