llvm21: fix x86 build

This commit is contained in:
Jerome Duval
2025-12-18 21:13:52 +00:00
committed by Jérôme Duval
parent 7d1f96ab45
commit b528fbe46c
2 changed files with 45 additions and 26 deletions

View File

@@ -29,7 +29,7 @@ other than the ones listed above.
HOMEPAGE="https://www.llvm.org/"
COPYRIGHT="2003-2025 University of Illinois at Urbana-Champaign"
LICENSE="Apache v2 with LLVM Exception"
REVISION="1"
REVISION="2"
SOURCE_URI="https://github.com/llvm/llvm-project/releases/download/llvmorg-$portVersion/llvm-project-$portVersion.src.tar.xz"
CHECKSUM_SHA256="4633a23617fa31a3ea51242586ea7fb1da7140e426bd62fc164261fe036aa142"
SOURCE_DIR="llvm-project-$portVersion.src"

View File

@@ -1,4 +1,4 @@
From b819082f6bc58dcc53066e2f3fb6df1f7860ba3b Mon Sep 17 00:00:00 2001
From a7f486a4b86a7e7bdade51b0b7f826876c2fd729 Mon Sep 17 00:00:00 2001
From: Calvin Hill <calvin@hakobaito.co.uk>
Date: Sun, 9 Sep 2018 16:11:42 +0100
Subject: llvm: import header dir suffix patch from 3dEyes
@@ -21,10 +21,10 @@ index 49df8fd..99acd9d 100644
SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR);
sys::fs::make_absolute(ActivePrefix, Path);
--
2.51.0
2.48.1
From 5617f1101385e0753494a27ffa3e6e50cd792c2d Mon Sep 17 00:00:00 2001
From 519532b304d96aac5509c8eebd0e81e64c96f9fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Mon, 18 Jul 2016 14:13:19 +0200
Subject: clang: support for secondary arch.
@@ -116,10 +116,10 @@ index dd6ada8..e5eb778 100644
"/boot/system/develop/headers/gcc/include"));
addSystemInclude(DriverArgs, CC1Args, concat(D.SysRoot,
--
2.51.0
2.48.1
From c8cfd58e6171f79dacb4d207dc3a2f9cc19e2651 Mon Sep 17 00:00:00 2001
From 8e57bff0b18a2efd92390c7f22838aa0e9727440 Mon Sep 17 00:00:00 2001
From: David Karoly <karolyd577@gmail.com>
Date: Thu, 21 Sep 2023 17:44:12 +0000
Subject: fix build on x86 secondary arch
@@ -139,10 +139,10 @@ index c96d209..20f5d76 100644
set(generated_files)
--
2.51.0
2.48.1
From fb47e985d55caaab6978be336ce45d13b2e45fe6 Mon Sep 17 00:00:00 2001
From a261c9782cc735861f2ac7c23f26cd5b4cc9ec74 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Mon, 6 Nov 2023 14:24:21 +0100
Subject: clang: Haiku: patch for analyzer scripts
@@ -201,10 +201,10 @@ index d01aebb..43ba8c3 100755
# Otherwise look relative to the source
share = os.path.dirname(__file__) + "/../../scan-view/share"
--
2.51.0
2.48.1
From 0a03341e6e7c4984dab053ad7b8997b64bb02e05 Mon Sep 17 00:00:00 2001
From 593ed7c0cebbb93fc5ae99f3a4f9dfcada8079e2 Mon Sep 17 00:00:00 2001
From: Brad Smith <brad@comstyle.com>
Date: Mon, 10 Jun 2024 11:13:29 +0200
Subject: A slightly better llvm-config diff that doesn't use #ifdef.
@@ -247,10 +247,10 @@ index 99acd9d..8da9ddf 100644
SharedExt = "dll";
SharedVersionedExt = LLVM_DYLIB_VERSION ".dll";
--
2.51.0
2.48.1
From 6123b99c19dd7e8ec233ce9b025cf9b71ff8f98f Mon Sep 17 00:00:00 2001
From f69d5cb5e63f821bb5c67e03efaa0ef1027ae035 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 19 May 2024 10:31:55 +0200
Subject: Allow linking gcc compiled code with lld
@@ -273,10 +273,10 @@ index 21d228e..6203428 100644
.Case("elf64_sparc", {ELF64BEKind, EM_SPARCV9})
.Case("msp430elf", {ELF32LEKind, EM_MSP430})
--
2.51.0
2.48.1
From 0cd085c4445333c706452f2cc892e38a4aa2d39b Mon Sep 17 00:00:00 2001
From 4ea182ba3880692ba40abe2eefc892b2bd26ae9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Mon, 24 Mar 2025 21:41:12 +0100
Subject: install headers in clang/../include/ where clang searches them
@@ -296,10 +296,10 @@ index d92bc0e..4268fbb 100644
"Path where compiler-rt headers should be installed.")
extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_DATADIR}")
--
2.51.0
2.48.1
From 2c543b1af7664c48bb221d66c836afa8a764b851 Mon Sep 17 00:00:00 2001
From 531ad1248390ba2226ac5c50ba8fc522191d338b Mon Sep 17 00:00:00 2001
From: Luc Schrijvers <begasus@gmail.com>
Date: Thu, 17 Apr 2025 16:38:48 +0200
Subject: Fix missing PATH for stddef
@@ -325,28 +325,47 @@ index e5eb778..76fed45 100644
addSystemInclude(DriverArgs, CC1Args, concat(D.SysRoot,
"/boot/system/develop/headers/"
--
2.51.0
2.48.1
From 901c4e066271a041d6c9f39303c9e4e1e9ba22df Mon Sep 17 00:00:00 2001
From d7ea0cb46b43ac33e3a1464cdf539aef93743375 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Sat, 24 May 2025 22:24:52 +0200
Subject: fix x86 build
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index ea5f2e8..d3a48b4 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -1287,7 +1287,7 @@ uptr GetPageSize() {
uptr ReadBinaryName(/*out*/ char *buf, uptr buf_len) {
# if SANITIZER_HAIKU
- int32_t cookie = 0;
+ int32 cookie = 0;
image_info info;
const char *argv0 = "<UNKNOWN>";
while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index 41d60c8..1c65dd9 100644
index 41d60c8..05ebee4 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -629,7 +629,11 @@ typedef unsigned long __sanitizer_sigset_t;
@@ -32,6 +32,8 @@
# elif SANITIZER_GLIBC || SANITIZER_ANDROID
# define SANITIZER_HAS_STAT64 1
# define SANITIZER_HAS_STATFS64 1
+# elif SANITIZER_HAIKU
+# include <stdint.h>
# endif
# if defined(__sparc__)
@@ -629,7 +631,7 @@ typedef unsigned long __sanitizer_sigset_t;
# elif SANITIZER_APPLE
typedef unsigned __sanitizer_sigset_t;
# elif SANITIZER_HAIKU
+# if defined(__x86_64__)
+typedef unsigned long __sanitizer_sigset_t;
+# else
typedef unsigned long long __sanitizer_sigset_t;
+# endif
-typedef unsigned long long __sanitizer_sigset_t;
+typedef uint64_t __sanitizer_sigset_t;
# elif SANITIZER_LINUX
struct __sanitizer_sigset_t {
// The size is determined by looking at sizeof of real sigset_t on linux.
@@ -365,5 +384,5 @@ index 9a1afd3..d77110f 100644
#include <signal.h>
#define _LIBUNWIND_CHECK_HAIKU_SIGRETURN 1
--
2.51.0
2.48.1