public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: add static-pie support
@ 2023-10-09 12:52 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-10-09 12:52 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ce77db5fdbcc33c566662da880ae2cba601194c9

commit ce77db5fdbcc33c566662da880ae2cba601194c9
Author: Yanzhang Wang <yanzhang.wang@intel.com>
Date:   Sat Oct 7 19:32:25 2023 +0800

    RISC-V: add static-pie support
    
    We only need to pass options to the linker when static-pie is passed.
    There's another patch to enable static-pie in glibc. And we need to
    enable in GCC first.
    
    gcc/ChangeLog:
    
            * config/riscv/linux.h: Pass the static-pie specific options to
            the linker.
    
    Signed-off-by: Yanzhang Wang <yanzhang.wang@intel.com>
    (cherry picked from commit b20e59f49b51b7baf05e1b727be5da947e617496)

Diff:
---
 gcc/config/riscv/linux.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 7323ff30f70..8901671ddf6 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -55,9 +55,10 @@ along with GCC; see the file COPYING3.  If not see
 %{shared} \
   %{!shared: \
     %{!static: \
-      %{rdynamic:-export-dynamic} \
-      -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
-    %{static:-static}}"
+      %{!static-pie: \
+	%{rdynamic:-export-dynamic} \
+	-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
+    %{static:-static} %{static-pie:-static -pie --no-dynamic-linker -z text}}"
 
 #define STARTFILE_PREFIX_SPEC 			\
    "/lib" XLEN_SPEC "/" ABI_SPEC "/ "		\

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-09 12:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-09 12:52 [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: add static-pie support Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).