Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mlibc: init at 5.0.0-unstable-2025-01-05 #371092

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

lzcunt
Copy link
Contributor

@lzcunt lzcunt commented Jan 5, 2025

mlibc is a portable C standard library by the managarm project. mlibc developers are interested in running a full linux distro on top of mlibc and in my opinion NixOS is a prime candidate. Having it in nixpkgs would also help developers using mlibc.

This is a draft PR because I need to build and test other architectures supported by mlibc on linux and there's a bug making mlibc's RTLD unable to find libgcc_s.so.1 through RPATH. So feel free to review even tho this is a draft. Static linking needs to be fixed. bash works when built with mlibc. #370683 needs to be merged before this is merged.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@lzcunt lzcunt changed the title mlibc: init at 5.0.0-unstable-2025-01-02 mlibc: init at 5.0.0-unstable-2025-01-05 Jan 5, 2025
lzcunt and others added 6 commits January 12, 2025 14:05
Previously gccWithoutTargetLibc was built with `langCC = false;`, which
meant stdenvNoLibc had C++ support when not cross compiling or when the
host platform toolchain is LLVM, but did not have C++ support when cross
compiling for a non-Darwin and non-LLVM host platform. This patch fixes
issues when cross compiling C++ packages built with stdenvNoLibc like
LLVM libc and the mlibc package I'm (sanana) working on.

Co-Authored-By: Artturin <Artturin@artturin.com>
Co-Authored-By: Arsen Arsenović <arsen@aarsen.me>
Checking if openssl is a derivation requires evaluating stdenv.cc, which
depends on mlibc when cross compiling to a mlibc platform, which depends
on meson, which depends on Python.

See previous commit 0070883 on why the recursion break happens in the
Python expression.
In gcc, libsanitize is disabled because mlibc doesn't support
libsanitize yet but upstream is working on it. Patches needed for gcc to
support linux-mlibc targets are pulled from managarm's fork of gcc,
patches only needed by managarm are not applied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants