-
Notifications
You must be signed in to change notification settings - Fork 0
/
mold.spec
196 lines (157 loc) · 5.54 KB
/
mold.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
Name: mold
Version: 1.10.0
Release: 1%{?dist}
Summary: A Modern Linker
License: AGPL-3.0-or-later AND (Apache-2.0 OR MIT)
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
# Allow building against the system-provided `xxhash.h`
Patch1: 0001-Use-system-compatible-include-path-for-xxhash.h.patch
# Fix out-of-bounds memory access (https://github.com/rui314/mold/issues/969)
Patch2: 0002-Fix-out-of-bound-memory-access.patch
# mold currently cannot produce native binaries for MIPS
ExcludeArch: %{mips}
BuildRequires: cmake
%if 0%{?el8}
BuildRequires: gcc-toolset-12
%else
BuildRequires: gcc
BuildRequires: gcc-c++ >= 10
%endif
BuildRequires: libzstd-devel
BuildRequires: mimalloc-devel
BuildRequires: openssl-devel
BuildRequires: xxhash-devel
BuildRequires: zlib-devel
# Required by bundled oneTBB
BuildRequires: hwloc-devel
# The following packages are only required for executing the tests
BuildRequires: clang
BuildRequires: gdb
BuildRequires: glibc-static
%if ! 0%{?el8}
%ifarch x86_64
BuildRequires: /usr/lib/libc.so
%endif
BuildRequires: libdwarf-tools
%endif
BuildRequires: libstdc++-static
BuildRequires: llvm
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.5
%description
mold is a faster drop-in replacement for existing Unix linkers.
It is several times faster than the LLVM lld linker.
mold is designed to increase developer productivity by reducing
build time, especially in rapid debug-edit-rebuild cycles.
%prep
%autosetup -p1
rm -r third-party/{mimalloc,xxhash,zlib,zstd}
%build
%if 0%{?el8}
. /opt/rh/gcc-toolset-12/enable
%endif
%cmake -DMOLD_USE_SYSTEM_MIMALLOC=ON
%cmake_build
%install
%cmake_install
%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%{?el8}
. /opt/rh/gcc-toolset-12/enable
%endif
%ctest
%files
%license %{_docdir}/mold/LICENSE
%ghost %{_bindir}/ld
%{_bindir}/mold
%{_bindir}/ld.mold
%{_libdir}/mold/mold-wrapper.so
%{_libexecdir}/mold/ld
%{_mandir}/man1/ld.mold.1*
%{_mandir}/man1/mold.1*
%changelog
* Sat Jan 21 2023 Christoph Erhardt <fedora@sicherha.de> - 1.10.0-1
- Bump version to 1.10.0
- Refresh patch
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jan 06 2023 Christoph Erhardt <fedora@sicherha.de> - 1.9.0-1
- Bump version to 1.9.0
- Don't enforce out-of-source build since the `inttypes.h` collision is resolved
* Mon Dec 26 2022 Christoph Erhardt <fedora@sicherha.de> - 1.8.0-1
- Bump version to 1.8.0
- Drop upstreamed patch
- Refresh patch
* Sat Nov 19 2022 Christoph Erhardt <fedora@sicherha.de> - 1.7.1-1
- Bump version to 1.7.1
* Fri Nov 18 2022 Christoph Erhardt <fedora@sicherha.de> - 1.7.0-1
- Bump version to 1.7.0
- Drop upstreamed patches
- Move from `ExclusiveArch` to `ExcludeArch` as only MIPS remains unsupported
- Build with GCC 12 on el8
* Sat Oct 22 2022 Christoph Erhardt <fedora@sicherha.de> - 1.6.0-1
- Bump version to 1.6.0
- Add new supported architectures
- Drop upstreamed patch
* Thu Sep 29 2022 Christoph Erhardt <fedora@sicherha.de> - 1.5.1-1
- Bump version to 1.5.1 (#2130132)
- Switch to CMake build
- Remove obsolete dependencies
- Add new supported architectures
- Refresh patch
* Sun Sep 04 2022 Christoph Erhardt <fedora@sicherha.de> - 1.4.2-1
- Bump version to 1.4.2
- Refresh patch
* Thu Aug 18 2022 Christoph Erhardt <fedora@sicherha.de> - 1.4.1-1
- Bump version to 1.4.1 (#2119324)
- Refresh patch
- Remove superfluous directory entries from `%%files`
* Sun Aug 07 2022 Christoph Erhardt <fedora@sicherha.de> - 1.4.0-1
- Bump version to 1.4.0 (#2116004)
- Refresh patch
- Use SPDX notation for `License:` field
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sun Jul 03 2022 Christoph Erhardt <fedora@sicherha.de> - 1.3.1-1
- Bump version to 1.3.1 (#2103365)
* Sat Jun 18 2022 Christoph Erhardt <fedora@sicherha.de> - 1.3.0-1
- Bump version to 1.3.0 (#2098316)
- Drop upstreamed patches
* Sat Apr 30 2022 Christoph Erhardt <fedora@sicherha.de> - 1.2.1-1
- Bump version to 1.2.1
- Drop upstreamed patch
- Add support for 32-bit x86 and Arm
* Sat Apr 16 2022 Christoph Erhardt <fedora@sicherha.de> - 1.2-1
- Bump version to 1.2
- Drop upstreamed patches
- Set correct version of bundled tbb
- Suppress 'comparison between signed and unsigned' warnings
* Tue Mar 08 2022 Christoph Erhardt <fedora@sicherha.de> - 1.1.1-1
- Bump version to 1.1.1
* Mon Feb 21 2022 Christoph Erhardt <fedora@sicherha.de> - 1.1-1
- Bump version to 1.1
- Drop upstreamed patches
- Update description
* Thu Feb 17 2022 Christoph Erhardt <fedora@sicherha.de> - 1.0.2-2
- Rebuild due to mimalloc soname change
* 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.