git: a2e0c77f941d - stable/13 - arm64 lib32: change clang to allow -m32 on arm64
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 07 Jan 2024 23:08:06 UTC
The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a2e0c77f941d7fc7fe5e2229124a551c08793052 commit a2e0c77f941d7fc7fe5e2229124a551c08793052 Author: Mike Karels <karels@FreeBSD.org> AuthorDate: 2023-07-25 23:58:51 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-01-07 23:04:33 +0000 arm64 lib32: change clang to allow -m32 on arm64 The FreeBSD driver support for clang tested explicitly for 32-bit Intel, MIPS, or PowerPC targets where /usr/lib32/libcrt1.o was present to decide whether -m32 should use /usr/lib32. At jrtc27's suggestion, simply test for a 32-bit platform rather than adding arm to the list. Upstreamed as https://github.com/llvm/llvm-project/commit/3450272fc281979388bb845a9fffb59b42cc2e7e Bump the freebsd version to force a bootstrap build. This is one step in adding support for -m32 on arm64. Reviewed by: jrtc27, brooks, dim Differential Revision: https://reviews.freebsd.org/D40943 (cherry picked from commit f1d5183124d3e18d410ded61e45adb9a23b23c83) --- contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp | 3 +-- lib/clang/freebsd_cc_version.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp index 2230295ccd74..80d49c28f497 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp @@ -377,8 +377,7 @@ FreeBSD::FreeBSD(const Driver &D, const llvm::Triple &Triple, // When targeting 32-bit platforms, look for '/usr/lib32/crt1.o' and fall // back to '/usr/lib' if it doesn't exist. - if ((Triple.getArch() == llvm::Triple::x86 || Triple.isMIPS32() || - Triple.isPPC32()) && + if (Triple.isArch32Bit() && D.getVFS().exists(concat(getDriver().SysRoot, "/usr/lib32/crt1.o"))) getFilePaths().push_back(concat(getDriver().SysRoot, "/usr/lib32")); else diff --git a/lib/clang/freebsd_cc_version.h b/lib/clang/freebsd_cc_version.h index e0441ae866f5..758b8295d012 100644 --- a/lib/clang/freebsd_cc_version.h +++ b/lib/clang/freebsd_cc_version.h @@ -1 +1 @@ -#define FREEBSD_CC_VERSION 1300012 +#define FREEBSD_CC_VERSION 1300013