!3 Add libcxx-12.0.1 source code and build script
From: @lukewzh Reviewed-by: @cf-zhao Signed-off-by: @cf-zhao
This commit is contained in:
commit
e0e6e59457
35
0001-PATCH-libcxx-Remove-monorepo-requirement.patch
Normal file
35
0001-PATCH-libcxx-Remove-monorepo-requirement.patch
Normal file
@ -0,0 +1,35 @@
|
||||
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
|
||||
34
0001-libcxx-Remove-monorepo-requirement.patch
Normal file
34
0001-libcxx-Remove-monorepo-requirement.patch
Normal file
@ -0,0 +1,34 @@
|
||||
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
|
||||
BIN
libcxx-12.0.1.src.tar.xz
Normal file
BIN
libcxx-12.0.1.src.tar.xz
Normal file
Binary file not shown.
71
libcxx.spec
Normal file
71
libcxx.spec
Normal file
@ -0,0 +1,71 @@
|
||||
%global debug_package %{nil}
|
||||
|
||||
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
|
||||
|
||||
Patch0: 0001-libcxx-Remove-monorepo-requirement.patch
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: cmake
|
||||
BuildRequires: python3
|
||||
|
||||
%description
|
||||
The libcxx-devel package includes the libraries and header files for libcxx.
|
||||
|
||||
|
||||
%package devel
|
||||
Summary: Headers and libraries for libcxx devel
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
%{summary}.
|
||||
|
||||
%prep
|
||||
%autosetup -n libcxx-%{version}.src
|
||||
|
||||
%build
|
||||
mkdir -p _build
|
||||
cd _build
|
||||
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_C_COMPILER_TARGET=%{_arch} \
|
||||
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \
|
||||
%if 0%{?__isa_bits} == 64
|
||||
-DLLVM_LIBDIR_SUFFIX=64 \
|
||||
%else
|
||||
-DLLVM_LIBDIR_SUFFIX= \
|
||||
%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
|
||||
|
||||
%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
|
||||
|
||||
%files
|
||||
%{_libdir}/libc++*
|
||||
%{_prefix}/include/*
|
||||
|
||||
%files devel
|
||||
%{_includedir}/c++/
|
||||
%{_libdir}/libc++.so
|
||||
|
||||
%changelog
|
||||
* Tue Feb 7 2023 Wang Zehong <wangzehong2@huawei.com> - 12.0.1-1
|
||||
- update to 12.0.1-1
|
||||
Loading…
x
Reference in New Issue
Block a user