Initial import (fedora#2036468).
This commit is contained in:
parent
a1aa6da355
commit
76391c4526
|
@ -0,0 +1 @@
|
|||
/mold-1.0.2.tar.gz
|
|
@ -0,0 +1,42 @@
|
|||
From 03ba8f93255055adaf69984c17bcfea3b22340db Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <03ba8f93255055adaf69984c17bcfea3b22340db.1642970958.git.github@sicherha.de>
|
||||
From: Christoph Erhardt <github@sicherha.de>
|
||||
Date: Sun, 23 Jan 2022 21:42:21 +0100
|
||||
Subject: [PATCH] Fix out-of-bounds error on aarch64 with `_GLIBCXX_ASSERTIONS`
|
||||
enabled
|
||||
|
||||
While an iterator may point beyond the last element of a `std::span`, a
|
||||
pointer may not.
|
||||
|
||||
Fixes #298.
|
||||
|
||||
Signed-off-by: Christoph Erhardt <github@sicherha.de>
|
||||
---
|
||||
elf/arch-arm64.cc | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/elf/arch-arm64.cc b/elf/arch-arm64.cc
|
||||
index aba86330..c608ae49 100644
|
||||
--- a/elf/arch-arm64.cc
|
||||
+++ b/elf/arch-arm64.cc
|
||||
@@ -574,7 +574,7 @@ static void create_thunks(Context<E> &ctx, OutputSection<E> &osec) {
|
||||
thunk.offset = offset;
|
||||
|
||||
// Scan relocations between B and C to collect symbols that need thunks.
|
||||
- tbb::parallel_for_each(&members[b], &members[c], [&](InputSection<E> *isec) {
|
||||
+ tbb::parallel_for_each(members.begin() + b, members.begin() + c, [&](InputSection<E> *isec) {
|
||||
std::span<ElfRel<E>> rels = isec->get_rels(ctx);
|
||||
isec->range_extn.resize(rels.size());
|
||||
|
||||
@@ -619,7 +619,7 @@ static void create_thunks(Context<E> &ctx, OutputSection<E> &osec) {
|
||||
}
|
||||
|
||||
// Scan relocations again to fix symbol offsets in the last thunk.
|
||||
- tbb::parallel_for_each(&members[b], &members[c], [&](InputSection<E> *isec) {
|
||||
+ tbb::parallel_for_each(members.begin() + b, members.begin() + c, [&](InputSection<E> *isec) {
|
||||
std::span<ElfRel<E>> rels = isec->get_rels(ctx);
|
||||
|
||||
for (i64 i = 0; i < rels.size(); i++) {
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
From 06537164083e0af844224651bf7e7c7340a47675 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <06537164083e0af844224651bf7e7c7340a47675.1642950243.git.github@sicherha.de>
|
||||
From: Christoph Erhardt <github@sicherha.de>
|
||||
Date: Sun, 23 Jan 2022 14:28:45 +0100
|
||||
Subject: [PATCH] Pass `CXXFLAGS` to bundled tbb
|
||||
|
||||
This makes work easier for distributions that specify custom hardened
|
||||
compiler flags.
|
||||
|
||||
Signed-off-by: Christoph Erhardt <github@sicherha.de>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index e2d7cd97..913ac97a 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -147,7 +147,7 @@ $(MIMALLOC_LIB):
|
||||
|
||||
$(TBB_LIB):
|
||||
mkdir -p out/tbb
|
||||
- (cd out/tbb; cmake -G'Unix Makefiles' -DBUILD_SHARED_LIBS=OFF -DTBB_TEST=OFF -DCMAKE_CXX_FLAGS=-D__TBB_DYNAMIC_LOAD_ENABLED=0 -DTBB_STRICT=OFF ../../third-party/tbb)
|
||||
+ (cd out/tbb; cmake -G'Unix Makefiles' -DBUILD_SHARED_LIBS=OFF -DTBB_TEST=OFF -DCMAKE_CXX_FLAGS="$(CXXFLAGS) -D__TBB_DYNAMIC_LOAD_ENABLED=0" -DTBB_STRICT=OFF ../../third-party/tbb)
|
||||
$(MAKE) -C out/tbb tbb
|
||||
(cd out/tbb; ln -sf *_relwithdebinfo libs)
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
Name: mold
|
||||
Version: 1.0.2
|
||||
Release: 1%{?dist}
|
||||
Summary: A Modern Linker
|
||||
|
||||
License: AGPLv3+
|
||||
URL: https://github.com/rui314/mold
|
||||
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
# The bundled build system for tbb tries to strip all Werror from the
|
||||
# CFLAGS/CXXFLAGS when not building in strict mode (mold doesn't use strict
|
||||
# mode). We don't want that because it causes the "Werror=format-security"
|
||||
# option to become "=format-security" and break the build. (similar to a patch
|
||||
# in the Fedora tbb package)
|
||||
Patch0: tbb-strip-werror.patch
|
||||
|
||||
# Pass the system's CXXFLAGS and CFLAGS to the bundled libraries to ensure they
|
||||
# are built with all the Fedora hardening flags and with PIE (otherwise the
|
||||
# linker errors linking non-PIE code with PIE code).
|
||||
Patch1: bundled_lib_system_flags.patch
|
||||
|
||||
# Fix for failed assertion on aarch64
|
||||
Patch2: 0001-Fix-out-of-bounds-error-on-aarch64-with-_GLIBCXX_ASS.patch
|
||||
|
||||
# mold can currently produce native binaries for these architectures only
|
||||
ExclusiveArch: x86_64 %{ix86} aarch64
|
||||
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc
|
||||
%if 0%{?el7}
|
||||
BuildRequires: devtoolset-10-toolchain
|
||||
%endif
|
||||
%if 0%{?el8}
|
||||
BuildRequires: gcc-toolset-10-toolchain
|
||||
%endif
|
||||
%if 0%{!?el7} && 0%{!?el8}
|
||||
BuildRequires: gcc-c++ >= 10
|
||||
%endif
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: libdwarf-tools
|
||||
%endif
|
||||
BuildRequires: mimalloc-devel
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: xxhash-devel
|
||||
BuildRequires: zlib-devel
|
||||
|
||||
# The following packages are only required for executing the tests
|
||||
BuildRequires: clang
|
||||
BuildRequires: glibc-static
|
||||
%ifarch x86_64
|
||||
BuildRequires: glibc-static(x86-32)
|
||||
%endif
|
||||
BuildRequires: libstdc++-static
|
||||
|
||||
Requires(post): %{_sbindir}/alternatives
|
||||
Requires(preun): %{_sbindir}/alternatives
|
||||
|
||||
# API-incompatible with older tbb 2020.3 currently shipped by Fedora:
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2036372
|
||||
Provides: bundled(tbb) = 2021.3
|
||||
|
||||
%define build_args PREFIX=%{_prefix} LIBDIR=%{_libdir} CC=gcc CXX=g++ CFLAGS="%{build_cflags}" CXXFLAGS="%{build_cxxflags}" LDFLAGS="%{build_ldflags}" STRIP=echo SYSTEM_MIMALLOC=1 SYSTEM_XXHASH=1
|
||||
|
||||
%description
|
||||
mold is a multi-threaded, high-performance linker that is several times faster
|
||||
than the industry-standard ones, namely, GNU ld, GNU gold or LLVM lld. It is
|
||||
developed as a drop-in replacement for these linkers and command-line compatible
|
||||
with them with a few exceptions.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
rm -r third-party/{mimalloc,xxhash}
|
||||
|
||||
%build
|
||||
%if 0%{?el7}
|
||||
. /opt/rh/devtoolset-10/enable
|
||||
%endif
|
||||
%if 0%{?el8}
|
||||
. /opt/rh/gcc-toolset-10/enable
|
||||
%endif
|
||||
%make_build %{build_args}
|
||||
|
||||
%install
|
||||
%make_install %{build_args}
|
||||
# Overwrite absolute symlink with relative symlink
|
||||
ln -srf %{buildroot}%{_bindir}/mold %{buildroot}%{_libexecdir}/mold/ld
|
||||
chmod +x %{buildroot}%{_libdir}/mold/mold-wrapper.so
|
||||
|
||||
%post
|
||||
if [ "$1" = 1 ]; then
|
||||
%{_sbindir}/alternatives --install %{_bindir}/ld ld %{_bindir}/ld.mold 1
|
||||
fi
|
||||
|
||||
%postun
|
||||
if [ "$1" = 0 ]; then
|
||||
%{_sbindir}/alternatives --remove ld %{_bindir}/ld.mold
|
||||
fi
|
||||
|
||||
%check
|
||||
%if 0%{?el7}
|
||||
. /opt/rh/devtoolset-10/enable
|
||||
%endif
|
||||
%if 0%{?el8}
|
||||
. /opt/rh/gcc-toolset-10/enable
|
||||
%endif
|
||||
%make_build %{build_args} test
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%ghost %{_bindir}/ld
|
||||
%{_bindir}/mold
|
||||
%{_bindir}/ld.mold
|
||||
%{_bindir}/ld64.mold
|
||||
%{_libdir}/mold
|
||||
%{_libdir}/mold/mold-wrapper.so
|
||||
%{_libexecdir}/mold
|
||||
%{_libexecdir}/mold/ld
|
||||
%{_mandir}/man1/mold.1*
|
||||
|
||||
%changelog
|
||||
* Sun Jan 23 2022 Christoph Erhardt <fedora@sicherha.de> - 1.0.2-1
|
||||
- Bump version to 1.0.2.
|
||||
|
||||
* Sat Jan 01 2022 Christoph Erhardt <fedora@sicherha.de> - 1.0.1-1
|
||||
- Initial package for version 1.0.1.
|
|
@ -0,0 +1 @@
|
|||
SHA512 (mold-1.0.2.tar.gz) = 27f6664e63c76c32a6e3ec8bfc4b204138926001f5431be94da9ce47a5d9d3b51aa634c5cd6df45be660d52ac0507f7b7eec17134e35db402db5747d2ecc3715
|
|
@ -0,0 +1,16 @@
|
|||
diff --git a/third-party/tbb/cmake/compilers/GNU.cmake b/third-party/tbb/cmake/compilers/GNU.cmake
|
||||
index 902fa786..9c364803 100644
|
||||
--- a/third-party/tbb/cmake/compilers/GNU.cmake
|
||||
+++ b/third-party/tbb/cmake/compilers/GNU.cmake
|
||||
@@ -44,11 +44,6 @@ endif()
|
||||
set(TBB_COMMON_LINK_LIBS dl)
|
||||
endif()
|
||||
|
||||
-# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
|
||||
-if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
|
||||
- tbb_remove_compile_flag(-Werror)
|
||||
-endif()
|
||||
-
|
||||
if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel)
|
||||
# gcc 6.0 and later have -flifetime-dse option that controls elimination of stores done outside the object lifetime
|
||||
set(TBB_DSE_FLAG $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},6.0>>:-flifetime-dse=1>)
|
Loading…
Reference in New Issue