[Driver][FreeBSD] Correct driver behavior if a triple is provided without a version
authorBrad Smith <brad@comstyle.com>
Tue, 21 Feb 2023 19:05:34 +0000 (14:05 -0500)
committerBrad Smith <brad@comstyle.com>
Tue, 21 Feb 2023 19:08:26 +0000 (14:08 -0500)
commit2a2c0fd96757871f4e8052624000c208cc574fdf
tree6151120c5bf5eed7ae26de3de532fb60cf4e8327
parent5d585c9dd07d0df4d450e2b1ba61fb17a5153aac
[Driver][FreeBSD] Correct driver behavior if a triple is provided without a version

While looking at other usage of getOSMajorVersion() I noticed if a version number is not
included in the FreeBSD triple it won't include the --hash-style=both linker option or
not disable the use of .init_array. Without a version should be the latest.

FreeBSD 8 and 9 are no longer supported. So simplify things with the version handling
as well.

Reviewed By: dim

Differential Revision: https://reviews.llvm.org/D144341
clang/lib/CodeGen/TargetInfo.cpp
clang/lib/Driver/ToolChains/FreeBSD.cpp
clang/lib/Driver/ToolChains/FreeBSD.h
clang/test/Driver/constructors.c
clang/test/Driver/freebsd.c
clang/test/Driver/freebsd.cpp