summaryrefslogtreecommitdiff
path: root/dev-util/b2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-02-20 20:21:39 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-02-20 20:21:39 +0000
commitdd03974882f85ca04e35cfbc97f7ff756f5d5c20 (patch)
tree4fabcc91c51083e19657dd0a557043e74468106e /dev-util/b2
parentd542bd2ef95af892c7ef62be1489b0288b1df9e3 (diff)
gentoo auto-resync : 20:02:2023 - 20:21:39
Diffstat (limited to 'dev-util/b2')
-rw-r--r--dev-util/b2/Manifest2
-rw-r--r--dev-util/b2/b2-4.9.3-r1.ebuild67
-rw-r--r--dev-util/b2/files/b2-4.9.3-fix-apple-m1-crash-by-explicit-pointer-cast.patch55
3 files changed, 124 insertions, 0 deletions
diff --git a/dev-util/b2/Manifest b/dev-util/b2/Manifest
index 002d67cc14d5..fa870d552e49 100644
--- a/dev-util/b2/Manifest
+++ b/dev-util/b2/Manifest
@@ -3,7 +3,9 @@ AUX b2-4.9.2-darwin-gentoo-toolchain.patch 399 BLAKE2B 213ddbeac6be079df8383ac51
AUX b2-4.9.2-disable_python_rpath.patch 343 BLAKE2B 7b8449db1054dcee76ecbe1b1c826ae3d6964acfcfc0850ff3c75d3c71b043587bccac6b96797229c6dec39beb593893d16ae93a4d7fd16b969129fe63f73d0b SHA512 99bc1260f3d36faf60ab2837039466201bddfeec5c60f65c1c5e52d6d6c1667d419376328f8202596aa2b66448308175d2504062ee6e1708ea0f44d02988ceb4
AUX b2-4.9.2-no-implicit-march-flags.patch 8376 BLAKE2B 50e0b8effbb268467d90cc51df70dc4bd234789b352a279d9bb3e60161be80296f5f31f4a0d2a3d1ae2380f3079f7b950b24ef494574e25bbda48b516c6aacbb SHA512 0089a48cbe3e9e4f222e5cd1e9e12a5c4d16857b002a1c849f4cf6f8d7935c0a9b1e0f51ced51bf5346c2fdcbd214ce05e3c144c98fbf82a9842c45b59c19740
AUX b2-4.9.2-odr.patch 1109 BLAKE2B 0bf70f2b2237369acd5089d1d1c6e1362f1d3528b036a7f7b9c5c4d077e60850f45c87a67c830f441297e09be2f7dd8bf41ea45a2c66b307678404c4a0db0ed5 SHA512 90ca58661322b35c4af6543558015368385a1b0e12740cd76723d893f95411645ec4a3a23694503863dd786b73a0ec9b0cb34b473e357334d8e82d973f800e4b
+AUX b2-4.9.3-fix-apple-m1-crash-by-explicit-pointer-cast.patch 2408 BLAKE2B 94cc164f8f02a4525d1f6f694a1bb61d034c4131736e8425e4f5031404756810968f079c34a5a9abc779c16e1c939ec495dc11f0a7850ec6fcc4ef057c8d0496 SHA512 e6b1d3b55f5446e5e60cecde23b161952ad1f8d57d52d9b164e7c57be6d22f39539e8482007a0df73deebe62203e41be9310be021d37e70ab0a720a6f86db688
AUX site-config.jam 688 BLAKE2B e43a7ad1a94d113a7f890e8b634770f5c60556101d428d83f655bbbe72c46b587485886a9941d05a2ae4319fc325f1e0ecfb9b660158b81c5e9fd02e0b1c0530 SHA512 b65bf1be3133f9f66d3139b00f195a288591bb20a13ba35041507c2c33d7d2da6047c3b02dc27bc4eb21798b91e1262a60e294b7fd4af90808b9de0f5af517df
DIST b2-4.9.3.tar.gz 975934 BLAKE2B 8d16e7227676786408f0d84efb577806e304a9181b89656dad1243b5b0b48e67d4226fa51ea97d4ea10110e4ea86f3ae2884d711fa4b04e36bdaa68dff0a4710 SHA512 8f861074a50720ad5469277a469523ef5f87ef2aab65d745f4c5e6af0ed8f40af91c43cd42b7845982c065974026ce1ecc77a831cd0c698c7e22fa848cc81009
+EBUILD b2-4.9.3-r1.ebuild 2029 BLAKE2B bfeba4deecda66a255c445b2f90a0eaa39aa0031659d92977d889d01c8a9887f9856c4b2970cc682711adb5f555b2ec235c3b01ebf42870c51a89dcb175b8801 SHA512 95a9ca2b4915cc4cd7e4660f32ffa340371c7cec5846073c6511732eee0fa47a6b24d51805e5a4d63c0cd8b30705d103bdf1d824edf0006b71fd1173ef3b65a7
EBUILD b2-4.9.3.ebuild 1944 BLAKE2B 2487d363573179e6b58170a919bdb403b7881fcef352ca70fba2d7ca04c511c57d6493a761601f01a066bcfcc6639f85a6e4f2a90f02e5cc9a13e6e8c441ee6e SHA512 287e1119b91dadebe54424d7f31ca1de11566c73ca596bd4e8b190c1ec2d9a03d740caf2bc2631be79473b291ea1041174c962b3a0dad56682eb55da8ac4a25a
MISC metadata.xml 320 BLAKE2B e32bcf6d7bfe5e8a0f36d34022d49ef8baf1d4c0324fa7e7b25e1fa41ac81c21e010a8e49d456b7ce6027c51af57b6b07f3bdc8b7e05daa18b288c63a58a171e SHA512 767da992cd650d91b393848e73d6f0626febcb02eba350a16d390e8416a2832c49b1ca2608be98a9f4abd9ae2078a7f1a543a387be139e5533f90d82171796bf
diff --git a/dev-util/b2/b2-4.9.3-r1.ebuild b/dev-util/b2/b2-4.9.3-r1.ebuild
new file mode 100644
index 000000000000..2bf203c180e1
--- /dev/null
+++ b/dev-util/b2/b2-4.9.3-r1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit edo flag-o-matic toolchain-funcs
+
+MY_PV="$(ver_rs 1- _)"
+
+DESCRIPTION="A system for large project software construction, simple to use and powerful"
+HOMEPAGE="https://www.bfgroup.xyz/b2/"
+SRC_URI="https://github.com/bfgroup/b2/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${P}/src"
+
+LICENSE="Boost-1.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples"
+RESTRICT="test"
+
+RDEPEND="!dev-util/boost-build"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.9.2-disable_python_rpath.patch
+ "${FILESDIR}"/${PN}-4.9.2-darwin-gentoo-toolchain.patch
+ "${FILESDIR}"/${PN}-4.9.2-add-none-feature-options.patch
+ "${FILESDIR}"/${PN}-4.9.2-no-implicit-march-flags.patch
+ "${FILESDIR}"/${PN}-4.9.2-odr.patch
+ "${FILESDIR}"/${PN}-4.9.3-fix-apple-m1-crash-by-explicit-pointer-cast.patch
+)
+
+src_configure() {
+ # need to enable LFS explicitly for 64-bit offsets on 32-bit hosts (#761100)
+ append-lfs-flags
+}
+
+src_compile() {
+ cd engine || die
+
+ # upstream doesn't want separate flags for CPPFLAGS/LDFLAGS
+ # https://github.com/bfgroup/b2/pull/187#issuecomment-1335688424
+ edo ${CONFIG_SHELL:-${BASH}} ./build.sh cxx --cxx="$(tc-getCXX)" --cxxflags="${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}" -d+2 --without-python
+}
+
+src_test() {
+ # Forget tests, b2 is a lost cause
+ :
+}
+
+src_install() {
+ dobin engine/b2
+
+ insinto /usr/share/b2/src
+ doins -r "${FILESDIR}/site-config.jam" \
+ bootstrap.jam build-system.jam ../example/user-config.jam \
+ build kernel options tools util
+
+ find "${ED}"/usr/share/b2/src -iname '*.py' -delete || die
+
+ dodoc ../notes/{changes,release_procedure,build_dir_option,relative_source_paths}.txt
+
+ if use examples; then
+ docinto examples
+ dodoc -r ../example/.
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+}
diff --git a/dev-util/b2/files/b2-4.9.3-fix-apple-m1-crash-by-explicit-pointer-cast.patch b/dev-util/b2/files/b2-4.9.3-fix-apple-m1-crash-by-explicit-pointer-cast.patch
new file mode 100644
index 000000000000..753c60fd14ce
--- /dev/null
+++ b/dev-util/b2/files/b2-4.9.3-fix-apple-m1-crash-by-explicit-pointer-cast.patch
@@ -0,0 +1,55 @@
+https://github.com/bfgroup/b2/issues/152
+https://github.com/bfgroup/b2/pull/214
+https://bugs.gentoo.org/895524
+
+From 62dc6ff74a0b9717b4a8dd61ce06770e6fb7c177 Mon Sep 17 00:00:00 2001
+From: Yifeng Li <tomli@tomli.me>
+Date: Mon, 20 Feb 2023 09:52:32 +0000
+Subject: [PATCH] Fix #152 crash on Apple M1 by casting 0 to (OBJECT *)
+ explicitly.
+
+Currently, when the NULL-terminated variadic function call_rule()
+is invoked, the value "0" is passed as the last argument to act
+as a terminator. However, this is an integer value, which is
+incompatible with the pointer data type expected by call_rule().
+
+This is undefined behavior in C, correct operation is not
+guaranteed. In fact, it causes b2 to crash on Apple M1 when GCC
+is used - the loop is not terminated when it should, instead, it
+keeps running, creating the following error:
+
+> lol_add failed due to reached limit of 19 elements
+
+In some cases, it can even corrupt the internal state of the program,
+creating an infinite loop.
+
+This commit fixes the problem by explicitly casting the value 0 to
+the correct pointer type (OBJECT *).
+
+Signed-off-by: Yifeng Li <tomli@tomli.me>
+---
+ src/engine/modules/property-set.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/engine/modules/property-set.cpp b/src/engine/modules/property-set.cpp
+index 6e190a7639..b0d3c2dab8 100644
+--- src/engine/modules/property-set.cpp
++++ src/engine/modules/property-set.cpp
+@@ -162,7 +162,7 @@ LIST * property_set_create( FRAME * frame, int flags )
+ OBJECT * rulename = object_new( "new" );
+ OBJECT * varname = object_new( "self.raw" );
+ LIST * val = call_rule( rulename, frame,
+- list_new( object_new( "property-set" ) ), 0 );
++ list_new( object_new( "property-set" ) ), (OBJECT *) 0 );
+ LISTITER iter, end;
+ object_free( rulename );
+ pos->value = object_copy( list_front( val ) );
+@@ -183,7 +183,7 @@ LIST * property_set_create( FRAME * frame, int flags )
+ import_module( imports, frame->module );
+ rulename = object_new( "errors.error" );
+ call_rule( rulename, frame,
+- list_new( object_new( message->value ) ), 0 );
++ list_new( object_new( message->value ) ), (OBJECT *) 0 );
+ /* unreachable */
+ string_free( message );
+ list_free( imports );