Darwin, Driver: Avoid a link line for empty commands.
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 15 Dec 2021 20:25:27 +0000 (20:25 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 17 Dec 2021 09:47:04 +0000 (09:47 +0000)
commitff56eea24e48f7a8a3b39db7049d1da532d4b8af
tree221ab946a0613a56840813f19da40bacb33bc3da
parent7c0ceaed0c07ece9ce0112ea6512f38855ae868e
Darwin, Driver: Avoid a link line for empty commands.

We were pushing a spec value for weak_reference_mismatches unconditionally
which is not needed (the value was the default) and the side-effect of
this was that we appeared to need to drive a link command; leading to
unexpected diagnostics for cases where gcc was invoked with an empty
command line.

Also we were pushing flags for sysroot, os minimum version and controls
even if the command line was empty.

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

* config/darwin-driver.c (darwin_driver_init): Exit from the
option handling early if the command line is definitely enpty.
* config/darwin.h (SUBTARGET_DRIVER_SELF_SPECS): Remove
setting for the default content of weak_reference_mismatches.
gcc/config/darwin-driver.c
gcc/config/darwin.h