File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1720,6 +1720,23 @@ impl Build {
1720
1720
} else if target. contains ( "aarch64" ) {
1721
1721
cmd. args . push ( "--target=aarch64-unknown-windows-gnu" . into ( ) )
1722
1722
}
1723
+ } else if target. ends_with ( "-freebsd" ) && self . get_host ( ) ?. eq ( target) {
1724
+ // clang <= 13 on FreeBSD doesn't support a target triple without at least
1725
+ // the major os version number appended; e.g. use x86_64-unknown-freebsd13
1726
+ // or x86_64-unknown-freebsd13.0 instead of x86_64-unknown-freebsd.
1727
+ let stdout = std:: process:: Command :: new ( "freebsd-version" )
1728
+ . output ( )
1729
+ . map_err ( |e| {
1730
+ Error :: new (
1731
+ ErrorKind :: ToolNotFound ,
1732
+ & format ! ( "Error executing freebsd-version: {}" , e) ,
1733
+ )
1734
+ } ) ?
1735
+ . stdout ;
1736
+ let stdout = String :: from_utf8_lossy ( & stdout) ;
1737
+ let os_ver = stdout. split ( '-' ) . next ( ) . unwrap ( ) ;
1738
+
1739
+ cmd. push_cc_arg ( format ! ( "--target={}{}" , target, os_ver) . into ( ) ) ;
1723
1740
} else {
1724
1741
cmd. push_cc_arg ( format ! ( "--target={}" , target) . into ( ) ) ;
1725
1742
}
You can’t perform that action at this time.
0 commit comments