Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
de07953b09
!14 init for Multi-Version LLVM-18.1.8
From: @liyunfei33 
Reviewed-by: @eastb233 
Signed-off-by: @eastb233
2024-12-10 07:19:13 +00:00
liyunfei
e692b405c8 init for Multi-Version LLVM-18.1.8
Signed-off-by: liyunfei <liyunfei33@huawei.com>
2024-12-09 10:26:44 +08:00
openeuler-ci-bot
c0aa6307a6
!13 adopt to new cmake macro
From: @fundawang 
Reviewed-by: @liyunfei33 
Signed-off-by: @liyunfei33
2024-11-12 12:53:54 +00:00
Funda Wang
6a1e6f96b8 adopt to new cmake macro 2024-11-07 14:45:41 +08:00
openeuler-ci-bot
c0dd731451
!9 Add BiSheng Autotuner support
From: @liyunfei33 
Reviewed-by: @cf-zhao 
Signed-off-by: @cf-zhao
2024-08-21 03:01:21 +00:00
liyunfei
eed938d460 Add BiSheng Autotuner support
Signed-off-by: liyunfei <liyunfei33@huawei.com>
2024-08-21 09:57:03 +08:00
openeuler-ci-bot
efe24057cc
!8 Add toolchain_clang build support
From: @liyunfei33 
Reviewed-by: @cf-zhao 
Signed-off-by: @cf-zhao
2024-07-12 13:52:22 +00:00
liyunfei
e372a168c3 Add toolchain_clang build support
Signed-off-by: liyunfei <liyunfei33@huawei.com>
2024-07-08 11:27:18 +08:00
openeuler-ci-bot
1bf63d228c
!4 Update to 17.0.6
From: @zj94 
Reviewed-by: @liyunfei33, @cf-zhao 
Signed-off-by: @cf-zhao
2024-01-06 09:14:00 +00:00
zhoujing
24fc9897d4 Update to 17.0.6
1. Add libcxxabi and libunwind and build together
2. Add runtime packae due to depend on runtimes/cmake/Modules
3. Add standalone.patch
2024-01-05 14:30:33 +08:00
12 changed files with 281 additions and 111 deletions

View File

@ -1,35 +0,0 @@
From fc46c464795f965c4cdbc321058f24191af8e40c Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Tue, 11 Aug 2020 07:55:18 -0700
Subject: [PATCH] [PATCH][libcxx] Remove monorepo requirement
---
libcxx/CMakeLists.txt | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 9bf1a02..5348a15 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -1,10 +1,3 @@
-# See https://libcxx.llvm.org/docs/BuildingLibcxx.html for instructions on how
-# to build libcxx with CMake.
-
-if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../libcxxabi")
- message(FATAL_ERROR "libc++ now requires being built in a monorepo layout with libcxxabi available")
-endif()
-
#===============================================================================
# Setup Project
#===============================================================================
@@ -39,8 +32,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUIL
set(LIBCXX_STANDALONE_BUILD 1)
set(LLVM_LIT_OUTPUT_DIR "${LIBCXX_BINARY_DIR}/bin")
- # Find the LLVM sources and simulate LLVM CMake options.
- include(HandleOutOfTreeLLVM)
endif()
if (LIBCXX_STANDALONE_BUILD)
--
1.8.3.1

View File

@ -1,34 +0,0 @@
From 89a9306a9c24b192b9fac3b7498661428676af0e Mon Sep 17 00:00:00 2001
From: wangzehong <wangzehong2@huawei.com>
Date: Fri, 10 Feb 2023 09:06:21 +0800
Subject: [PATCH] Remove monorepo requirement
---
CMakeLists.txt | 5 -----
1 file changed, 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cdd5495..11fc89b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,6 @@
# See https://libcxx.llvm.org/docs/BuildingLibcxx.html for instructions on how
# to build libcxx with CMake.
-if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../libcxxabi")
- message(FATAL_ERROR "libc++ now requires being built in a monorepo layout with libcxxabi available")
-endif()
#===============================================================================
# Setup Project
@@ -39,8 +36,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUIL
set(LIBCXX_STANDALONE_BUILD 1)
set(LLVM_LIT_OUTPUT_DIR "${LIBCXX_BINARY_DIR}/bin")
- # Find the LLVM sources and simulate LLVM CMake options.
- include(HandleOutOfTreeLLVM)
endif()
if (LIBCXX_STANDALONE_BUILD)
--
2.33.1.windows.1

5
CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.13.4)
project(Runtimes C CXX ASM)
add_subdirectory(libcxxabi)
add_subdirectory(libcxx)
add_subdirectory(libunwind)

