From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1519065-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7F19015806E for <garchives@archives.gentoo.org>; Tue, 16 May 2023 21:11:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8F98EE086E; Tue, 16 May 2023 21:11:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 784F9E086E for <gentoo-commits@lists.gentoo.org>; Tue, 16 May 2023 21:11:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6D6D534095A for <gentoo-commits@lists.gentoo.org>; Tue, 16 May 2023 21:11:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B6360A61 for <gentoo-commits@lists.gentoo.org>; Tue, 16 May 2023 21:11:31 +0000 (UTC) From: "David Seifert" <soap@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "David Seifert" <soap@gentoo.org> Message-ID: <1684271484.e442bb64a57259f89e12d901c8fe23a5abe62a76.soap@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/boost/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/boost/boost-1.82.0.ebuild X-VCS-Directories: dev-libs/boost/ X-VCS-Committer: soap X-VCS-Committer-Name: David Seifert X-VCS-Revision: e442bb64a57259f89e12d901c8fe23a5abe62a76 X-VCS-Branch: master Date: Tue, 16 May 2023 21:11:31 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: cb9671e5-d86b-4c7a-83cc-216e959ec771 X-Archives-Hash: d795c4309526e7000154673b42e89004 commit: e442bb64a57259f89e12d901c8fe23a5abe62a76 Author: Yifeng Li <tomli <AT> tomli <DOT> me> AuthorDate: Tue May 16 21:11:24 2023 +0000 Commit: David Seifert <soap <AT> gentoo <DOT> org> CommitDate: Tue May 16 21:11:24 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e442bb64 dev-libs/boost: fix build on macOS / Apple Silicon This commits fix three problems in existing Boost 1.82.0 ebuilds, allowing one to install Boost on macOS, including Apple Silicon. 1. Boost wants to build static library, which is unsupported on macOS. Using the unmodified ebuild, Boost fails because the build system wants to pass the "-static" flag to ar, but this option (and static linking in general) is unsupported by macOS, creating this error message: arm64-apple-darwin22-ar: only one of -a and -[bi] options allowed It turned out that "toolset=darwin" is actually broken in Boost [1] and has even been removed from Boost since 2019 [2]. Thus, the fix is to remove the option compiler="darwin". 2. error: O_LARGEFILE was not declared in this scope It appears that on modern macOS, 64-bit file I/O is already the default, and there's no special support for options like O_LARGEFILE. Thus, on on Darwin, we avoid running the command append-lfs-flags. 3. invalid install_name found, your application or library will crash at runtime To fix the broken install_name and references, a hack is used on Darwin to find a list paths. The original command began with "grep ^libboost" to match a library name at the beginning of the output of "otool -XL". But for some reason, the library names now include a path prefix, such as: bin.v2/libs/thread/build/gcc-12.1/gentoorelease/pch-off/ threadapi-pthread/threading-multi/visibility-hidden/ libboost_thread.dylib Thus, matching at the beginning of the line no longer works. To fix the problem, we instead use "grep libboost" to allow lines with a path prefix to be matched as well. We then extract the basename the filename from the path. [1] https://web.archive.org/web/20160713132921/https://svn.boost.org/trac/boost/ticket/9772#comment:19 [2] https://github.com/boostorg/build/issues/528 Closes: https://github.com/gentoo/gentoo/pull/30758 Closes: https://bugs.gentoo.org/904983 Signed-off-by: Yifeng Li <tomli <AT> tomli.me> Signed-off-by: David Seifert <soap <AT> gentoo.org> dev-libs/boost/boost-1.82.0.ebuild | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/dev-libs/boost/boost-1.82.0.ebuild b/dev-libs/boost/boost-1.82.0.ebuild index efe85c331913..30ce182a1f86 100644 --- a/dev-libs/boost/boost-1.82.0.ebuild +++ b/dev-libs/boost/boost-1.82.0.ebuild @@ -16,7 +16,7 @@ S="${WORKDIR}/${PN}_${MY_PV}" LICENSE="Boost-1.0" SLOT="0/${PV}" # ${PV} instead of the major version due to bug 486122 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" IUSE="bzip2 context debug doc icu lzma +nls mpi numpy python tools zlib zstd" REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" # the tests will never fail because these are not intended as sanity @@ -71,13 +71,8 @@ create_user-config.jam() { fi local compiler compiler_version compiler_executable="$(tc-getCXX)" - if [[ ${CHOST} == *-darwin* ]]; then - compiler="darwin" - compiler_version="$(gcc-fullversion)" - else - compiler="gcc" - compiler_version="$(gcc-version)" - fi + compiler="gcc" + compiler_version="$(gcc-version)" if use mpi; then local mpi_configuration="using mpi ;" @@ -194,8 +189,15 @@ src_configure() { # Use C++17 globally as of 1.80 append-cxxflags -std=c++17 - # need to enable LFS explicitly for 64-bit offsets on 32-bit hosts (#894564) - append-lfs-flags + if [[ ${CHOST} != *-darwin* ]]; then + # On modern macOS, file I/O is already 64-bit by default, + # there's no support for special options like O_LARGEFILE. + # Thus, LFS must be disabled. + # + # On other systems, we need to enable LFS explicitly for 64-bit + # offsets on 32-bit hosts (#894564) + append-lfs-flags + fi } multilib_src_compile() { @@ -242,16 +244,24 @@ multilib_src_install() { install_name_tool -id "/${d#${D}}" "${d}" eend $? # fix references to other libs + # these paths look like this: + # bin.v2/libs/thread/build/gcc-12.1/gentoorelease/pch-off/ + # threadapi-pthread/threading-multi/visibility-hidden/ + # libboost_thread.dylib refs=$(otool -XL "${d}" | \ sed -e '1d' -e 's/^\t//' | \ - grep "^libboost_" | \ + grep "libboost_" | \ cut -f1 -d' ') local r for r in ${refs}; do - ebegin " correcting reference to ${r}" + # strip path prefix from references, so we obtain + # something like libboost_thread.dylib. + local r_basename=${r##*/} + + ebegin " correcting reference to ${r_basename}" install_name_tool -change \ "${r}" \ - "${EPREFIX}/usr/lib/${r}" \ + "${EPREFIX}/usr/lib/${r_basename}" \ "${d}" eend $? done