]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Darwin: Recognise -weak_framework in the driver [PR116237].
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 5 Aug 2024 12:19:28 +0000 (13:19 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 7 Aug 2024 19:28:59 +0000 (20:28 +0100)
XCode compilers recognise the weak_framework linker option in the driver
and forward it.  This patch makes GCC adopt the same behaviour.

PR target/116237

gcc/ChangeLog:

* config/darwin.h (SUBTARGET_DRIVER_SELF_SPECS): Add a spec for
weak_framework.
* config/darwin.opt: Handle weak_framework driver option.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/config/darwin.h
gcc/config/darwin.opt

index c09b9e9dc94d44e269e5c384a2d30aff5505364a..377599074a750b5e04872afd9278c0f6e7b3542f 100644 (file)
@@ -264,6 +264,8 @@ extern GTY(()) int darwin_ms_struct;
   "%{weak_reference_mismatches*:\
     -Xlinker -weak_reference_mismatches -Xlinker %*} \
     %<weak_reference_mismatches*",                                     \
+  "%{weak_framework*: -Xlinker -weak_framework -Xlinker %*} \
+    %<weak_framework*",                                                        \
   "%{whyload:-Xlinker -whyload} %<whyload",                            \
   "%{whatsloaded:-Xlinker -whatsloaded} %<whatsloaded",                        \
   "%{w:-Xlinker -w}",                                                  \
index 307a760629ba5d1cfa7cd1f5cac731230e0c2fb8..114048045b90c5e506fa5b47e20cf0493ae9a382 100644 (file)
@@ -381,6 +381,10 @@ unexported_symbols_list
 Driver RejectNegative Separate
 -unexported_symbols_list <filename>    Do not export the global symbols listed in <filename>.
 
+weak_framework
+Driver RejectNegative Separate
+-weak_framework <framework>    Make a weak link to the specified framework.
+
 weak_reference_mismatches
 Driver RejectNegative Separate
 -weak_reference_mismatches <treatment> Specifies what to do if a symbol import conflicts between file (weak in one and not in another) the default is to treat the symbol as non-weak.