View File

@ -1,4 +1,4 @@
# libcxx
# libcxx-latest
#### Description
The libcxx is c++ libs of llvm for openEuler

View File

@ -1,4 +1,4 @@
# libcxx
# libcxx-latest
#### 介绍
The libcxx is c++ libs of llvm for openEuler

22
fedora-standalone.patch Normal file
View File

@ -0,0 +1,22 @@
From 0ef68aab2b08915b9144ffa67b3319e3e8332445 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Thu, 4 Aug 2022 12:44:15 +0200
Subject: [PATCH] Fix standalone build
---
libunwind/docs/CMakeLists.txt | 1 +
1 files changed, 1 insertions(+)
diff --git a/libunwind/docs/CMakeLists.txt b/libunwind/docs/CMakeLists.txt
index 79b87eb03b44..eaf6f3db5223 100644
--- a/libunwind/docs/CMakeLists.txt
+++ b/libunwind/docs/CMakeLists.txt
@@ -1,5 +1,6 @@
include(FindSphinx)
if (SPHINX_FOUND AND LLVM_ENABLE_SPHINX)
+ include(AddLLVM)
include(AddSphinxTarget)
if (${SPHINX_OUTPUT_HTML})
add_sphinx_target(html libunwind)
--
2.37.1

Binary file not shown.

BIN
libcxx-18.1.8.src.tar.xz Normal file

Binary file not shown.

View File

