mirror of
https://git.freebsd.org/ports.git
synced 2025-04-29 01:56:37 -04:00
Change clang to allow -m32 on arm64. This is a backport from upstream and will be merged to FreeBSD head soon. See D40943 for more info. Remove an obsolete patch which breaks arm64. [0] When BE_NATIVE is specified on aarch64, include the ARM (32-bit) backend. PR: 271616 [0] Reported by: jfc@mit.edu [0]
32 lines
1.5 KiB
Text
32 lines
1.5 KiB
Text
commit 3450272fc281979388bb845a9fffb59b42cc2e7e
|
|
Author: Jessica Clarke <jrtc27@jrtc27.com>
|
|
Date: Mon Jul 10 01:40:58 2023 +0100
|
|
|
|
[Driver][FreeBSD] Generalise lib32 handling to support arm
|
|
|
|
The current code maintains its own list of 32-bit architectures for
|
|
which there is a 64-bit FreeBSD architecture that supports it for lib32.
|
|
This is unnecessary (if it's not supported, the directory just won't
|
|
exist), and means that, when FreeBSD gains lib32 support for a new
|
|
architecture, you need an updated toolchain that knows about it.
|
|
Instead we can check for any 32-bit architecture and have forwards
|
|
compatibility.
|
|
|
|
This is motivated by FreeBSD adding support for building arm lib32
|
|
libraries on aarch64.
|
|
|
|
Co-authored-by: Mike Karels <karels@FreeBSD.org>
|
|
|
|
diff --git clang/lib/Driver/ToolChains/FreeBSD.cpp clang/lib/Driver/ToolChains/FreeBSD.cpp
|
|
--- clang/lib/Driver/ToolChains/FreeBSD.cpp.orig 2022-06-22 17:46:24.000000000 +0100
|
|
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp 2023-07-12 18:38:47.053029000 +0100
|
|
@@ -385,8 +385,7 @@
|
|
|
|
// 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(getDriver().SysRoot + "/usr/lib32/crt1.o"))
|
|
getFilePaths().push_back(getDriver().SysRoot + "/usr/lib32");
|
|
else
|