Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to devel-llvm-versioned grimoire by Ismael Luceno (e229af13ee45906ea20315ffa503eee02fa75866)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to devel-llvm-versioned grimoire by Ismael Luceno (e229af13ee45906ea20315ffa503eee02fa75866)
  • Date: Fri, 31 Mar 2023 15:17:54 +0000

GIT changes to devel-llvm-versioned grimoire by Ismael Luceno
<ismael AT sourcemage.org>:

devel/llvm15/BUILD
| 5 +
devel/llvm15/DETAILS
| 25 +++++
devel/llvm15/PREPARE
| 4
devel/llvm15/PRE_BUILD
| 23 +++++
devel/llvm15/PRE_SUB_DEPENDS
| 2
devel/llvm15/SUB_DEPENDS
| 8 +
devel/llvm15/patches-clang/clang-001-fix-unwind-chain-inclusion.patch
| 45 ++++++++++
devel/llvm15/patches-lld/0001-Include-libunwind-from-source-directory.patch
| 28 ++++++
devel/llvm15/patches-lld/libcxx-musl.patch
| 28 ++++++
devel/llvm15/patches-lld/libcxxabi-dl.patch
| 27 ++++++
10 files changed, 194 insertions(+), 1 deletion(-)

New commits:
commit e229af13ee45906ea20315ffa503eee02fa75866
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

llvm15: Add lld & clang again

diff --git a/devel/llvm15/BUILD b/devel/llvm15/BUILD
index c770354..f87da18 100755
--- a/devel/llvm15/BUILD
+++ b/devel/llvm15/BUILD
@@ -1,3 +1,8 @@
+case "$HOST" in
+ (*-musl)
+ OPTS+=' -DLIBCXX_HAS_MUSL_LIBC=YES'
+ ;;
+esac &&
# Remove -DPIC from compiler flags, produces build errors
CXXFLAGS="${CXXFLAGS//-DPIC}" &&
# Default target, not detected correctly
diff --git a/devel/llvm15/DETAILS b/devel/llvm15/DETAILS
index 6214376..aeffa6c 100755
--- a/devel/llvm15/DETAILS
+++ b/devel/llvm15/DETAILS
@@ -6,11 +6,36 @@

GITHUB_URI="https://github.com/llvm/llvm-project/releases/download/llvmorg-$VERSION";
SOURCE_URL[0]="${GITHUB_URI}/${SOURCE}"

SOURCE_HASH=sha256:4ad8b2cc8003c86d0078d15d987d84e3a739f24aae9033865c027abae93ee7a4
+if [[ "$LLVM_WITH_CLANG" == y ]]; then
+ SOURCE3="clang-${VERSION}.src.tar.xz"
+ SOURCE3_URL[0]="${GITHUB_URI}/${SOURCE3}"
+
SOURCE3_HASH=sha256:a6b673ef15377fb46062d164e8ddc4d05c348ff8968f015f7f4af03f51000067
+ SOURCE5="compiler-rt-${VERSION}.src.tar.xz"
+ SOURCE5_URL[0]="${GITHUB_URI}/${SOURCE5}"
+
SOURCE5_HASH=sha256:353832c66cce60931ea0413b3c071faad59eefa70d02c97daa8978b15e4b25b7
+ SOURCE9="clang-tools-extra-${VERSION}.src.tar.xz"
+ SOURCE9_URL[0]="${GITHUB_URI}/${SOURCE9}"
+
SOURCE9_HASH=sha256:809a2ef46d46be3b83ca389356404ac041fa6d8f5496cb02ec35d252afb64fd1
+fi
if [[ "$LLVM_WITH_POLLY" == y ]]; then
SOURCE11="polly-${VERSION}.src.tar.xz"
SOURCE11_URL[0]="${GITHUB_URI}/${SOURCE11}"

