From a0121359733b2c476131ea34534b53bd3ce92521 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Sun, 9 Jul 2023 09:02:39 +0100 Subject: [PATCH] Darwin: Move checking of the 'shared' driver spec. This avoids a bunch of irrelevant diagnostics if the user passes '-shared' to gnatmake. Currently, we push '-dynamiclib' back onto the command line (since that is the Darwin spelling of 'shared') but this is not handled by gnat1, leading to a diagnostic for every character after the '-d'. '-shared' has no effect on gnatmake (it needs to be passed to gnatbind). This moves the handling of '-shared' to leaf specs so that we do not need to push 'dynamiclib' onto the command line. gcc/ChangeLog: * config/darwin.h: (SUBTARGET_DRIVER_SELF_SPECS): Move handling of 'shared' into the same specs as 'dynamiclib'. (STARTFILE_SPEC): Handle 'shared'. (cherry picked from commit 2e36eedb244badaaf2a70388071115c851b8db9b) --- gcc/config/darwin.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 9cae0165ae9..430f12662e9 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -131,10 +131,9 @@ extern GTY(()) int darwin_ms_struct; cases where these driver opts are used multiple times, or to control operations on more than one command (e.g. dynamiclib). These are handled specially and we then add %= 10.7 mmacosx-version-min= -no_pie) }" #define DARWIN_CC1_SPEC \ - "%