Yifeng Li e442bb64a5 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@tomli.me>
Signed-off-by: David Seifert <soap@gentoo.org>
2023-05-16 23:11:24 +02:00
2023-05-15 21:08:15 +02:00
2023-05-13 00:57:18 +01:00
2023-05-15 06:39:40 +01:00
2023-05-16 15:55:38 +02:00
2023-05-04 22:53:17 +07:00
2023-04-22 02:10:15 +02:00
2023-05-16 17:44:23 +02:00
2023-05-02 18:48:38 -04:00
2023-05-13 21:10:34 +02:00
2023-05-16 06:44:56 +01:00
2023-05-13 03:26:45 -04:00
2023-04-30 12:06:06 +02:00
2023-05-16 21:16:20 +02:00
2023-05-16 21:32:08 +02:00
2023-05-12 15:38:02 +02:00
2023-05-14 12:27:55 +02:00
2023-05-16 21:32:08 +02:00
2023-05-14 12:00:55 +02:00
2023-05-14 12:00:57 +02:00
2023-05-13 11:03:45 +02:00
2023-05-16 15:48:12 +02:00
2023-05-16 13:02:53 +02:00
2023-05-15 08:29:17 -04:00
2023-05-14 18:19:03 +02:00
2023-05-15 06:38:11 +01:00
S
Description
No description provided
9.8 GiB
Languages
Shell 98%
Roff 1.4%
Emacs Lisp 0.2%
C 0.1%