SOURCE11_HASH=sha256:1053610cace401c0b4e6d430d441277b0283dd4112581e2acc90e174d3192819
fi
+if [[ "$LLVM_WITH_LLD" == y ]]; then
+ SOURCE13="lld-${VERSION}.src.tar.xz"
+ SOURCE13_URL[0]="${GITHUB_URI}/${SOURCE13}"
+
SOURCE13_HASH=sha256:dba5c70c3fe88b3a38b9180df82fbc9d1dfd55d68f41fddd6a90f9e17f8e5df9
+ SOURCE15="libunwind-${VERSION}.src.tar.xz"
+ SOURCE15_URL[0]="${GITHUB_URI}/${SOURCE15}"
+
SOURCE15_HASH=sha256:406d199ae3a16add84017f40458a5e7c31f9412937fcb518715af0a0eeafbc0c
+ SOURCE17="libcxx-${VERSION}.src.tar.xz"
+ SOURCE17_URL[0]="${GITHUB_URI}/${SOURCE17}"
+
SOURCE17_HASH=sha256:8d4eaff1cb6e41439fbf3ededb46998a0a3564d66dd289f661bdd459c9277c11
+ SOURCE19="libcxxabi-${VERSION}.src.tar.xz"
+ SOURCE19_URL[0]="${GITHUB_URI}/${SOURCE19}"
+
SOURCE19_HASH=sha256:9b42f3951d845232e4cd58a0a9841838292dac138af19d4f8d0c08bd41004f43
+fi
SOURCE21="cmake-${VERSION}.src.tar.xz"
SOURCE21_URL[0]="${GITHUB_URI}/${SOURCE21}"

SOURCE21_HASH=sha256:8986f29b634fdaa9862eedda78513969fe9788301c9f2d938f4c10a3e7a3e7ea
diff --git a/devel/llvm15/PREPARE b/devel/llvm15/PREPARE
index 237b29e..0cfb539 100755
--- a/devel/llvm15/PREPARE
+++ b/devel/llvm15/PREPARE
@@ -1,2 +1,4 @@
config_query LLVM_WITH_RTTI "Enable RTTI? (recommended)" y &&
-config_query LLVM_WITH_POLLY "Enable polihedral optimizer?" n
+config_query LLVM_WITH_CLANG "Enable clang compiler frontend?" n &&
+config_query LLVM_WITH_POLLY "Enable polihedral optimizer?" n &&
+config_query LLVM_WITH_LLD "Enable llvm's linker?" n
diff --git a/devel/llvm15/PRE_BUILD b/devel/llvm15/PRE_BUILD
index 27f152a..0a81aec 100755
--- a/devel/llvm15/PRE_BUILD
+++ b/devel/llvm15/PRE_BUILD
@@ -3,12 +3,35 @@ cd "$SOURCE_DIRECTORY" &&
apply_patch_dir patches-llvm &&
unpack_file 21 &&
mv cmake-${VERSION}.src/Modules/*cmake cmake &&
+if [[ "$LLVM_WITH_CLANG" == y ]]; then
+ unpack_file 5 &&
+ mv compiler-rt-${VERSION}.src runtimes/compiler-rt &&
+ unpack_file 3 &&
+ mv clang-${VERSION}.src tools/clang &&
+ unpack_file 9 &&
+ mv clang-tools-extra-${VERSION}.src tools/clang/tools/extra &&
+ apply_patch_dir patches-clang &&
+ sedit '/^[\t ]*set(model_compiler
/{s@[.][.]/clang-tools-@tools/clang/tools/@}' \
+ tools/clang/tools/extra/clangd/quality/CompletionModel.cmake
+fi &&

if [[ "$LLVM_WITH_POLLY" == y ]]; then
unpack_file 11 &&
mv polly-${VERSION}.src tools/polly
fi &&

+if [[ "$LLVM_WITH_LLD" == y ]]; then
+ unpack_file 13 &&
+ mv lld-${VERSION}.src tools/lld &&
+ unpack_file 15 &&
+ mv libunwind-${VERSION}.src libunwind &&
+ unpack_file 17 &&
+ mv libcxx-${VERSION}.src runtimes/libcxx &&
+ unpack_file 19 &&
+ mv libcxxabi-${VERSION}.src runtimes/libcxxabi &&
+ apply_patch_dir patches-lld
+fi &&
+
cd "$SOURCE_DIRECTORY" &&

# small cmake related fix for libffi
diff --git a/devel/llvm15/PRE_SUB_DEPENDS b/devel/llvm15/PRE_SUB_DEPENDS
index 7b0dafc..8206f1b 100755
--- a/devel/llvm15/PRE_SUB_DEPENDS
+++ b/devel/llvm15/PRE_SUB_DEPENDS
@@ -1,7 +1,9 @@
case $THIS_SUB_DEPENDS in
TARGET-*) list_find "$LLVM_TARGETS" "${THIS_SUB_DEPENDS#TARGET-}" ;;
AMD) list_find "${LLVM_TARGETS}" AMDGPU ;;
+CLANG) [[ "${LLVM_WITH_CLANG}" == "y" ]] ;;
POLLY) [[ "${LLVM_WITH_POLLY}" == "y" ]] ;;
+LLD) [[ "${LLVM_WITH_LLD}" == "y" ]] ;;
RTTI) [ y = "$LLVM_WITH_RTTI" ] ;;
*)
message "${PROBLEM_COLOR}bogus sub_depends: $SPELL
$THIS_SUB_DEPENDS${DEFAULT_COLOR}"
diff --git a/devel/llvm15/SUB_DEPENDS b/devel/llvm15/SUB_DEPENDS
index d4675c7..a5e2c96 100755
--- a/devel/llvm15/SUB_DEPENDS
+++ b/devel/llvm15/SUB_DEPENDS
@@ -8,10 +8,18 @@ AMD)
message "${MESSAGE_COLOR}AMD support enforced by
sub-dependency.$DEFAULT_COLOR"
list_add LLVM_TARGETS AMDGPU
;;
+CLANG)
+ message "${MESSAGE_COLOR}Building clang enforced by
sub-dependency.$DEFAULT_COLOR"
+ LLVM_WITH_CLANG=y
+;;
POLLY)
message "${MESSAGE_COLOR}Building polly enforced by
sub-dependency.$DEFAULT_COLOR"
LLVM_WITH_POLLY=y
;;
+LLD)
+ message "${MESSAGE_COLOR}Building lld enforced by
sub-dependency.$DEFAULT_COLOR"
+ LLVM_WITH_LLD=y
+;;
RTTI)
message "${MESSAGE_COLOR}RTTI support enforced by
sub-dependency.$DEFAULT_COLOR"
LLVM_WITH_RTTI=y
diff --git
a/devel/llvm15/patches-clang/clang-001-fix-unwind-chain-inclusion.patch
b/devel/llvm15/patches-clang/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 0000000..adc3fcd
--- /dev/null
+++ b/devel/llvm15/patches-clang/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,45 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe AT gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+Origin: Void Linux
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/tools/clang/lib/Headers/unwind.h
++++ b/tools/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+ * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct
_Unwind_Context *);
+ }
+ #endif
+
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+
+-#endif /* __CLANG_UNWIND_H */
+--
+2.5.1
diff --git
a/devel/llvm15/patches-lld/0001-Include-libunwind-from-source-directory.patch
b/devel/llvm15/patches-lld/0001-Include-libunwind-from-source-directory.patch
new file mode 100644
index 0000000..536d434
--- /dev/null
+++
b/devel/llvm15/patches-lld/0001-Include-libunwind-from-source-directory.patch
@@ -0,0 +1,28 @@
+From 2cf2b1af0f0be6431c1e239d482056ef4d4ac17f Mon Sep 17 00:00:00 2001
+From: Florian Franzmann <Florian.Franzmann AT bandrate.org>
+Date: Sun, 2 May 2021 13:24:21 +0200
+Subject: [PATCH] Fix inclusion of libunwind from source directory
+
+Ref: https://groups.google.com/g/llvm-dev/c/gIY5COm6V5E
+Upstream-Status: Unknown [Should have been fixed by 12.0.1; as of
+ 2021-07-10 this has not been fixed.]
+---
+ tools/lld/MachO/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/lld/MachO/CMakeLists.txt b/tools/lld/MachO/CMakeLists.txt
+index b76f37dcc6e6..69ca3fc6de67 100644
+--- a/tools/lld/MachO/CMakeLists.txt
++++ b/tools/lld/MachO/CMakeLists.txt
+@@ -2,7 +2,7 @@ set(LLVM_TARGET_DEFINITIONS Options.td)
+ tablegen(LLVM Options.inc -gen-opt-parser-defs)
+ add_public_tablegen_target(MachOOptionsTableGen)
+
+-include_directories(${LLVM_MAIN_SRC_DIR}/../libunwind/include)
++include_directories(${LLVM_MAIN_SRC_DIR}/libunwind/include)
+
+ add_lld_library(lldMachO2
+ Arch/X86_64.cpp
+--
+2.31.1
+
diff --git a/devel/llvm15/patches-lld/libcxx-musl.patch
b/devel/llvm15/patches-lld/libcxx-musl.patch
new file mode 100644
index 0000000..3600f40
--- /dev/null
+++ b/devel/llvm15/patches-lld/libcxx-musl.patch
@@ -0,0 +1,28 @@
+Origin: Void Linux
+
+--- a/runtimes/libcxx/include/locale
++++ b/runtimes/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char*
__a_end,
+ typename remove_reference<decltype(errno)>::type __save_errno =
errno;
+ errno = 0;
+ char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++ long long __ll = strtoll(__a, &__p2, __base);
++#else
+ long long __ll = strtoll_l(__a, &__p2, __base,
_LIBCPP_GET_C_LOCALE);
++#endif
+ typename remove_reference<decltype(errno)>::type __current_errno =
errno;
+ if (__current_errno == 0)
+ errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const
char* __a_end,
+ typename remove_reference<decltype(errno)>::type __save_errno =
errno;
+ errno = 0;
+ char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++ unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+ unsigned long long __ll = strtoull_l(__a, &__p2, __base,
_LIBCPP_GET_C_LOCALE);
++#endif
+ typename remove_reference<decltype(errno)>::type __current_errno =
errno;
+ if (__current_errno == 0)
+ errno = __save_errno;
diff --git a/devel/llvm15/patches-lld/libcxxabi-dl.patch
b/devel/llvm15/patches-lld/libcxxabi-dl.patch
new file mode 100644
index 0000000..d47a227
--- /dev/null
+++ b/devel/llvm15/patches-lld/libcxxabi-dl.patch
@@ -0,0 +1,27 @@
+Also link to -ldl to prevent undefined references.
+
+Origin: Void Linux
+
+--- a/runtimes/libcxxabi/src/CMakeLists.txt
++++ b/runtimes/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+ endif()
+
+ add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++ add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/runtimes/libcxx/CMakeLists.txt
++++ b/runtimes/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+ target_link_libraries(${target} PRIVATE m)
+ endif()
+
++ if (LIBCXX_HAS_C_LIB)
++ target_link_libraries(${target} PRIVATE dl)
++ endif()
++
+ if (LIBCXX_HAS_RT_LIB)
+ target_link_libraries(${target} PRIVATE rt)
+ endif()



  • [SM-Commit] GIT changes to devel-llvm-versioned grimoire by Ismael Luceno (e229af13ee45906ea20315ffa503eee02fa75866), Ismael Luceno, 03/31/2023

Archive powered by MHonArc 2.6.24.

Top of Page