[Driver][Linux] Pass --hash-style=gnu to ld unless special cased
authorFangrui Song <i@maskray.me>
Sun, 28 Aug 2022 19:13:01 +0000 (12:13 -0700)
committerFangrui Song <i@maskray.me>
Sun, 28 Aug 2022 19:13:01 +0000 (12:13 -0700)
commit95dcaef00379e893dabc61cf598fe51c9d03414e
tree01fc2f1bd455d70c770a6e7c44bd5dd0fa17ff53
parentf0c00942a520c9944759b1334557b876ba7def9f
[Driver][Linux] Pass --hash-style=gnu to ld unless special cased

To align with many Linux distributions which configure GCC with
--enable-default-hash-style=gnu or binutils with --with-linker-hash-style=gnu.
ld.lld does not support changed default, so passing the option in the driver is
better.

Note: there was a bug that Debian specified both --hash-style=gnu and
--hash-style=both. Actually its GCC has defaulted to --hash-style=gnu since 2007.
clang/lib/Driver/ToolChains/Linux.cpp