Static libraries de-duplication: keep first occurrence

Fixes: #26335
9 files changed