Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM 15 conda recipe #1036

Merged
merged 24 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions conda-recipes/compiler-rt-cfi-startproc-war.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h
index 69a3d8620f92..094285d12ec2 100644
--- a/compiler-rt/lib/builtins/assembly.h
+++ b/compiler-rt/lib/builtins/assembly.h
@@ -260,9 +260,10 @@
.globl name SEPARATOR \
SYMBOL_IS_FUNC(name) SEPARATOR \
DECLARE_SYMBOL_VISIBILITY_UNMANGLED(name) SEPARATOR \
- CFI_START SEPARATOR \
DECLARE_FUNC_ENCODING \
- name: SEPARATOR BTI_C
+ name: \
+ SEPARATOR CFI_START \
+ SEPARATOR BTI_C

#define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \
.globl SYMBOL_NAME(name) SEPARATOR \
15 changes: 15 additions & 0 deletions conda-recipes/compiler-rt-macos-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
index 640c7e7124c9..7bd3edb86eb1 100644
--- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -399,7 +399,9 @@ endfunction()
macro(darwin_add_builtin_libraries)
set(DARWIN_EXCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Darwin-excludes)

- set(CFLAGS -fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer)
+ set(CFLAGS -fPIC -O3 -Wall -fomit-frame-pointer)
+ append_list_if(COMPILER_RT_BUILTINS_HIDE_SYMBOLS -fvisibility=hidden CFLAGS)
+ append_list_if(COMPILER_RT_BUILTINS_HIDE_SYMBOLS -DVISIBILITY_HIDDEN CFLAGS)
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "")
set(CMAKE_ASM_FLAGS "")
24 changes: 24 additions & 0 deletions conda-recipes/llvm15-clear-gotoffsetmap.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 0bcb486d8f66f6aed142d89e7fe21719f7050756 Mon Sep 17 00:00:00 2001
From: Siu Kwan Lam <[email protected]>
Date: Mon, 8 Apr 2024 10:26:49 -0500
Subject: [PATCH] llvm15-clear-gotoffsetmap.patch

---
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 1 +
1 file changed, 1 insertion(+)

diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index c702584b7..08c65897c 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -2352,6 +2352,7 @@ Error RuntimeDyldELF::finalizeLoad(const ObjectFile &Obj,
}
}

+ GOTOffsetMap.clear();
GOTSectionID = 0;
CurrentGOTIndex = 0;

--
2.41.0

69 changes: 69 additions & 0 deletions conda-recipes/llvm15-remove-use-of-clonefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
From 492d4fdd963576cb796e29c3c160e17ea9acfbf8 Mon Sep 17 00:00:00 2001
From: Siu Kwan Lam <[email protected]>
Date: Mon, 8 Apr 2024 10:28:24 -0500
Subject: [PATCH] llvm15-remove-use-of-clonefile

---
llvm/lib/Support/Unix/Path.inc | 2 ++
llvm/unittests/Support/Path.cpp | 8 +++++---
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 2ae7c6dc4..ae93f7a1f 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -1476,6 +1476,7 @@ namespace fs {
std::error_code copy_file(const Twine &From, const Twine &To) {
std::string FromS = From.str();
std::string ToS = To.str();
+ /*
#if __has_builtin(__builtin_available)
if (__builtin_available(macos 10.12, *)) {
// Optimistically try to use clonefile() and handle errors, rather than
@@ -1504,6 +1505,7 @@ std::error_code copy_file(const Twine &From, const Twine &To) {
// cheaper.
}
#endif
+ */
if (!copyfile(FromS.c_str(), ToS.c_str(), /*State=*/NULL, COPYFILE_DATA))
return std::error_code();
return std::error_code(errno, std::generic_category());
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index 6f0022765..822762952 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/unittests/Support/Path.cpp
@@ -2266,15 +2266,15 @@ TEST_F(FileSystemTest, permissions) {

EXPECT_EQ(fs::setPermissions(TempPath, fs::set_uid_on_exe), NoError);
EXPECT_TRUE(CheckPermissions(fs::set_uid_on_exe));
-
+#if !defined(__APPLE__)
EXPECT_EQ(fs::setPermissions(TempPath, fs::set_gid_on_exe), NoError);
EXPECT_TRUE(CheckPermissions(fs::set_gid_on_exe));
-
+#endif
// Modern BSDs require root to set the sticky bit on files.
// AIX and Solaris without root will mask off (i.e., lose) the sticky bit
// on files.
#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \
- !defined(_AIX) && !(defined(__sun__) && defined(__svr4__))
+ !defined(_AIX) && !(defined(__sun__) && defined(__svr4__)) && !defined(__APPLE__)
EXPECT_EQ(fs::setPermissions(TempPath, fs::sticky_bit), NoError);
EXPECT_TRUE(CheckPermissions(fs::sticky_bit));

@@ -2296,10 +2296,12 @@ TEST_F(FileSystemTest, permissions) {
EXPECT_TRUE(CheckPermissions(fs::all_perms));
#endif // !FreeBSD && !NetBSD && !OpenBSD && !AIX

+#if !defined(__APPLE__)
EXPECT_EQ(fs::setPermissions(TempPath, fs::all_perms & ~fs::sticky_bit),
NoError);
EXPECT_TRUE(CheckPermissions(fs::all_perms & ~fs::sticky_bit));
#endif
+#endif
}

#ifdef _WIN32
--
2.41.0

Loading