Compare commits
15 Commits
rawhide
...
f37-riscv6
Author | SHA1 | Date |
---|---|---|
David Abdurachmanov | b8757eaab0 | |
David Abdurachmanov | ff665e105a | |
Jesus Checa Hidalgo | d548d83311 | |
Nikita Popov | cae6588fdc | |
David Abdurachmanov | 506f1400fc | |
David Abdurachmanov | 8a49ba84d9 | |
David Abdurachmanov | 189e2a0f83 | |
David Abdurachmanov | 7a9556c15d | |
David Abdurachmanov | 18438734ba | |
David Abdurachmanov | a52497ed28 | |
David Abdurachmanov | 9e1cd27b38 | |
David Abdurachmanov | ee1b5cea88 | |
Nikita Popov | f1dbfefcca | |
Nikita Popov | a9f42b025d | |
Nikita Popov | 8f2e5101a7 |
|
@ -93,9 +93,5 @@
|
|||
/libcxx-14.0.5.src.tar.xz
|
||||
/libcxx-15.0.0.src.tar.xz
|
||||
/libcxx-15.0.0.src.tar.xz.sig
|
||||
/libcxxabi-15.0.0.src.tar.xz
|
||||
/libcxxabi-15.0.0.src.tar.xz.sig
|
||||
/libcxx-15.0.4.src.tar.xz
|
||||
/libcxx-15.0.4.src.tar.xz.sig
|
||||
/libcxxabi-15.0.4.src.tar.xz
|
||||
/libcxxabi-15.0.4.src.tar.xz.sig
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
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
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(Runtimes C CXX ASM)
|
||||
add_subdirectory(libcxxabi)
|
||||
add_subdirectory(libcxx)
|
171
libcxx.spec
171
libcxx.spec
|
@ -1,27 +1,37 @@
|
|||
# If you need to bootstrap this, turn this on.
|
||||
# Otherwise, you have a loop with libcxxabi
|
||||
%global toolchain clang
|
||||
%global bootstrap 0
|
||||
|
||||
%global libcxx_version 15.0.4
|
||||
#global rc_ver 3
|
||||
%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
|
||||
Version: %{libcxx_version}%{?rc_ver:~rc%{rc_ver}}
|
||||
Release: 1%{?dist}
|
||||
Release: 1.0.riscv64%{?dist}
|
||||
Summary: C++ standard library targeting C++11
|
||||
License: MIT or NCSA
|
||||
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
|
||||
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libcxx_version}%{?rc_ver:-rc%{rc_ver}}/%{libcxx_srcdir}.tar.xz.sig
|
||||
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
|
||||
Source2: release-keys.asc
|
||||
|
||||
BuildRequires: clang llvm-devel cmake ninja-build
|
||||
Patch0: 0001-Use-interface-library-for-libcxx-abi-shared.patch
|
||||
|
||||
BuildRequires: clang llvm-devel cmake llvm-static ninja-build
|
||||
# We need python3-devel for %%py3_shebang_fix
|
||||
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
|
||||
BuildRequires: gnupg2
|
||||
|
||||
|
@ -32,15 +42,15 @@ BuildRequires: gnupg2
|
|||
ExcludeArch: ppc64 ppc64le
|
||||
%endif
|
||||
|
||||
Requires: libcxxabi%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description
|
||||
libc++ is a new implementation of the C++ standard library, targeting C++11.
|
||||
|
||||
%package devel
|
||||
Summary: Headers and libraries for libcxx devel
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
%if %{bootstrap} < 1
|
||||
Requires: libcxxabi-devel
|
||||
%endif
|
||||
|
||||
%description devel
|
||||
%{summary}.
|
||||
|
@ -51,114 +61,115 @@ Summary: Static libraries for libcxx
|
|||
%description static
|
||||
%{summary}.
|
||||
|
||||
%package -n libcxxabi
|
||||
Summary: Low level support for a standard C++ library
|
||||
|
||||
%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: libcxxabi%{?_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}'
|
||||
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
|
||||
%autosetup -n %{libcxx_srcdir} -p2
|
||||
|
||||
%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/
|
||||
%py3_shebang_fix utils/
|
||||
|
||||
%build
|
||||
|
||||
%cmake -GNinja \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \
|
||||
%ifarch riscv64
|
||||
%define _lto_cflags %{nil}
|
||||
%endif
|
||||
|
||||
# The location of this header changed.
|
||||
if [[ -f %{_includedir}/cxxabi.h ]]; then
|
||||
LIBCXX_ABI_PATH=%{_includedir}
|
||||
else
|
||||
LIBCXX_ABI_PATH=%{_includedir}/c++/v1
|
||||
fi
|
||||
|
||||
common_cmake_flags="\
|
||||
%if 0%{?__isa_bits} == 64
|
||||
-DLIBCXX_LIBDIR_SUFFIX:STRING=64 \
|
||||
-DLIBCXXABI_LIBDIR_SUFFIX:STRING=64 \
|
||||
%endif
|
||||
%if %{bootstrap} < 1
|
||||
-DLIBCXX_CXX_ABI=system-libcxxabi \
|
||||
-DLIBCXX_CXX_ABI_INCLUDE_PATHS=$LIBCXX_ABI_PATH \
|
||||
-DPython3_EXECUTABLE=%{_bindir}/python3 \
|
||||
%endif
|
||||
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
|
||||
-DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
||||
|
||||
# Build the static libc++.a.
|
||||
# We include the libc++abi symbols.
|
||||
%cmake -GNinja \
|
||||
$common_cmake_flags \
|
||||
-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF \
|
||||
-DLIBCXX_ENABLE_STATIC=ON \
|
||||
-DLIBCXX_ENABLE_SHARED=OFF \
|
||||
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \
|
||||
-DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \
|
||||
-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON
|
||||
-DLIBCXX_CXX_ABI_LIBRARY_PATH=%{_libdir}
|
||||
|
||||
%cmake_build
|
||||
|
||||
%install
|
||||
|
||||
%cmake_install
|
||||
|
||||
# Manually link libc++.a against libc++abi.a, because the libcxx build system is currently
|
||||
# broken when system-libcxxabi is used.
|
||||
ar cqT tmp.a %{buildroot}%{_libdir}/libc++.a %{buildroot}%{_libdir}/libc++abi.a
|
||||
# Convert thin archive into normal archive.
|
||||
# Also place libc++.a into results-static so we can install it later.
|
||||
LIBCXX_A=`find $PWD -name libc++.a`
|
||||
mkdir results-static
|
||||
pushd results-static
|
||||
# Create thin archive
|
||||
ar cqT tmp.a $LIBCXX_A %{_libdir}/libc++abi.a
|
||||
# Convert into normal archive
|
||||
ar -M <<EOM
|
||||
CREATE tmp.a
|
||||
ADDLIB tmp.a
|
||||
SAVE
|
||||
END
|
||||
EOM
|
||||
mv tmp.a %{buildroot}%{_libdir}/libc++.a
|
||||
mv tmp.a libc++.a
|
||||
ranlib libc++.a
|
||||
popd
|
||||
|
||||
%cmake -GNinja \
|
||||
$common_cmake_flags \
|
||||
-DLIBCXX_STANDALONE_BUILD=ON \
|
||||
%if %{bootstrap} < 1
|
||||
-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \
|
||||
%endif
|
||||
-DLIBCXX_ENABLE_STATIC=OFF \
|
||||
-DLIBCXX_ENABLE_SHARED=ON \
|
||||
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=OFF
|
||||
|
||||
%cmake_build
|
||||
|
||||
%install
|
||||
|
||||
%cmake_install
|
||||
install results-static/libc++.a %{buildroot}/%{_libdir}
|
||||
|
||||
%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
|
||||
%license libcxx/LICENSE.TXT
|
||||
%doc libcxx/CREDITS.TXT libcxx/TODO.TXT
|
||||
%license LICENSE.TXT
|
||||
%doc CREDITS.TXT TODO.TXT
|
||||
%{_libdir}/libc++.so.*
|
||||
|
||||
%files devel
|
||||
%{_includedir}/libcxx-internal/
|
||||
%{_includedir}/c++/
|
||||
%exclude %{_includedir}/c++/v1/cxxabi.h
|
||||
%exclude %{_includedir}/c++/v1/__cxxabi_config.h
|
||||
%{_libdir}/libc++.so
|
||||
|
||||
%files static
|
||||
%license libcxx/LICENSE.TXT
|
||||
%{_libdir}/libc++.a
|
||||
%{_libdir}/libc++experimental.a
|
||||
%license LICENSE.TXT
|
||||
%{_libdir}/libc++*.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
|
||||
* Mon Nov 07 2022 Nikita Popov <npopov@redhat.com> - 15.0.4-1
|
||||
* Sun Nov 27 2022 David Abdurachmanov <davidlt@rivosinc.com> - 15.0.4-1.0.riscv664
|
||||
- Build for riscv64 (disable LTO)
|
||||
|
||||
* Tue Nov 08 2022 Nikita Popov <npopov@redhat.com> - 15.0.4-1
|
||||
- Update to LLVM 15.0.4
|
||||
|
||||
* Wed Oct 05 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-5
|
||||
- Fix libcxxabi dependencies
|
||||
|
||||
* 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
|
||||
- Rebuild
|
||||
|
||||
* Tue Sep 13 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-2
|
||||
- Link libc++.a against libc++abi.a
|
||||
|
||||
|
|
2
sources
2
sources
|
@ -1,4 +1,2 @@
|
|||
SHA512 (libcxx-15.0.4.src.tar.xz) = 4d03a945e1625d4c7293c57e5432a782deb47d701895874fa6d518c835b1f84fdf3c00076155e17e825d0c72f6faccbc1c9394183fe9ffd70fce8e1cdcb85e3a
|
||||
SHA512 (libcxx-15.0.4.src.tar.xz.sig) = 23d99a7b92e83224a6a808fad474152d3007663cb9b96bad2cb66ac153064cd949a8998dd37f0469c3a9180efd1a0f00d5827cdb2e0508fea9db0b88e20730a1
|
||||
SHA512 (libcxxabi-15.0.4.src.tar.xz) = 28d50e4a71b1badfaa97799c39a5077927b579c8d3a4d5c23908e4ee7659f04d7932aa9a7b8f6503d28d05ad42af5e5ef8e18633cfa97b63cc4a122188f9aa0b
|
||||
SHA512 (libcxxabi-15.0.4.src.tar.xz.sig) = 79664092f19feb0a7ee658557a1e5f228251c28120f75e69d04291354a3ae4cedce6533ccabe2848a5f83286760868d2b425f05796e70ceaf2685704964f6c35
|
||||
|
|
Loading…
Reference in New Issue