OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jessica Clarke <jrtc27@jrtc27.com>
To: opensbi@lists.infradead.org
Subject: [PATCH v4 3/5] firmware: Explicitly pass -pie to the linker, not just the driver
Date: Fri,  9 Jul 2021 20:34:21 +0100	[thread overview]
Message-ID: <20210709193423.29712-4-jrtc27@jrtc27.com> (raw)
In-Reply-To: <20210709193423.29712-1-jrtc27@jrtc27.com>

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



  parent reply	other threads:[~2021-07-09 19:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 19:34 [PATCH v4 0/5] Fully support standalone Clang/LLVM toolchains Jessica Clarke
2021-07-09 19:34 ` [PATCH v4 1/5] fw_base: Don't mark fw_platform_init as both global and weak Jessica Clarke
2021-07-10  2:30   ` Bin Meng
2021-07-09 19:34 ` [PATCH v4 2/5] fw_base: Put data in .data rather than .text Jessica Clarke
2021-07-10  2:52   ` Bin Meng
2021-07-09 19:34 ` Jessica Clarke [this message]
2021-07-10  2:56   ` [PATCH v4 3/5] firmware: Explicitly pass -pie to the linker, not just the driver Bin Meng
2021-07-10  8:53     ` Bin Meng
2021-07-10 10:41       ` Anup Patel
2021-07-10 12:43         ` Bin Meng
2021-07-10 13:38           ` Anup Patel
2021-07-10 13:43             ` Bin Meng
2021-07-10 14:56               ` Anup Patel
2021-07-10 18:07                 ` Xiang W
2021-07-10 18:10                   ` Jessica Clarke
2021-07-10 18:27                     ` Xiang W
2021-07-10 18:34                       ` Jessica Clarke
2021-07-09 19:34 ` [PATCH v4 4/5] Makefile: Support building with Clang and LLVM binutils Jessica Clarke
2021-07-10 13:23   ` Bin Meng
2021-07-11 13:53     ` Bin Meng
2021-07-21  5:49       ` Jessica Clarke
2021-07-21  7:40         ` Bin Meng
2021-07-09 19:34 ` [PATCH v4 5/5] Drop dependency on libgcc by importing part of FreeBSD's libquad Jessica Clarke
2021-07-09 21:00 ` [PATCH v4 0/5] Fully support standalone Clang/LLVM toolchains Jessica Clarke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210709193423.29712-4-jrtc27@jrtc27.com \
    --to=jrtc27@jrtc27.com \
    --cc=opensbi@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox