commit:     048526669f36e549fb4847126ab510a42de361a9
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 18 15:41:14 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 18 15:42:57 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04852666

sys-devel/mold: add 2.3.0, disable PCH

PCH is buggy and not worth it (especially for clean builds where we're not
installing any headers too...)

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/mold/Manifest                                |  1 +
 sys-devel/mold/files/mold-2.3.0-no-pch.patch           | 12 ++++++++++++
 sys-devel/mold/{mold-9999.ebuild => mold-2.3.0.ebuild} |  7 ++++++-
 sys-devel/mold/mold-9999.ebuild                        |  7 ++++++-
 4 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index 9c33e11ccd3f..6cb0c98c07e3 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -2,3 +2,4 @@ DIST mold-1.11.0.tar.gz 8210923 BLAKE2B 
b3854a14a956dd568625fc28c96636e7cadf81b9
 DIST mold-2.0.0.tar.gz 9205927 BLAKE2B 
f80c72c58f4618a74390417fdf90f816810350baf1ac74d21294f5ffba7ee263807175be531c9db77209bd05a31ad11fd84d4aeb03fb057cefac7575f71612d6
 SHA512 
11c3d1e07fe4fcc28cff58b8e432526e4604aa55b49fa47c9495e439206fb9f6a1686b1c5bd2dc907ffd7fe62ac1c72317619fc8a5d7caaa5c327de585f16827
 DIST mold-2.1.0.tar.gz 9278811 BLAKE2B 
b31e13f92177553adf5069cf35c8c75c7bc28f0af4d1726cdc0c6abc1c9d3baaa5be512c3a8fb9bc3c3110096a79e1c6751c701171769595a2234fc1fa8c441a
 SHA512 
f1c98d349b35b4042109d71f7db6eb8d7d089dc3241735bbd7b5402d513dcc85ca17904828779e5fc8234650fa9fb97f47c3a2f3e89cc2fb3cb9e9110439e5a2
 DIST mold-2.2.0.tar.gz 9956678 BLAKE2B 
495772b5bfd238a6785676d277da87fe4f10b64513f8f0a4961893e4ae8954ad8bda3d09283de14594d7d056d6c1aeed5be591d6a64868a473eb45737d3b9340
 SHA512 
1692d1ff154335fdff91a4fafebb3514ed6742035c14e74ec7e552b90428a1cd5341baba9183158b44ae221fd19e86da55e7f04bde317b943a24d0afecb41002
+DIST mold-2.3.0.tar.gz 9958893 BLAKE2B 
86235731953902a5cd8fdba8b41d456bd60bf53b96a9e1cc89bdf991a75367b95e5522887be8e9c28f3d777b143ef5d693ff50293188ef222fc45257ce990d24
 SHA512 
7953cff8f2e9f775f0890aedc5f38ef07aac16118310ee9e1a2a82be8abafa1aa05459a136181978c55763737c7ff47815afdd4423e8f96db8f0237fce13e6b4

diff --git a/sys-devel/mold/files/mold-2.3.0-no-pch.patch 
b/sys-devel/mold/files/mold-2.3.0-no-pch.patch
new file mode 100644
index 000000000000..e61b5df01f54
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.3.0-no-pch.patch
@@ -0,0 +1,12 @@
+We generally disable PCH in Gentoo because of how buggy it is.
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -400,7 +400,7 @@ endif()
+ 
+ # Add frequently included header files for pre-compiling.
+ # target_precompile_headers is supported by CMake 3.16.0 or newer.
+-if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
++if(FALSE)
+   if(MOLD_IS_SOLD)
+     target_precompile_headers(mold PRIVATE
+       "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/elf/mold.h>"

diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-2.3.0.ebuild
similarity index 93%
copy from sys-devel/mold/mold-9999.ebuild
copy to sys-devel/mold/mold-2.3.0.ebuild
index 42cd25dd9155..f16aabe0758e 100644
--- a/sys-devel/mold/mold-9999.ebuild
+++ b/sys-devel/mold/mold-2.3.0.ebuild
@@ -12,7 +12,7 @@ if [[ ${PV} == 9999 ]] ; then
        inherit git-r3
 else
        SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz"
-       KEYWORDS="~amd64 ~loong"
+       KEYWORDS="~amd64 ~arm64 ~loong ~riscv ~x86"
 fi
 
 # mold (MIT)
@@ -31,6 +31,10 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.3.0-no-pch.patch
+)
+
 pkg_pretend() {
        # Requires a c++20 compiler, see #831473
        if [[ ${MERGE_TYPE} != binary ]]; then
@@ -65,6 +69,7 @@ src_prepare() {
 
 src_configure() {
        local mycmakeargs=(
+               -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
                -DMOLD_ENABLE_QEMU_TESTS=OFF
                -DMOLD_LTO=OFF # Should be up to the user to decide this with 
CXXFLAGS.
                -DMOLD_USE_SYSTEM_MIMALLOC=ON

diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-9999.ebuild
index 42cd25dd9155..f16aabe0758e 100644
--- a/sys-devel/mold/mold-9999.ebuild
+++ b/sys-devel/mold/mold-9999.ebuild
@@ -12,7 +12,7 @@ if [[ ${PV} == 9999 ]] ; then
        inherit git-r3
 else
        SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz"
-       KEYWORDS="~amd64 ~loong"
+       KEYWORDS="~amd64 ~arm64 ~loong ~riscv ~x86"
 fi
 
 # mold (MIT)
@@ -31,6 +31,10 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.3.0-no-pch.patch
+)
+
 pkg_pretend() {
        # Requires a c++20 compiler, see #831473
        if [[ ${MERGE_TYPE} != binary ]]; then
@@ -65,6 +69,7 @@ src_prepare() {
 
 src_configure() {
        local mycmakeargs=(
+               -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
                -DMOLD_ENABLE_QEMU_TESTS=OFF
                -DMOLD_LTO=OFF # Should be up to the user to decide this with 
CXXFLAGS.
                -DMOLD_USE_SYSTEM_MIMALLOC=ON

Reply via email to