[PATCH, Ada] Push -shared-libgcc where needed.
Gnatlink has code that checks for duplicate '-shared-libgcc’ switches (but not
duplicate ‘static-libgcc’) and also pushes ’static-libgcc' onto the link line for
targets that default to static linking, provided '-shared-libgcc' is not present.
For targets that should use a shared libgcc we need the same process to be
applied (in inverse), in the event that they do not default to providing the
shared flag implicitly.
So this adds the complementary set of tests for the shared case and pushes
the shared flag as needed. As a minor tidy-up there’s no need push duplicates
of the libgcc switch onto the link line when one has already been seen (given by
the user).
The patch does not alter any of the platform defaults for static/shared libgcc,
but it ensures that the intent of the link is explicit.
gcc/ada/
2019-06-30 Iain Sandoe <iain@sandoe.co.uk>
* gnatlink.adb (Link_Step): Remove duplicate -static-libgcc switches.
Push -shared-libgcc explicitly, when it is the target default (unless
overidden by the static flag).
When the user has put an instance of shared/static-libgcc do not push
a duplicate of this.
From-SVN: r272832