Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Unsupported Software
  • Search

Chromium on the musl+LLVM profile

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
yuviazzz
n00b
n00b
Posts: 32
Joined: Fri Sep 06, 2024 7:23 pm
Location: Sweden

Chromium on the musl+LLVM profile

  • Quote

Post by yuviazzz » Fri Mar 06, 2026 12:20 pm

with some patches, it can get almost to the end!
however, the lld linker aborts due to some sort of memory allocation failure (with no usable backtrace and no OOM messages in dmesg log, or anywhere else), build.log, xz compressed
the chromium ebuild has changes to let me use python 3.14 exclusively on the system and to let me get away with no app-arch/gzip (replaced with pigz)
emerge --info:

Code: Select all

pluto# emerge --info
!!! No gcc found. You probably need to 'source /etc/profile'
!!! to update the environment of this terminal and possibly
!!! other terminals also.
Portage 3.0.77 (python 3.14.3-final-0, default/linux/amd64/23.0/musl/llvm, [unavailable], musl-1.2.5-r8, 6.19.4-gentoo x86_64)
=================================================================
System uname: Linux-6.19.4-gentoo-x86_64-12th_Gen_Intel-R-_Core-TM-_i5-12600K-with-musl1
KiB Mem:    32715268 total,   6152716 free
KiB Swap:   33554428 total,  33540076 free
Timestamp of repository gentoo: Thu, 05 Mar 2026 13:01:02 +0000
Head commit of repository gentoo: 6f9745c6e08fc6b3196b8e4f366023fca01d1fb1

Head commit of repository dm9pZCAq: b375cedabd245176441ef260fb62067bfe53ef00

sh bash 5.3_p9
ld LLD 21.1.8 (compatible with GNU linkers)
ccache version 4.12.3 [disabled]
app-misc/pax-utils:       1.3.10::gentoo
app-shells/bash:          5.3_p9::gentoo
dev-build/autoconf:       2.72-r6::gentoo
dev-build/automake:       1.18.1::gentoo
dev-build/cmake:          4.2.3::gentoo
dev-build/make:           4.4.1-r102::gentoo
dev-build/meson:          1.10.1::gentoo
dev-lang/perl:            5.42.0-r1::gentoo
dev-lang/python:          3.14.3::gentoo
dev-lang/rust:            1.93.1::gentoo
dev-util/ccache:          4.12.3::gentoo
llvm-core/clang:          21.1.8::gentoo
llvm-core/lld:            21.1.8::gentoo
llvm-core/llvm:           21.1.8::local
sys-apps/baselayout:      2.18-r1::gentoo
sys-apps/sandbox:         2.46::gentoo
sys-apps/systemd:         259.2::gentoo
sys-kernel/linux-headers: 6.19::gentoo (virtual/os-headers)
sys-libs/musl:            1.2.5-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo
    priority: -1000
    volatile: False
    sync-git-verify-commit-signature: true

dm9pZCAq
    location: /var/db/repos/dm9pZCAq
    sync-type: git
    sync-uri: https://codeberg.org/dm9pZCAq/dm9pZCAq-overlay.git
    masters: gentoo
    volatile: False

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: True

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="clang -c"
CBUILD="x86_64-pc-linux-musl"
CC="clang"
CFLAGS="-O2 -pipe -march=native -flto=thin"
CHOST="x86_64-pc-linux-musl"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d"
CPP="clang-cpp"
CXX="clang++"
CXXFLAGS="-O2 -pipe -march=native -flto=thin"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe -march=native -flto=thin"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live compress-index config-protect-if-modified distlocks fixlafiles ipc-sandbox merge-sync network-sandbox news noinfo parallel-fetch parallel-install pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native -flto=thin"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/etc/init.d /etc/conf.d"
LANG="C.UTF-8"
LD="ld.lld"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed"
LEX="flex"
LIBTOOL="rclibtool"
MAKE="make LIBTOOL=rclibtool"
MAKEFLAGS="LIBTOOL=rclibtool"
MAKEOPTS="-j18"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
PKGDIR="/var/cache/binpkgs"
PORTAGE_COMPRESS="gzip"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RANLIB="llvm-ranlib"
READELF="llvm-readelf"
RUSTFLAGS=" -C target-cpu=native"
SHELL="/bin/ksh"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="acl amd64 asm atomic-builtins audit caps cet clang dbus filecaps hardened libnotify llvm-libunwind lto man minimal native-extensions notification notify openmp pam pie policykit readline seccomp ssp system-llvm systemd test-rust udev unicode verify-sig wayland xattr" ABI_X86="64" CPU_FLAGS_X86="aes avx avx2 avx_vnni bmi1 bmi2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3 vpclmulqdq" ELIBC="musl" KERNEL="linux" LLVM_TARGETS="X86" PYTHON_SINGLE_TARGET="python3_14" PYTHON_TARGETS="python3_14"
Unset:  ARFLAGS, ASFLAGS, CCLD, CONFIG_SHELL, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LFLAGS, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, SIZE, YACC, YFLAGS
Top
Ionen
Developer
Developer
User avatar
Posts: 3009
Joined: Thu Dec 06, 2018 2:23 pm

  • Quote

Post by Ionen » Fri Mar 06, 2026 1:33 pm

Code: Select all

libc++abi: terminating due to uncaught exception of type std::bad_alloc: std::bad_alloc
Not familiar with it but think that error can mean a lot of things as I seen it in different contexts.

Personally had my llvm-musl ccache throw that error since libcxxabi-20(?) I forget, and it was later fixed by USE=static-c++ on ccache, given chromium does special things with libcxx it may possibly be some kind of similar mixup (not ccache, but affecting something else the same way) but don't think I can help.

There's https://bugs.gentoo.org/969218 with firefox which sounds similar, but they were doing something special with LD_PRELOAD and some hardened malloc (if that rings a bell that may be it, otherwise unlikely).

Never tried to build chromium on llvm-musl myself, I did patch the similar qtwebengine (partially based on a mix of void and alpine's patches) and build it successfully, albeit it doesn't use rust (yet) among other things and may be avoiding the issue. The patches been surprisingly easy to maintain, albeit shame the chromium upstreaming efforts seem to have stalled (used to be able to drop a lot of musl patches every major bumps and was hoping I'd get to be mostly done with them by now).
Top
Hu
Administrator
Administrator
Posts: 24380
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Fri Mar 06, 2026 2:19 pm

Per https://en.cppreference.com/w/cpp/memor ... alloc.html, this is thrown by standard allocators when an allocation fails. One of the common reasons I have seen for a failure that leaves nothing on the kernel side is that the request failed because it was ill-formed, rather than due to out of memory. For example, trying new char[SIZE_MAX] will do this, because SIZE_MAX would cover all of the local address space, so no matter how much virtual memory the system has available, the allocation is impossible to satisfy due to all the other mappings already in the address space. I use this example because SIZE_MAX is typically ((size_t)-1), so if a length value were given a placeholder of -1, then never given a real value before it was passed to new, you could get this failure.

Considering Ionen's comments, it seems plausible that the upstream build has inserted some special allocator that doesn't accept all the requests that the standard allocator allows. By forcing ccache to be statically linked, ccache would then ignore the weird special allocator and call the statically linked in standard allocator.
Top
Post Reply

3 posts • Page 1 of 1

Return to “Unsupported Software”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy