]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Darwin: Handle the -rpath command line option.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 28 Mar 2021 13:48:17 +0000 (14:48 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 18 Aug 2021 18:28:20 +0000 (19:28 +0100)
This handles the command line '-rpath' option by passing it through
to the static linker.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:

* config.gcc: Include rpath.opt for Darwin.
* config/darwin.h (DRIVER_SELF_SPECS): Handle -rpath.

gcc/config.gcc
gcc/config/darwin.h

index d9bfbfdc0d2976c08337e6cad61197968ce1f99e..eb232df6df421fbdabced04a57233b473f7d218d 100644 (file)
@@ -700,7 +700,7 @@ case ${target} in
   tm_file="${tm_file} ${cpu_type}/darwin.h"
   tm_p_file="${tm_p_file} darwin-protos.h"
   target_gtfiles="$target_gtfiles \$(srcdir)/config/darwin.c"
-  extra_options="${extra_options} darwin.opt"
+  extra_options="${extra_options} rpath.opt darwin.opt"
   c_target_objs="${c_target_objs} darwin-c.o"
   cxx_target_objs="${cxx_target_objs} darwin-c.o"
   d_target_objs="${d_target_objs} darwin-d.o"
index 20d6b1e9c058dea88e032dfc781c93fb91468934..b1be561e854ad30ca63f85da2552d677c0ff895b 100644 (file)
@@ -132,6 +132,7 @@ extern GTY(()) int darwin_ms_struct;
 "%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform} \
    %<gsplit-dwarf",                                                    \
 "%{gused:-g -feliminate-unused-debug-symbols} %<gused",                        \
+"%{rpath*: -Xlinker -rpath -Xlinker %*}",                                      \
 "%{shared:-Zdynamiclib} %<shared",                                     \
 "%{static:%{Zdynamic:%e conflicting code gen style switches are used}}",\
 "%{y*:%nthe y option is obsolete and ignored} %<y*",                   \
@@ -238,7 +239,7 @@ extern GTY(()) int darwin_ms_struct;
     DARWIN_NOPIE_SPEC \
     DARWIN_RDYNAMIC \
     DARWIN_NOCOMPACT_UNWIND \
-    "}}}}}}} %<pie %<no-pie %<rdynamic %<X "
+    "}}}}}}} %<pie %<no-pie %<rdynamic %<X %<rpath "
 
 /* Spec that controls whether the debug linker is run automatically for
    a link step.  This needs to be done if there is a source file on the