diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..f087b429e2f81a9f37b28a8308e2210f84df6c9b --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.tar.gz filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..3ff73de9a83b3ae2b285171b30933b5128f28016 --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/src-openEuler/llvm-toolset-19 \ No newline at end of file diff --git a/0002-Add-triples-for-X86_64-AArch64-Riscv64-openEuler-gcc.patch b/0002-Add-triples-for-X86_64-AArch64-Riscv64-openEuler-gcc.patch deleted file mode 100644 index 6c20d9a1efb9ce39e2876ef6d2290e35c9a49517..0000000000000000000000000000000000000000 --- a/0002-Add-triples-for-X86_64-AArch64-Riscv64-openEuler-gcc.patch +++ /dev/null @@ -1,55 +0,0 @@ -From a833e7fa829764f8e3bf6b059c9e91080ca55253 Mon Sep 17 00:00:00 2001 -From: liyunfei -Date: Mon, 24 Jul 2023 19:16:45 +0800 -Subject: [PATCH] Add triples for X86_64/AArch64/Riscv64 openEuler gcc - ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 12 ++-- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index 665cdc3132fb..fc56935e7513 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2467,7 +2467,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; - static const char *const AArch64Triples[] = { - "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", -- "aarch64-suse-linux"}; -+ "aarch64-suse-linux", "aarch64-openEuler-linux", "aarch64-kylin-linux"}; - static const char *const AArch64beLibDirs[] = {"/lib"}; - static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu"}; - -@@ -2495,7 +2495,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - "x86_64-pc-linux-gnu", "x86_64-redhat-linux6E", - "x86_64-redhat-linux", "x86_64-suse-linux", - "x86_64-manbo-linux-gnu", "x86_64-slackware-linux", -- "x86_64-unknown-linux", "x86_64-amazon-linux"}; -+ "x86_64-unknown-linux", "x86_64-amazon-linux", -+ "x86_64-openEuler-linux", "x86_64-kylin-linux"}; - static const char *const X32Triples[] = {"x86_64-linux-gnux32", - "x86_64-pc-linux-gnux32"}; - static const char *const X32LibDirs[] = {"/libx32", "/lib"}; -@@ -2508,7 +2508,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - - static const char *const LoongArch64LibDirs[] = {"/lib64", "/lib"}; - static const char *const LoongArch64Triples[] = { -- "loongarch64-linux-gnu", "loongarch64-unknown-linux-gnu"}; -+ "loongarch64-linux-gnu", "loongarch64-unknown-linux-gnu", -+ "loongarch64-openEuler-linux", "loongarch64-kylin-linux"}; - - static const char *const M68kLibDirs[] = {"/lib"}; - static const char *const M68kTriples[] = {"m68k-unknown-linux-gnu", -@@ -2565,7 +2565,9 @@ - "riscv32-unknown-elf"}; - static const char *const RISCV64LibDirs[] = {"/lib64", "/lib"}; - static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu", -- "riscv64-unknown-elf"}; -+ "riscv64-unknown-elf", -+ "riscv64-openEuler-linux", -+ "riscv64-kylin-linux"}; - - static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"}; - static const char *const SPARCv8Triples[] = {"sparc-linux-gnu", --- -2.28.0.windows.1 diff --git a/0003-Always-build-shared-libs-for-LLD.patch b/0002-Always-build-shared-libs-for-LLD.patch similarity index 100% rename from 0003-Always-build-shared-libs-for-LLD.patch rename to 0002-Always-build-shared-libs-for-LLD.patch diff --git a/0005-PATCH-Bolt-CMake-Don-t-export-bolt-libraries-in-LLVM.patch b/0003-PATCH-Bolt-CMake-Don-t-export-bolt-libraries-in-LLVM.patch similarity index 100% rename from 0005-PATCH-Bolt-CMake-Don-t-export-bolt-libraries-in-LLVM.patch rename to 0003-PATCH-Bolt-CMake-Don-t-export-bolt-libraries-in-LLVM.patch diff --git a/0004-Offload-Add-support-for-riscv64-to-host-plugin.patch b/0004-Offload-Add-support-for-riscv64-to-host-plugin.patch deleted file mode 100644 index e008d57b932a6f08d6347931cebb2888777e1479..0000000000000000000000000000000000000000 --- a/0004-Offload-Add-support-for-riscv64-to-host-plugin.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 8f24fd1576190808efd1f7ea639ae895207644f3 Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Mon, 11 Nov 2024 11:12:54 +0100 -Subject: [PATCH] [Offload] Add support for riscv64 to host plugin - -This adds support for the riscv64 architecture to the offload host -plugin. The check to define FFI_DEFAULT_ABI is intentionally not guarded -by __riscv_xlen as the value is the same for riscv32 and riscv64 -(support for OpenMP on riscv32 is still under review). - -Tested-by: jchzhou ---- - offload/CMakeLists.txt | 2 ++ - offload/plugins-nextgen/common/src/Utils/ELF.cpp | 2 ++ - offload/plugins-nextgen/host/CMakeLists.txt | 6 +++++- - offload/plugins-nextgen/host/dynamic_ffi/ffi.h | 3 ++- - offload/plugins-nextgen/host/src/rtl.cpp | 2 ++ - 5 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt -index 959d6260b..ccb61a698 100644 ---- a/offload/CMakeLists.txt -+++ b/offload/CMakeLists.txt -@@ -200,6 +200,8 @@ set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} nvptx64-nvidia-cuda-L - set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} nvptx64-nvidia-cuda-JIT-LTO") - set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} s390x-ibm-linux-gnu") - set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} s390x-ibm-linux-gnu-LTO") -+set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} riscv64-unknown-linux-gnu") -+set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} riscv64-unknown-linux-gnu-LTO") - - # Once the plugins for the different targets are validated, they will be added to - # the list of supported targets in the current system. -diff --git a/offload/plugins-nextgen/common/src/Utils/ELF.cpp b/offload/plugins-nextgen/common/src/Utils/ELF.cpp -index 90d6950b8..88642fd5b 100644 ---- a/offload/plugins-nextgen/common/src/Utils/ELF.cpp -+++ b/offload/plugins-nextgen/common/src/Utils/ELF.cpp -@@ -45,6 +45,8 @@ uint16_t utils::elf::getTargetMachine() { - return EM_AARCH64; - #elif defined(__powerpc64__) - return EM_PPC64; -+#elif defined(__riscv) -+ return EM_RISCV; - #else - #warning "Unknown ELF compilation target architecture" - return EM_NONE; -diff --git a/offload/plugins-nextgen/host/CMakeLists.txt b/offload/plugins-nextgen/host/CMakeLists.txt -index 817d128f9..286bc51cc 100644 ---- a/offload/plugins-nextgen/host/CMakeLists.txt -+++ b/offload/plugins-nextgen/host/CMakeLists.txt -@@ -1,4 +1,4 @@ --set(supported_targets x86_64 aarch64 ppc64 ppc64le s390x) -+set(supported_targets x86_64 aarch64 ppc64 ppc64le riscv64 s390x) - if(NOT ${CMAKE_SYSTEM_PROCESSOR} IN_LIST supported_targets) - message(STATUS "Not building ${machine} NextGen offloading plugin") - return() -@@ -59,4 +59,8 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x$") - list(APPEND LIBOMPTARGET_SYSTEM_TARGETS - "s390x-ibm-linux-gnu" "s390x-ibm-linux-gnu-LTO") - set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE) -+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64$") -+ list(APPEND LIBOMPTARGET_SYSTEM_TARGETS -+ "riscv64-unknown-linux-gnu" "riscv64-unknown-linux-gnu-LTO") -+ set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE) - endif() -diff --git a/offload/plugins-nextgen/host/dynamic_ffi/ffi.h b/offload/plugins-nextgen/host/dynamic_ffi/ffi.h -index 0ae025805..8b4e0286d 100644 ---- a/offload/plugins-nextgen/host/dynamic_ffi/ffi.h -+++ b/offload/plugins-nextgen/host/dynamic_ffi/ffi.h -@@ -43,7 +43,8 @@ typedef enum { - typedef enum ffi_abi { - #if (defined(_M_X64) || defined(__x86_64__)) - FFI_DEFAULT_ABI = 2, // FFI_UNIX64. --#elif defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) -+#elif defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) || \ -+ defined(__riscv) - FFI_DEFAULT_ABI = 1, // FFI_SYSV. - #elif defined(__powerpc64__) - FFI_DEFAULT_ABI = 8, // FFI_LINUX. -diff --git a/offload/plugins-nextgen/host/src/rtl.cpp b/offload/plugins-nextgen/host/src/rtl.cpp -index fe296b77c..6f2e3d860 100644 ---- a/offload/plugins-nextgen/host/src/rtl.cpp -+++ b/offload/plugins-nextgen/host/src/rtl.cpp -@@ -440,6 +440,8 @@ struct GenELF64PluginTy final : public GenericPluginTy { - #else - return llvm::Triple::ppc64; - #endif -+#elif defined(__riscv) && (__riscv_xlen == 64) -+ return llvm::Triple::riscv64; - #else - return llvm::Triple::UnknownArch; - #endif --- -2.48.1 - diff --git a/llvm-for-oE-19.1.7-2506.0.1.tar.gz b/llvm-for-oE-19.1.7-2506.0.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d1fbc1fffaefcf16f169eee1b5889cdee9f7cee3 --- /dev/null +++ b/llvm-for-oE-19.1.7-2506.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:061faff3c4557f12fdff9cfe94ddd79c72b02bed134c3f37b9669fc25963a05a +size 217538551 diff --git a/llvm-project-19.1.7.src.tar.xz b/llvm-project-19.1.7.src.tar.xz deleted file mode 100644 index bd4c99a1b3a78f671110ca7734d43fc147746dca..0000000000000000000000000000000000000000 Binary files a/llvm-project-19.1.7.src.tar.xz and /dev/null differ diff --git a/llvm-project-19.1.7.src.tar.xz.sig b/llvm-project-19.1.7.src.tar.xz.sig deleted file mode 100644 index e76e9605ced6f2f852765bc908463b142b23f70c..0000000000000000000000000000000000000000 Binary files a/llvm-project-19.1.7.src.tar.xz.sig and /dev/null differ diff --git a/llvm-toolset-19.spec b/llvm-toolset-19.spec index 50f830412f6ab92e896666b7b3f1e581fe4550d3..007242a8e2dab5153b195f37c20366049d3b1f88 100644 --- a/llvm-toolset-19.spec +++ b/llvm-toolset-19.spec @@ -36,7 +36,8 @@ %undefine __cmake_in_source_build -%global src_tarball_dir llvm-project-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}.src +%global src_tarball llvm-for-oE-19.1.7-2506.0.1 +%global src_tarball_dir llvm-project-%{src_tarball} #region LLVM globals @@ -159,14 +160,13 @@ #region main package Name: llvm-toolset-%{maj_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 8 +Release: 9 Summary: The Low Level Virtual Machine License: NCSA -URL: http://llvm.org +URL: https://gitee.com/openeuler/llvm-project -Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}/%{src_tarball_dir}.tar.xz -Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}/%{src_tarball_dir}.tar.xz.sig +Source0: https://gitee.com/openeuler/llvm-project/repository/archive/%{src_tarball}.tar.gz # CMakeLists for libcxx build %if %{os_version} == 2203 @@ -175,12 +175,8 @@ Source3: CMakeLists.txt.libomp %endif Patch0001: 0001-PATCH-clang-Don-t-install-static-libraries.patch -Patch0002: 0002-Add-triples-for-X86_64-AArch64-Riscv64-openEuler-gcc.patch -Patch0003: 0003-Always-build-shared-libs-for-LLD.patch -# backport riscv64 support for offload host plugin from llvm 20.1 -# https://github.com/llvm/llvm-project/pull/115773 -Patch0004: 0004-Offload-Add-support-for-riscv64-to-host-plugin.patch -Patch0005: 0005-PATCH-Bolt-CMake-Don-t-export-bolt-libraries-in-LLVM.patch +Patch0002: 0002-Always-build-shared-libs-for-LLD.patch +Patch0003: 0003-PATCH-Bolt-CMake-Don-t-export-bolt-libraries-in-LLVM.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -2938,9 +2934,11 @@ fi %{install_bindir}/llvm-bolt-heatmap %{install_bindir}/merge-fdata %{install_bindir}/perf2bolt +%{install_bindir}/bolt-linux-instr %{install_libdir}/libbolt_rt_hugify.a %{install_libdir}/libbolt_rt_instr.a +%{install_libdir}/libbolt_rt_instr_linux.a %if %{without sys_llvm} %{_bindir}/llvm-bolt-%{maj_ver} @@ -2951,6 +2949,7 @@ fi %{_bindir}/llvm-bolt-heatmap-%{maj_ver} %{_bindir}/merge-fdata-%{maj_ver} %{_bindir}/perf2bolt-%{maj_ver} +%{_bindir}/bolt-linux-instr-%{maj_ver} %endif %endif @@ -2959,6 +2958,10 @@ fi #endregion files %changelog +* Fri May 30 2025 liyunfei - 19.1.7-9 +- update to llvm-for-oE-19.1.7-2506.0.1 +- release-note https://gitee.com/openeuler/llvm-project/compare/cd708029e0b2869e80abe31ddb175f7c35361f90...0c7685b92302b234e353f64d6589a63051a29cea + * Fri May 16 2025 liyunfei - 19.1.7-8 - Add bolt