mold/mold.spec

116 lines
3.0 KiB
RPMSpec
Raw Normal View History

#
# spec file for package mold
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
Accepting request 943544 from devel:gcc - Start using %{_libexecdir} as an installation location. - Remove quotationsmarks from build_args as it prevented the use of system packages for TBB and xxHash. - Drop configure-fix.patch as xxHash is used from system package, so we don't need to patch the wrong configuration of xxHash. - Use telling name of source tarball, adjust GitHub url to have matching names. - Update to version 1.0.1: * make install now creates /usr/local/libexec/mold/ld as a symlink to the mold executable. We do this for GCC. By passing -B/usr/local/libexec/mold, you can tell GCC to use ld inside that directory instead of /usr/bin/ld. (e8dcecf) * xxHash library is now included in the mold's source tree as a subtree for ease of building. If you want to link against a libxxhash in a system library directory, pass SYSTEM_XXHASH=1 to make. (665bffa) * The extern "C++" directive is now supported in the dynamic list. (7aa5c39) * --color-diagnostics is supported. mold used to ignore that flag. (6e290aa) * Not only * but also ? are now treated as special characters in the version script wildcard pattern. (31b0248) * The --threads=N option has been added as an alias for --thread-count=N. (f9ff048) * The following option has been added: --defsym (f6e8006), -z nodefaultlib (8c86c28), -z separate-code, -z noseparate-code and -z separate-lodable-segments (5601cf4), -z max-page-size (f3766cd) - Add workaround patch configure-fix.patch. OBS-URL: https://build.opensuse.org/request/show/943544 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mold?expand=0&rev=3
2022-01-04 18:37:29 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: mold
- Update to version 2.4.0 * mold gained the --spare-program-headers=<number> option, which adds a specified number of spare entries at the end of the program header. The option aims to make post-processing tools to add program header entries very easily. Note that sorting program header entries after adding new ones may be necessary to meet the constraints of the ELF file format. For details, see the elf(5) man page. (eb6c213) * mold's -z rewrite-endbr option rewrites superflous endbr64 instructions with nop as a countermeasure against control-flow highjacking attacks. Previously, this worked exclusively with object files compiled with -ffunction-sections, requiring each function to be compiled into a separate section. Starting from this release, -z rewrite-endbr works on object files compiled without it. In other words, mold is now capable of rewriting endbr64 instructions even if the instruction is not at the beginning of a section. (3cb8a52) * Previously, mold couldn't handle object files containing multiple .eh_frame sections. The .eh_frame is a section containing data for exception handling. Usually, an object file contains only one .eh_frame which describes how to handle exceptions for all text sections in the same file. However, on rare conditions, it seems ld -r creates an object file containing multiple .eh_frame sections. mold is now able to handle such object files. (f4c5a8a) * mold -run <command> is an easy way to run the given command with a virtual environment in which the ld command is replaced with mold. The feature is implemented using LD_PRELOAD to hook fork(2)-family functions. Before this release, some invocations of ld were not intercepted correctly because we missed the posix_spawnp(2) function. Now, the function is intercepted just like other fork(2)-family functions. (3fd1cec) * mold used to produce a non-working executable on a rare occasion when all thread-local variables lacked an initial value and the read-only data required alignment equal to or greater than the page size. This bug has been resolved. (de7d37e) OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/mold?expand=0&rev=110
2023-11-30 05:37:22 +00:00
Version: 2.4.0
Release: 0
Summary: A Modern Linker (mold)
License: MIT
Group: Development/Tools/Building
Accepting request 943544 from devel:gcc - Start using %{_libexecdir} as an installation location. - Remove quotationsmarks from build_args as it prevented the use of system packages for TBB and xxHash. - Drop configure-fix.patch as xxHash is used from system package, so we don't need to patch the wrong configuration of xxHash. - Use telling name of source tarball, adjust GitHub url to have matching names. - Update to version 1.0.1: * make install now creates /usr/local/libexec/mold/ld as a symlink to the mold executable. We do this for GCC. By passing -B/usr/local/libexec/mold, you can tell GCC to use ld inside that directory instead of /usr/bin/ld. (e8dcecf) * xxHash library is now included in the mold's source tree as a subtree for ease of building. If you want to link against a libxxhash in a system library directory, pass SYSTEM_XXHASH=1 to make. (665bffa) * The extern "C++" directive is now supported in the dynamic list. (7aa5c39) * --color-diagnostics is supported. mold used to ignore that flag. (6e290aa) * Not only * but also ? are now treated as special characters in the version script wildcard pattern. (31b0248) * The --threads=N option has been added as an alias for --thread-count=N. (f9ff048) * The following option has been added: --defsym (f6e8006), -z nodefaultlib (8c86c28), -z separate-code, -z noseparate-code and -z separate-lodable-segments (5601cf4), -z max-page-size (f3766cd) - Add workaround patch configure-fix.patch. OBS-URL: https://build.opensuse.org/request/show/943544 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mold?expand=0&rev=3
2022-01-04 18:37:29 +00:00
URL: https://github.com/rui314/mold
Source: https://github.com/rui314/mold/archive/v%{version}/mold-%{version}.tar.gz
Patch0: build-blake-3-as-static.patch
BuildRequires: cmake
%if %{suse_version} < 1550
BuildRequires: gcc11-c++
%else
# These libraries are not present for openSUSE Leap
BuildRequires: gcc-c++
BuildRequires: clang
BuildRequires: libdwarf-tools
BuildRequires: llvm
BuildRequires: llvm-gold
Accepting request 943544 from devel:gcc - Start using %{_libexecdir} as an installation location. - Remove quotationsmarks from build_args as it prevented the use of system packages for TBB and xxHash. - Drop configure-fix.patch as xxHash is used from system package, so we don't need to patch the wrong configuration of xxHash. - Use telling name of source tarball, adjust GitHub url to have matching names. - Update to version 1.0.1: * make install now creates /usr/local/libexec/mold/ld as a symlink to the mold executable. We do this for GCC. By passing -B/usr/local/libexec/mold, you can tell GCC to use ld inside that directory instead of /usr/bin/ld. (e8dcecf) * xxHash library is now included in the mold's source tree as a subtree for ease of building. If you want to link against a libxxhash in a system library directory, pass SYSTEM_XXHASH=1 to make. (665bffa) * The extern "C++" directive is now supported in the dynamic list. (7aa5c39) * --color-diagnostics is supported. mold used to ignore that flag. (6e290aa) * Not only * but also ? are now treated as special characters in the version script wildcard pattern. (31b0248) * The --threads=N option has been added as an alias for --thread-count=N. (f9ff048) * The following option has been added: --defsym (f6e8006), -z nodefaultlib (8c86c28), -z separate-code, -z noseparate-code and -z separate-lodable-segments (5601cf4), -z max-page-size (f3766cd) - Add workaround patch configure-fix.patch. OBS-URL: https://build.opensuse.org/request/show/943544 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mold?expand=0&rev=3
2022-01-04 18:37:29 +00:00
BuildRequires: tbb-devel
%ifarch x86_64
BuildRequires: gcc-32bit
%endif
%endif
BuildRequires: gdb
BuildRequires: glibc-devel-static
- Update to version 1.5.0 * PPC64LE and SPARC64 are now supported as new targets. They haven't yet been as well tested as other targets, but they are already able to link mold itself on these platforms. (Note that PPC64LE is very unlikely to work on the most recent POWER10 machines as we didn't have a chance to test it due to a limited availability (POWER10 was released in 2021). If you can support us on this matter, please contact us. We also accept donations, so please consider supporting our project!) * RV32BE and RV64BE (32-bit and 64-bit big-endian RISC-V) are now supported as experimental targets. RISC-V is usually little-endian, but there exists a big-endian RISC-V as an extension. You can make gcc to emit code for big-endian RISC-V by passing -mbig-endian. mold can now link object files generated with that option. * --compress-debug-sections=zstd is now supported. This is an option to compress debug info embedded to an output file with Zstandard compression algorithm. Compared to the existing --compress-debug-sections=zlib, zstd is faster and gives a higher compression ratio. You probably can't start using zstd compression today though, because other tools such as gdb may not be able to read zstd-compressed debug info yet. But adding this option early makes mold future-proof. (ede7a5a) * mold no longer aligns loadable segments to page boundaries to reduce output file size. Previously, we allocated holes between loadable segments. The saving by this change is most visible for small programs. For example, a "hello world" program used to be ~18 KiB on x86-64. It's now 7.2 KiB. (2941d75) * Bug fixes and compatibility improvements * [RISCV] We optimized code so that the link speed for RISC-V is now comparable to the other targets. As an example, linking mold itself (~150 MiB in size) for RV64 used to take ~45 seconds on a simulated 16-core machine. It now takes only ~0.25 seconds. (3ab5489) * mold used to create more than one .rodata section under a certain condition. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/mold?expand=0&rev=69
2022-09-27 07:24:13 +00:00
BuildRequires: libzstd-devel
%ifnarch ppc64
BuildRequires: valgrind
%endif
BuildRequires: zlib-devel
- Update to version 1.5.0 * PPC64LE and SPARC64 are now supported as new targets. They haven't yet been as well tested as other targets, but they are already able to link mold itself on these platforms. (Note that PPC64LE is very unlikely to work on the most recent POWER10 machines as we didn't have a chance to test it due to a limited availability (POWER10 was released in 2021). If you can support us on this matter, please contact us. We also accept donations, so please consider supporting our project!) * RV32BE and RV64BE (32-bit and 64-bit big-endian RISC-V) are now supported as experimental targets. RISC-V is usually little-endian, but there exists a big-endian RISC-V as an extension. You can make gcc to emit code for big-endian RISC-V by passing -mbig-endian. mold can now link object files generated with that option. * --compress-debug-sections=zstd is now supported. This is an option to compress debug info embedded to an output file with Zstandard compression algorithm. Compared to the existing --compress-debug-sections=zlib, zstd is faster and gives a higher compression ratio. You probably can't start using zstd compression today though, because other tools such as gdb may not be able to read zstd-compressed debug info yet. But adding this option early makes mold future-proof. (ede7a5a) * mold no longer aligns loadable segments to page boundaries to reduce output file size. Previously, we allocated holes between loadable segments. The saving by this change is most visible for small programs. For example, a "hello world" program used to be ~18 KiB on x86-64. It's now 7.2 KiB. (2941d75) * Bug fixes and compatibility improvements * [RISCV] We optimized code so that the link speed for RISC-V is now comparable to the other targets. As an example, linking mold itself (~150 MiB in size) for RV64 used to take ~45 seconds on a simulated 16-core machine. It now takes only ~0.25 seconds. (3ab5489) * mold used to create more than one .rodata section under a certain condition. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/mold?expand=0&rev=69
2022-09-27 07:24:13 +00:00
BuildRequires: zstd
PreReq: update-alternatives
%if %{suse_version} < 1550
%define build_args -DMOLD_USE_MIMALLOC=OFF -DMOLD_USE_MIMALLOC=OFF
%else
%define build_args -DMOLD_USE_MIMALLOC=OFF -DMOLD_USE_MIMALLOC=OFF -DMOLD_USE_SYSTEM_TBB=ON
%endif
%description
mold is a faster drop-in replacement for existing Unix linkers.
It is several times faster than LLVM lld linker, the second-fastest
open-source linker.
mold is created for increasing developer productivity by reducing
build time especially in rapid debug-edit-rebuild cycles.
%prep
Accepting request 943544 from devel:gcc - Start using %{_libexecdir} as an installation location. - Remove quotationsmarks from build_args as it prevented the use of system packages for TBB and xxHash. - Drop configure-fix.patch as xxHash is used from system package, so we don't need to patch the wrong configuration of xxHash. - Use telling name of source tarball, adjust GitHub url to have matching names. - Update to version 1.0.1: * make install now creates /usr/local/libexec/mold/ld as a symlink to the mold executable. We do this for GCC. By passing -B/usr/local/libexec/mold, you can tell GCC to use ld inside that directory instead of /usr/bin/ld. (e8dcecf) * xxHash library is now included in the mold's source tree as a subtree for ease of building. If you want to link against a libxxhash in a system library directory, pass SYSTEM_XXHASH=1 to make. (665bffa) * The extern "C++" directive is now supported in the dynamic list. (7aa5c39) * --color-diagnostics is supported. mold used to ignore that flag. (6e290aa) * Not only * but also ? are now treated as special characters in the version script wildcard pattern. (31b0248) * The --threads=N option has been added as an alias for --thread-count=N. (f9ff048) * The following option has been added: --defsym (f6e8006), -z nodefaultlib (8c86c28), -z separate-code, -z noseparate-code and -z separate-lodable-segments (5601cf4), -z max-page-size (f3766cd) - Add workaround patch configure-fix.patch. OBS-URL: https://build.opensuse.org/request/show/943544 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mold?expand=0&rev=3
2022-01-04 18:37:29 +00:00
%autosetup -p1
%build
%if %{suse_version} < 1550
export CC=gcc-11
export CXX=g++-11
%endif
%cmake %{build_args}
%cmake_build
%install
%cmake_install
%check
%if %{suse_version} < 1550
export TEST_CC=gcc-11
export TEST_CXX=g++-11
%endif
%ctest
%post
"%_sbindir/update-alternatives" --install \
"%_bindir/ld" ld "%_bindir/ld.mold" 1
%pre
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
"%_sbindir/update-alternatives" --remove ld "%_bindir/ld.mold";
fi;
%postun
if [ ! -f %{_bindir}/lld ] ; then
"%{_sbindir}/update-alternatives" --remove ld "%{_bindir}/ld.mold"
fi
%files
%ghost %_sysconfdir/alternatives/ld
%{_bindir}/mold
%{_bindir}/ld.mold
%dir %{_libdir}/mold
Accepting request 943544 from devel:gcc - Start using %{_libexecdir} as an installation location. - Remove quotationsmarks from build_args as it prevented the use of system packages for TBB and xxHash. - Drop configure-fix.patch as xxHash is used from system package, so we don't need to patch the wrong configuration of xxHash. - Use telling name of source tarball, adjust GitHub url to have matching names. - Update to version 1.0.1: * make install now creates /usr/local/libexec/mold/ld as a symlink to the mold executable. We do this for GCC. By passing -B/usr/local/libexec/mold, you can tell GCC to use ld inside that directory instead of /usr/bin/ld. (e8dcecf) * xxHash library is now included in the mold's source tree as a subtree for ease of building. If you want to link against a libxxhash in a system library directory, pass SYSTEM_XXHASH=1 to make. (665bffa) * The extern "C++" directive is now supported in the dynamic list. (7aa5c39) * --color-diagnostics is supported. mold used to ignore that flag. (6e290aa) * Not only * but also ? are now treated as special characters in the version script wildcard pattern. (31b0248) * The --threads=N option has been added as an alias for --thread-count=N. (f9ff048) * The following option has been added: --defsym (f6e8006), -z nodefaultlib (8c86c28), -z separate-code, -z noseparate-code and -z separate-lodable-segments (5601cf4), -z max-page-size (f3766cd) - Add workaround patch configure-fix.patch. OBS-URL: https://build.opensuse.org/request/show/943544 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mold?expand=0&rev=3
2022-01-04 18:37:29 +00:00
%{_libexecdir}/mold/ld
%dir %{_libexecdir}/mold
%{_libdir}/mold/mold-wrapper.so
%{_mandir}/man1/mold.1.gz
- Update to version 1.4.1 * mold/macOS is now available as an alpha feature. We do not recommend using it for anything serious though. Starting from this version, we accept not only mold/Unix issues but also mold/macOS ones on our GitHub Issues. Feel free to file a bug if you encounter any problem. * We started supporting CMake in addition to Make to build mold. Our long-term plan is to migrate from Make to CMake because we want to support Windows eventually and CMake provides a better Windows support than Make does. (e6a0e67) * There was a bug that mold accidentally exported a hidden symbol from an executable if a shared library linked to that executable happened to define the same symbol. This caused a build issue with Blender (#606). The bug has been fixed. (b163068) --hash-style=both is now the default if no --hash-style option is given. Previously, --hash-style=sysv was the default. This change shouldn't affect most users because the compiler driver (cc, gcc, clang, etc.) always passes --hash-style to the linker. We made this change because GNU ld defaults to --hash-style=both. * Alias symbols defined by the --defsym option now have the same scope as the aliased symbols. Previously, alias symbols defined by --defsym were always hidden and never be exported as dynamic symbols. (5dd1227) * mold now accepts foo = bar-style linker script directive to define symbol aliases. Previously, such statement was treated as a syntax error. This change was made to link mariadb-connector-c correctly (f0e1237) * Symbols in mergeable string sections now have correct output section indices instead of SHN_UNDEF. (a595c48) * [ARM32] Previously, calling a function from ARM code to Thumb code caused a program crash due to bug #442. This issue has been fixed. (053b90b) - Run tests in parallel. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/mold?expand=0&rev=65
2022-08-18 09:35:19 +00:00
%{_mandir}/man1/ld.mold.1.gz
%dir /usr/share/doc/mold
%doc /usr/share/doc/mold/LICENSE
%doc /usr/share/doc/mold/LICENSE.third-party
%changelog