Do smart re-linking for GCC-like toolchains.

Make a copy of the actual library and link against
it. The copy is updated only if the list of global
symbols changed.

Task-number: QBS-464
Change-Id: I220129c3332c320dcc6c219e88b5fb940f354f74
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>