Skip to content

scripts/bootstrap-prefix: make darwin bootstrap with clang - #45

Open
plxty wants to merge 1 commit into
gentoo:masterfrom
plxty:fix-macos-clang
Open

scripts/bootstrap-prefix: make darwin bootstrap with clang#45
plxty wants to merge 1 commit into
gentoo:masterfrom
plxty:fix-macos-clang

Conversation

@plxty

@plxty plxty commented Aug 28, 2026

Copy link
Copy Markdown

In Darwin there's plenty of tools that now use macOS infra such as nodejs, many rust libraries... For GCC lacks of macOS builtins and the blocks extension, building many tools require a lot of hack, switching to clang will reduce some pain.

This is still a proof-of-concept style, it works on my macOS 26, but may not be a clean way, and may not work for other macOS version.

Changes explaination:

  1. Darwin ships with builtin libc++, for Gentoo clang with isolated libc++ to work, changes required: compiler flag -stdlib++-isystem to use Gentoo headers, and building libcxx requires -DLIBCXX_ABI_NAMESPACE= to avoid conflicting the system one.
  2. So in stage 2 we still use macOS libcxx, then in stage3 we shall emerge the libcxx and switching toolchain like ninja and rest to use the Gentoo lib.
  3. Uniform STAGE and BOOTSTRAP_STAGE, but I'm not sure if that's the correct way :/
  4. Adding bash requirement check for array stuff like ( xxx ) to work

Still this is a proof-of-concept, managed to get bootstrap but may encounter other issues.

Signed-off-by: Zigit Zo <byte@kei.network>

@thesamesam thesamesam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me.

@plxty
plxty marked this pull request as ready for review August 31, 2026 10:57
@plxty plxty changed the title WIP: scripts/bootstrap-prefix: make darwin bootstrap with clang scripts/bootstrap-prefix: make darwin bootstrap with clang Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants