summaryrefslogtreecommitdiff
path: root/bootstrap/llvm18/llvm-fix-build-with-musl-libc.patch
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2024-12-06 19:22:35 +0000
committerZach van Rijn <me@zv.io>2024-12-06 19:22:37 +0000
commit57762abcbf59410fc77ac48a3027bdee08c9291f (patch)
tree089c78d5e2738f92acc7dd22fbc18daa53bfd480 /bootstrap/llvm18/llvm-fix-build-with-musl-libc.patch
parentcf1b9041544c3a70181778535ba310653593e9c3 (diff)
downloadpackages-57762abcbf59410fc77ac48a3027bdee08c9291f.tar.gz
packages-57762abcbf59410fc77ac48a3027bdee08c9291f.tar.bz2
packages-57762abcbf59410fc77ac48a3027bdee08c9291f.tar.xz
packages-57762abcbf59410fc77ac48a3027bdee08c9291f.zip
bootstrap/llvm18: replace symlink with files.
Note: default_llvm="no" Effectively reverts 1c7549b7bb4dcf1142d6c19876841ccc93fcafd5 since 'abuild' uses readlink to derive repository information. The user/llvm18 package is free to be updated independently.
Diffstat (limited to 'bootstrap/llvm18/llvm-fix-build-with-musl-libc.patch')
-rw-r--r--bootstrap/llvm18/llvm-fix-build-with-musl-libc.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/bootstrap/llvm18/llvm-fix-build-with-musl-libc.patch b/bootstrap/llvm18/llvm-fix-build-with-musl-libc.patch
new file mode 100644
index 000000000..6ee91ea44
--- /dev/null
+++ b/bootstrap/llvm18/llvm-fix-build-with-musl-libc.patch
@@ -0,0 +1,46 @@
+From 5c571082fdaf61f6df19d9b7137dc26d71334058 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 18 Feb 2016 10:33:04 +0100
+Subject: [PATCH 2/3] Fix build with musl libc
+
+On musl libc the fopen64 and fopen are the same thing, but for
+compatibility they have a `#define fopen64 fopen`. Same applies for
+fseek64, fstat64, fstatvfs64, ftello64, lstat64, stat64 and tmpfile64.
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 7becdf0..7f14427 100644
+--- a/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,26 @@
+ #include "llvm/IR/Module.h"
+ #include "llvm/Pass.h"
+
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++#undef F_GETLK64
++#undef F_SETLK64
++#undef F_SETLKW64
++#undef flock64
++#undef open64
++#undef openat64
++#undef creat64
++#undef lockf64
++#undef posix_fadvise64
++#undef posix_fallocate64
++#undef off64_t
++
+ namespace llvm {
+ /// VecDesc - Describes a possible vectorization of a function.
+ /// Function 'VectorFnName' is equivalent to 'ScalarFnName' vectorized
+--
+2.7.3
+