build system: use archives, not linker action to shorten command lines

Intermediate linking may distort linker behavior (in particular related to
weak symbols). The idea is that archives are closer to 'just a list of
object files', and ideally makes the linker more predictable.

Using --whole-archive, the linker doesn't optimize out object files just
because their symbols were already provided by weak versions. However it
shouldn't be used for libgcc, because that one has some unexpected side-effects.

Change-Id: Ie226c198a93bcdca2d82c02431c72108a1c6ea60
Signed-off-by: Patrick Georgi <>
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <>
Tested-by: Raptor Engineering Automated Test Stand <>
8 files changed