Combine with libcxxabi build
This commit is contained in:
parent
67e331f762
commit
18977449c9
|
@ -93,3 +93,5 @@
|
||||||
/libcxx-14.0.5.src.tar.xz
|
/libcxx-14.0.5.src.tar.xz
|
||||||
/libcxx-15.0.0.src.tar.xz
|
/libcxx-15.0.0.src.tar.xz
|
||||||
/libcxx-15.0.0.src.tar.xz.sig
|
/libcxx-15.0.0.src.tar.xz.sig
|
||||||
|
/libcxxabi-15.0.0.src.tar.xz
|
||||||
|
/libcxxabi-15.0.0.src.tar.xz.sig
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
From e844d6741aba16cf8b9371bbcd6607b9d7992da3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Nikita Popov <npopov@redhat.com>
|
|
||||||
Date: Fri, 9 Sep 2022 11:15:53 +0200
|
|
||||||
Subject: [PATCH] Use interface library for libcxx-abi-shared
|
|
||||||
|
|
||||||
The libc++.so linker script generation uses the IMPORTED_LIBNAME
|
|
||||||
target property on libcxx-abi-shared. However, libcxx-abi-shared
|
|
||||||
is not an interface library and as such cannot have an
|
|
||||||
IMPORTED_LIBNAME target property.
|
|
||||||
|
|
||||||
Converted libcxx-abi-shared into an imported interface library
|
|
||||||
and use IMPORTED_LIBNAME in place of IMPORTED_LOCATION. This makes
|
|
||||||
linker script generation work correctly with system-libcxxabi.
|
|
||||||
---
|
|
||||||
libcxx/cmake/Modules/HandleLibCXXABI.cmake | 13 +++++++++----
|
|
||||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libcxx/cmake/Modules/HandleLibCXXABI.cmake b/libcxx/cmake/Modules/HandleLibCXXABI.cmake
|
|
||||||
index e77a4156071b..c390c589617a 100644
|
|
||||||
--- a/libcxx/cmake/Modules/HandleLibCXXABI.cmake
|
|
||||||
+++ b/libcxx/cmake/Modules/HandleLibCXXABI.cmake
|
|
||||||
@@ -79,6 +79,11 @@ function(imported_library target kind path name)
|
|
||||||
set_target_properties(${target} PROPERTIES IMPORTED_LOCATION "${file}")
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
+function(interface_library target name)
|
|
||||||
+ add_library(${target} INTERFACE IMPORTED GLOBAL)
|
|
||||||
+ set_target_properties(${target} PROPERTIES IMPORTED_LIBNAME "${name}")
|
|
||||||
+endfunction()
|
|
||||||
+
|
|
||||||
# Link against a system-provided libstdc++
|
|
||||||
if ("${LIBCXX_CXX_ABI}" STREQUAL "libstdc++")
|
|
||||||
add_library(libcxx-abi-headers INTERFACE)
|
|
||||||
@@ -86,7 +91,7 @@ if ("${LIBCXX_CXX_ABI}" STREQUAL "libstdc++")
|
|
||||||
"cxxabi.h;bits/c++config.h;bits/os_defines.h;bits/cpu_defines.h;bits/cxxabi_tweaks.h;bits/cxxabi_forced.h")
|
|
||||||
target_compile_definitions(libcxx-abi-headers INTERFACE "-DLIBSTDCXX" "-D__GLIBCXX__")
|
|
||||||
|
|
||||||
- imported_library(libcxx-abi-shared SHARED "${LIBCXX_CXX_ABI_LIBRARY_PATH}" stdc++)
|
|
||||||
+ interface_library(libcxx-abi-shared stdc++)
|
|
||||||
target_link_libraries(libcxx-abi-shared INTERFACE libcxx-abi-headers)
|
|
||||||
|
|
||||||
imported_library(libcxx-abi-static STATIC "${LIBCXX_CXX_ABI_LIBRARY_PATH}" stdc++)
|
|
||||||
@@ -99,7 +104,7 @@ elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libsupc++")
|
|
||||||
"cxxabi.h;bits/c++config.h;bits/os_defines.h;bits/cpu_defines.h;bits/cxxabi_tweaks.h;bits/cxxabi_forced.h")
|
|
||||||
target_compile_definitions(libcxx-abi-headers INTERFACE "-D__GLIBCXX__")
|
|
||||||
|
|
||||||
- imported_library(libcxx-abi-shared SHARED "${LIBCXX_CXX_ABI_LIBRARY_PATH}" supc++)
|
|
||||||
+ interface_library(libcxx-abi-shared supc++)
|
|
||||||
target_link_libraries(libcxx-abi-shared INTERFACE libcxx-abi-headers)
|
|
||||||
|
|
||||||
imported_library(libcxx-abi-static STATIC "${LIBCXX_CXX_ABI_LIBRARY_PATH}" supc++)
|
|
||||||
@@ -133,7 +138,7 @@ elseif ("${LIBCXX_CXX_ABI}" STREQUAL "system-libcxxabi")
|
|
||||||
import_private_headers(libcxx-abi-headers "${LIBCXX_CXX_ABI_INCLUDE_PATHS}" "cxxabi.h;__cxxabi_config.h")
|
|
||||||
target_compile_definitions(libcxx-abi-headers INTERFACE "-DLIBCXX_BUILDING_LIBCXXABI")
|
|
||||||
|
|
||||||
- imported_library(libcxx-abi-shared SHARED "${LIBCXX_CXX_ABI_LIBRARY_PATH}" c++abi)
|
|
||||||
+ interface_library(libcxx-abi-shared c++abi)
|
|
||||||
target_link_libraries(libcxx-abi-shared INTERFACE libcxx-abi-headers)
|
|
||||||
|
|
||||||
imported_library(libcxx-abi-static STATIC "${LIBCXX_CXX_ABI_LIBRARY_PATH}" c++abi)
|
|
||||||
@@ -154,7 +159,7 @@ elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxrt")
|
|
||||||
"cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h")
|
|
||||||
target_compile_definitions(libcxx-abi-headers INTERFACE "-DLIBCXXRT")
|
|
||||||
|
|
||||||
- imported_library(libcxx-abi-shared SHARED "${LIBCXX_CXX_ABI_LIBRARY_PATH}" cxxrt)
|
|
||||||
+ interface_library(libcxx-abi-shared cxxrt)
|
|
||||||
target_link_libraries(libcxx-abi-shared INTERFACE libcxx-abi-headers)
|
|
||||||
|
|
||||||
imported_library(libcxx-abi-static STATIC "${LIBCXX_CXX_ABI_LIBRARY_PATH}" cxxrt)
|
|
||||||
--
|
|
||||||
2.37.2
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
cmake_minimum_required(VERSION 3.13.4)
|
||||||
|
project(Runtimes C CXX ASM)
|
||||||
|
add_subdirectory(libcxxabi)
|
||||||
|
add_subdirectory(libcxx)
|
107
libcxx.spec
107
libcxx.spec
|
@ -1,37 +1,27 @@
|
||||||
# If you need to bootstrap this, turn this on.
|
|
||||||
# Otherwise, you have a loop with libcxxabi
|
|
||||||
%global toolchain clang
|
%global toolchain clang
|
||||||
%global bootstrap 0
|
|
||||||
|
|
||||||
%global libcxx_version 15.0.0
|
%global libcxx_version 15.0.0
|
||||||
#global rc_ver 3
|
#global rc_ver 3
|
||||||
%global libcxx_srcdir libcxx-%{libcxx_version}%{?rc_ver:rc%{rc_ver}}.src
|
%global libcxx_srcdir libcxx-%{libcxx_version}%{?rc_ver:rc%{rc_ver}}.src
|
||||||
|
%global libcxxabi_srcdir libcxxabi-%{libcxx_version}%{?rc_ver:rc%{rc_ver}}.src
|
||||||
|
|
||||||
Name: libcxx
|
Name: libcxx
|
||||||
Version: %{libcxx_version}%{?rc_ver:~rc%{rc_ver}}
|
Version: %{libcxx_version}%{?rc_ver:~rc%{rc_ver}}
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: C++ standard library targeting C++11
|
Summary: C++ standard library targeting C++11
|
||||||
License: MIT or NCSA
|
License: MIT or NCSA
|
||||||
URL: http://libcxx.llvm.org/
|
URL: http://libcxx.llvm.org/
|
||||||
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxx_srcdir}.tar.xz
|
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxx_srcdir}.tar.xz
|
||||||
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxx_srcdir}.tar.xz.sig
|
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxx_srcdir}.tar.xz.sig
|
||||||
Source2: release-keys.asc
|
Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxxabi_srcdir}.tar.xz
|
||||||
|
Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxxabi_srcdir}.tar.xz.sig
|
||||||
|
Source4: release-keys.asc
|
||||||
|
Source5: CMakeLists.txt
|
||||||
|
|
||||||
Patch0: 0001-Use-interface-library-for-libcxx-abi-shared.patch
|
BuildRequires: clang llvm-devel cmake ninja-build
|
||||||
|
|
||||||
BuildRequires: clang llvm-devel cmake llvm-static ninja-build
|
|
||||||
# We need python3-devel for %%py3_shebang_fix
|
# We need python3-devel for %%py3_shebang_fix
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
|
|
||||||
# The static libc++ links the static abi library in as well
|
|
||||||
BuildRequires: libcxxabi-static
|
|
||||||
BuildRequires: libcxxabi-devel
|
|
||||||
|
|
||||||
%if %{bootstrap} < 1
|
|
||||||
BuildRequires: python3
|
|
||||||
%endif
|
|
||||||
|
|
||||||
|
|
||||||
# For origin certification
|
# For origin certification
|
||||||
BuildRequires: gnupg2
|
BuildRequires: gnupg2
|
||||||
|
|
||||||
|
@ -48,9 +38,7 @@ libc++ is a new implementation of the C++ standard library, targeting C++11.
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Headers and libraries for libcxx devel
|
Summary: Headers and libraries for libcxx devel
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
%if %{bootstrap} < 1
|
|
||||||
Requires: libcxxabi-devel
|
Requires: libcxxabi-devel
|
||||||
%endif
|
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
%{summary}.
|
%{summary}.
|
||||||
|
@ -61,32 +49,47 @@ Summary: Static libraries for libcxx
|
||||||
%description static
|
%description static
|
||||||
%{summary}.
|
%{summary}.
|
||||||
|
|
||||||
%prep
|
%package -n libcxxabi
|
||||||
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
|
Summary: Low level support for a standard C++ library
|
||||||
%autosetup -n %{libcxx_srcdir} -p2
|
|
||||||
|
|
||||||
%py3_shebang_fix utils/
|
%description -n libcxxabi
|
||||||
|
libcxxabi provides low level support for a standard C++ library.
|
||||||
|
|
||||||
|
%package -n libcxxabi-devel
|
||||||
|
Summary: Headers and libraries for libcxxabi devel
|
||||||
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description -n libcxxabi-devel
|
||||||
|
%{summary}.
|
||||||
|
|
||||||
|
%package -n libcxxabi-static
|
||||||
|
Summary: Static libraries for libcxxabi
|
||||||
|
|
||||||
|
%description -n libcxxabi-static
|
||||||
|
%{summary}.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
|
||||||
|
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE2}'
|
||||||
|
|
||||||
|
%setup -T -q -b 0 -n %{libcxx_srcdir}
|
||||||
|
%setup -T -q -b 2 -n %{libcxxabi_srcdir}
|
||||||
|
%setup -T -c -n build
|
||||||
|
|
||||||
|
cp %{SOURCE5} .
|
||||||
|
mv ../%{libcxx_srcdir} libcxx
|
||||||
|
mv ../%{libcxxabi_srcdir} libcxxabi
|
||||||
|
|
||||||
|
%py3_shebang_fix libcxx/utils/
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
# The location of this header changed.
|
|
||||||
if [[ -f %{_includedir}/cxxabi.h ]]; then
|
|
||||||
LIBCXX_ABI_PATH=%{_includedir}
|
|
||||||
else
|
|
||||||
LIBCXX_ABI_PATH=%{_includedir}/c++/v1
|
|
||||||
fi
|
|
||||||
|
|
||||||
%cmake -GNinja \
|
%cmake -GNinja \
|
||||||
-DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \
|
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
|
-DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \
|
||||||
%if 0%{?__isa_bits} == 64
|
%if 0%{?__isa_bits} == 64
|
||||||
-DLIBCXX_LIBDIR_SUFFIX:STRING=64 \
|
-DLIBCXX_LIBDIR_SUFFIX:STRING=64 \
|
||||||
%endif
|
-DLIBCXXABI_LIBDIR_SUFFIX:STRING=64 \
|
||||||
%if %{bootstrap} < 1
|
|
||||||
-DLIBCXX_CXX_ABI=system-libcxxabi \
|
|
||||||
-DLIBCXX_CXX_ABI_INCLUDE_PATHS=$LIBCXX_ABI_PATH \
|
|
||||||
-DLIBCXX_CXX_ABI_LIBRARY_PATH=%{_libdir} \
|
|
||||||
-DPython3_EXECUTABLE=%{_bindir}/python3 \
|
|
||||||
%endif
|
%endif
|
||||||
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
|
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
|
||||||
-DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \
|
-DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \
|
||||||
|
@ -100,7 +103,7 @@ fi
|
||||||
|
|
||||||
# Manually link libc++.a against libc++abi.a, because the libcxx build system is currently
|
# Manually link libc++.a against libc++abi.a, because the libcxx build system is currently
|
||||||
# broken when system-libcxxabi is used.
|
# broken when system-libcxxabi is used.
|
||||||
ar cqT tmp.a %{buildroot}%{_libdir}/libc++.a %{_libdir}/libc++abi.a
|
ar cqT tmp.a %{buildroot}%{_libdir}/libc++.a %{buildroot}%{_libdir}/libc++abi.a
|
||||||
# Convert thin archive into normal archive.
|
# Convert thin archive into normal archive.
|
||||||
ar -M <<EOM
|
ar -M <<EOM
|
||||||
CREATE tmp.a
|
CREATE tmp.a
|
||||||
|
@ -112,27 +115,39 @@ mv tmp.a %{buildroot}%{_libdir}/libc++.a
|
||||||
|
|
||||||
%ldconfig_scriptlets
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
# Install header files that libcxxabi needs
|
|
||||||
mkdir -p %{buildroot}%{_includedir}/libcxx-internal/
|
|
||||||
install -m 0644 src/include/*.h %{buildroot}%{_includedir}/libcxx-internal/
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE.TXT
|
%license libcxx/LICENSE.TXT
|
||||||
%doc CREDITS.TXT TODO.TXT
|
%doc libcxx/CREDITS.TXT libcxx/TODO.TXT
|
||||||
%{_libdir}/libc++.so.*
|
%{_libdir}/libc++.so.*
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_includedir}/libcxx-internal/
|
|
||||||
%{_includedir}/c++/
|
%{_includedir}/c++/
|
||||||
|
%exclude %{_includedir}/c++/v1/cxxabi.h
|
||||||
|
%exclude %{_includedir}/c++/v1/__cxxabi_config.h
|
||||||
%{_libdir}/libc++.so
|
%{_libdir}/libc++.so
|
||||||
|
|
||||||
%files static
|
%files static
|
||||||
%license LICENSE.TXT
|
%license libcxx/LICENSE.TXT
|
||||||
%{_libdir}/libc++.a
|
%{_libdir}/libc++.a
|
||||||
%{_libdir}/libc++experimental.a
|
%{_libdir}/libc++experimental.a
|
||||||
|
|
||||||
|
%files -n libcxxabi
|
||||||
|
%license libcxxabi/LICENSE.TXT
|
||||||
|
%doc libcxxabi/CREDITS.TXT
|
||||||
|
%{_libdir}/libc++abi.so.*
|
||||||
|
|
||||||
|
%files -n libcxxabi-devel
|
||||||
|
%{_includedir}/c++/v1/cxxabi.h
|
||||||
|
%{_includedir}/c++/v1/__cxxabi_config.h
|
||||||
|
%{_libdir}/libc++abi.so
|
||||||
|
|
||||||
|
%files -n libcxxabi-static
|
||||||
|
%{_libdir}/libc++abi.a
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Oct 05 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-4
|
||||||
|
- Combine with libcxxabi build
|
||||||
|
|
||||||
* Tue Sep 13 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-3
|
* Tue Sep 13 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-3
|
||||||
- Rebuild
|
- Rebuild
|
||||||
|
|
||||||
|
|
2
sources
2
sources
|
@ -1,2 +1,4 @@
|
||||||
SHA512 (libcxx-15.0.0.src.tar.xz) = bfc8dcde5f89d3890e32579b2f894075b49bd8e50633b7bb2469864ddf26afb42ff65201e476451eeeaf5f15235891e8031979d78e3b30a3d641bfc85adbbaad
|
SHA512 (libcxx-15.0.0.src.tar.xz) = bfc8dcde5f89d3890e32579b2f894075b49bd8e50633b7bb2469864ddf26afb42ff65201e476451eeeaf5f15235891e8031979d78e3b30a3d641bfc85adbbaad
|
||||||
SHA512 (libcxx-15.0.0.src.tar.xz.sig) = d038afbcd143fcfdea4033e37771aa659b95519e74bc0cd55537085a9ce68d2b5f471db2ad2567766ada7bf82d3014c36f55461e2847efa48a688334eaf2b11a
|
SHA512 (libcxx-15.0.0.src.tar.xz.sig) = d038afbcd143fcfdea4033e37771aa659b95519e74bc0cd55537085a9ce68d2b5f471db2ad2567766ada7bf82d3014c36f55461e2847efa48a688334eaf2b11a
|
||||||
|
SHA512 (libcxxabi-15.0.0.src.tar.xz) = fff6563f4c3d204a6f7a9c95358d109a52c57ffa7e60a9255f3357f6065dedf9644af9d9be2fbc3a319e385499da05f89af634475a2736e83325ec210499043b
|
||||||
|
SHA512 (libcxxabi-15.0.0.src.tar.xz.sig) = 64a51f78c9da013570dbff0d18f75eaf71fb98998069d1f1424f467e3e7ec239a306f79cd73a21b7e5ae0763bc9de356742cd3d4929889a987d879ac1c3e2a26
|
||||||
|
|
Loading…
Reference in New Issue