@ -1,71 +1,283 @@
%global debug_package %{nil}
%bcond_without check
%bcond_without toolchain_clang
Name: libcxx
Version: 12.0.1
Release: 1%{?dist}
Summary: LLVM "libcxx" runtime libraries
License: BSD
URL: http://llvm.org
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/libcxx-%{version}.src.tar.xz
%if %{with toolchain_clang}
%global toolchain clang
%endif
Patch0: 0001-libcxx-Remove-monorepo-requirement.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: python3
%global maj_ver 18
%global min_ver 1
%global patch_ver 8
%global libcxx_version %{maj_ver}.%{min_ver}.%{patch_ver}
%global libcxx_srcdir libcxx-%{libcxx_version}.src
%global libcxxabi_srcdir libcxxabi-%{libcxx_version}.src
%global libunwind_srcdir libunwind-%{libcxx_version}.src
%global runtimes_srcdir runtimes-%{libcxx_version}.src
%global runtimes_cmakedir %{runtimes_srcdir}/cmake/Modules
%global _scl_prefix /opt/openEuler
%{?scl:%scl_package %scl}
%{!?scl:%global scl_prefix llvm-toolset-%{maj_ver}-}
%{!?scl:%global pkg_name %{name}}
%global install_prefix %{!?scl:%{_scl_prefix}/llvm-toolset-%{maj_ver}/root}%{_prefix}
%global install_datadir %{!?scl:%{_scl_prefix}/llvm-toolset-%{maj_ver}/root}%{_datadir}
%if 0%{?__isa_bits} == 64
%global install_libdir %{install_prefix}/lib64
%else
%global install_libdir %{install_prefix}/lib
%endif
%global install_includedir %{install_prefix}/include
Name: %{?scl_prefix}libcxx
Version: %{libcxx_version}
Release: 1
Summary: LLVM "libcxx" runtime libraries
License: Apache-2.0
URL: http://llvm.org
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}/%{libcxx_srcdir}.tar.xz
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}/%{libcxxabi_srcdir}.tar.xz
Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}/%{libunwind_srcdir}.tar.xz
Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}/%{runtimes_srcdir}.tar.xz
Source4: CMakeLists.txt
Patch0: fedora-standalone.patch
%if "%toolchain" == "clang"
BuildRequires: clang
%endif
BuildRequires: %{?scl_prefix}clang cmake ninja-build
BuildRequires: %{?scl_prefix}llvm-devel = %{version}
BuildRequires: %{?scl_prefix}llvm-cmake-utils = %{version}
# We need python3-devel for %%py3_shebang_fix
BuildRequires: python3-devel
# For documentation
BuildRequires: python3-sphinx
%{?scl:Requires: %scl_runtime}
%description
The libcxx-devel package includes the libraries and header files for libcxx.
# libcxx
%package devel
Summary: Headers and libraries for libcxx devel
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{pkg_name}%{?_isa} = %{version}-%{release}
Requires: libcxxabi-devel
%description devel
%{summary}.
%package static
Summary: Static libraries for libcxx
%description static
%{summary}.
# libcxxabi
%package -n %{?scl_prefix}libcxxabi
Summary: Low level support for a standard C++ library
%description -n %{?scl_prefix}libcxxabi
libcxxabi provides low level support for a standard C++ library.
%package -n %{?scl_prefix}libcxxabi-devel
Summary: Headers and libraries for libcxxabi devel
Requires: %{?scl_prefix}libcxxabi%{?_isa} = %{version}-%{release}
%description -n %{?scl_prefix}libcxxabi-devel
%{summary}.
%package -n %{?scl_prefix}libcxxabi-static
Summary: Static libraries for libcxxabi
%description -n %{?scl_prefix}libcxxabi-static
%{summary}.
# libunwind
%package -n %{?scl_prefix}llvm-libunwind
Summary: LLVM libunwind
%description -n %{?scl_prefix}llvm-libunwind
LLVM libunwind is an implementation of the interface defined by the HP libunwind
project. It was contributed Apple as a way to enable clang++ to port to
platforms that do not have a system unwinder. It is intended to be a small and
fast implementation of the ABI, leaving off some features of HP's libunwind
that never materialized (e.g. remote unwinding).
%package -n %{?scl_prefix}llvm-libunwind-devel
Summary: LLVM libunwind development files
Provides: %{?scl_prefix}libunwind(major) = %{maj_ver}
Requires: %{?scl_prefix}llvm-libunwind%{?_isa} = %{version}-%{release}
%description -n %{?scl_prefix}llvm-libunwind-devel
Unversioned shared library for LLVM libunwind
%package -n %{?scl_prefix}llvm-libunwind-static
Summary: Static library for LLVM libunwind
%description -n %{?scl_prefix}llvm-libunwind-static
%{summary}.
%package -n %{?scl_prefix}llvm-libunwind-doc
Summary: libunwind documentation
# jquery.js and langage_data.js are used in the HTML doc and under BSD License
License: BSD AND (Apache-2.0 WITH LLVM-exception OR NCSA OR MIT)
%description -n %{?scl_prefix}llvm-libunwind-doc
Documentation for LLVM libunwind
%prep
%autosetup -n libcxx-%{version}.src
%setup -T -q -b 0 -n %{libcxx_srcdir}
%setup -T -q -b 1 -n %{libcxxabi_srcdir}
%setup -T -q -b 2 -n %{libunwind_srcdir}
%setup -T -q -b 3 -n %{runtimes_srcdir}
%setup -T -c -n build
cp %{SOURCE4} .
mv ../%{libcxx_srcdir} libcxx
mv ../%{libcxxabi_srcdir} libcxxabi
mv ../%{libunwind_srcdir} libunwind
mkdir -p runtimes/cmake/Modules
cp ../%{runtimes_cmakedir}/HandleFlags.cmake runtimes/cmake/Modules/
cp ../%{runtimes_cmakedir}/WarningFlags.cmake runtimes/cmake/Modules/
%autopatch -p1
#%py3_shebang_fix libcxx/utils/
%build
mkdir -p _build
cd _build
# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files.
export ASMFLAGS=$CFLA
cmake \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER_TARGET=%{_arch} \
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \
%cmake -GNinja \
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
-DLLVM_COMMON_CMAKE_UTILS=%{install_datadir}/llvm/cmake \
-DLLVM_MAIN_SRC_DIR=%{install_prefix}/src \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_MODULE_PATH="%{install_libdir}/cmake/llvm;%{install_datadir}/llvm/cmake/Modules" \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
%if 0%{?__isa_bits} == 64
-DLLVM_LIBDIR_SUFFIX=64 \
%else
-DLLVM_LIBDIR_SUFFIX= \
-DLIBCXX_LIBDIR_SUFFIX:STRING=64 \
-DLIBCXXABI_LIBDIR_SUFFIX:STRING=64 \
-DLIBUNWIND_LIBDIR_SUFFIX:STRING=64 \
%endif
..
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
-DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \
-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
-DLLVM_BUILD_DOCS=ON \
-DLLVM_ENABLE_SPHINX=ON \
-DLIBUNWIND_INCLUDE_DOCS=ON \
-DLIBUNWIND_INSTALL_INCLUDE_DIR=%{install_includedir}/llvm-libunwind \
-DLIBUNWIND_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html \
%if "%{toolchain}" == "clang"
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
%endif
..
%make_build
# Copy result libc++.a
mkdir results-static
find . -name libc++.a -exec cp {} ./results-static \;
cp ../src/include/atomic_support.h include/c++/v1
cp ../src/include/refstring.h include/c++/v1
%ninja_build
%install
cd _build
%make_install
install results-static/libc++.a %{buildroot}/%{_libdir}
install include/c++/v1/atomic_support.h %{buildroot}/%{_libdir}/../include/c++/v1
install include/c++/v1/refstring.h %{buildroot}/%{_libdir}/../include/c++/v1
%ninja_install
# We can't install the unversionned path on default location because that would conflict with
# https://src.fedoraproject.org/rpms/libunwind
#
# The versionned path has a different soname (libunwind.so.1 compared to
# libunwind.so.8) so they can live together in %%{_libdir}
#
# ABI wise, even though llvm-libunwind's library is named libunwind, it doesn't
# have the exact same ABI as gcc's libunwind (it actually provides a subset).
rm %{buildroot}%{install_libdir}/libunwind.so
mkdir -p %{buildroot}/%{install_libdir}/llvm-unwind/
pushd %{buildroot}/%{install_libdir}/llvm-unwind
ln -s ../libunwind.so.1.0 libunwind.so
popd
rm %{buildroot}%{_pkgdocdir}/html/.buildinfo
%ldconfig_scriptlets
%files
%{_libdir}/libc++*
%{_prefix}/include/*
%license libcxx/LICENSE.TXT
%doc libcxx/CREDITS.TXT libcxx/TODO.TXT
%{install_libdir}/libc++.so.*
%files devel
%{_includedir}/c++/
%{_libdir}/libc++.so
%{install_includedir}/c++/
%exclude %{install_includedir}/c++/v1/cxxabi.h
%exclude %{install_includedir}/c++/v1/__cxxabi_config.h
%{install_libdir}/libc++.so
%files static
%license libcxx/LICENSE.TXT
%{install_libdir}/libc++.a
%{install_libdir}/libc++experimental.a
%files -n %{?scl_prefix}libcxxabi
%license libcxxabi/LICENSE.TXT
%doc libcxxabi/CREDITS.TXT
%{install_libdir}/libc++abi.so.*
%files -n %{?scl_prefix}libcxxabi-devel
%{install_includedir}/c++/v1/cxxabi.h
%{install_includedir}/c++/v1/__cxxabi_config.h
%{install_libdir}/libc++abi.so
%files -n %{?scl_prefix}libcxxabi-static
%{install_libdir}/libc++abi.a
%files -n %{?scl_prefix}llvm-libunwind
%license libunwind/LICENSE.TXT
%{install_libdir}/libunwind.so.1
%{install_libdir}/libunwind.so.1.0
%files -n %{?scl_prefix}llvm-libunwind-devel
%{install_includedir}/llvm-libunwind/__libunwind_config.h
%{install_includedir}/llvm-libunwind/libunwind.h
%{install_includedir}/llvm-libunwind/libunwind.modulemap
%{install_includedir}/llvm-libunwind/mach-o/compact_unwind_encoding.h
%{install_includedir}/llvm-libunwind/mach-o/compact_unwind_encoding.modulemap
%{install_includedir}/llvm-libunwind/unwind.h
%{install_includedir}/llvm-libunwind/unwind_arm_ehabi.h
%{install_includedir}/llvm-libunwind/unwind_itanium.h
%dir %{install_libdir}/llvm-unwind
%{install_libdir}/llvm-unwind/libunwind.so
%files -n %{?scl_prefix}llvm-libunwind-static
%{install_libdir}/libunwind.a
%files -n %{?scl_prefix}llvm-libunwind-doc
%license libunwind/LICENSE.TXT
%doc %{_pkgdocdir}/html
%changelog
* Fri Dec 6 2024 liyunfei <liyunfei33@huawei.com> - 18.1.8-1
- init for Multi-Version LLVM-18.1.8
* Thu Nov 07 2024 Funda Wang <fundawang@yeah.net> - 17.0.6-4
- adopt to new cmake macro
- force out-of-source build
* Tue Aug 20 2024 liyunfei <liyunfei33@huawei.com> - 17.0.6-3
- Add BiSheng Autotuner support.
* Fri Jul 5 2024 liyunfei <liyunfei33@huawei.com> - 17.0.6-2
- Add toolchain_clang build support
* Tue Dec 5 2023 zhoujing <zhoujing106@huawei.com> - 17.0.6-1
- update to 17.0.6
* Tue Feb 7 2023 Wang Zehong <wangzehong2@huawei.com> - 12.0.1-1
- update to 12.0.1-1

BIN
libcxxabi-18.1.8.src.tar.xz Normal file

Binary file not shown.

BIN
libunwind-18.1.8.src.tar.xz Normal file

Binary file not shown.

BIN
runtimes-18.1.8.src.tar.xz Normal file

Binary file not shown.