mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-20 22:27:17 -08:00
e442bb64a57259f89e12d901c8fe23a5abe62a76
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@tomli.me>
Signed-off-by: David Seifert <soap@gentoo.org>
…
…
…
…
Description
No description provided
9.8 GiB
Languages
Shell
98%
Roff
1.4%
Emacs Lisp
0.2%
C
0.1%