-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
mlibc: init at 6.1.1 #371092
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
base: master
Are you sure you want to change the base?
mlibc: init at 6.1.1 #371092
Conversation
freesweep has a new version in development and it seems to be usable, let's update to it. I added myself as a maintainer and included a few patches to allow it to build with and without mlibc (which I'm working on in NixOS#371092).
freesweep has a new version in development and it seems to be usable, let's update to it. I added myself as a maintainer and included a few patches to allow it to build with and without mlibc (which I'm working on in NixOS#371092).
freesweep has a new version in development and it seems to be usable, let's update to it. I included a few patches to allow it to build with and without mlibc (which I'm working on in NixOS#371092).
freesweep has a new version in development and it seems to be usable, let's update to it. I included a few patches to allow it to build with and without mlibc (which I'm working on in NixOS#371092).
freesweep has a new version in development and it seems to be usable, let's update to it. I included a few patches to allow it to build with and without mlibc (which I'm working on in NixOS#371092).
@lzcunt please rebase. |
I'm still working on this and I have a rebase locally. This PR is very outdated, because I want to fix issues with upstream mlibc before getting it into nixpkgs. Hence it is marked as a draft |
|
Necessary GDBM patch is upstream 🎉 |
Can we get this merged? Any remaining blockers? |
I'd like to update this to the latest mlibc master or maybe ask them to make a release. I also want to fix some more stuff upstream. But this PR should be good enough as a first PR, would be nice to get more eyes to review this EDIT: will rebase soon |
lib/systems/default.nix
Outdated
|| isMusl | ||
|| isMlibc # Linux (allows multiple libcs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should probably stay at musl, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, until I get around to adding Managarm or Ironclad as a target, mlibc in nixpkgs is pretty much Linux-only. Tho it does make sense to move it out of the linux comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've decided to do (isMlibc && isLinux) because other ports of mlibc may or may not have shared libraries.
72232c2
to
926d548
Compare
|
|
Source hash mismatch |
I probably messed up while rebasing, my bad |
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 enables langCC in gccWithoutTargetLibc for mlibc platforms, because mlibc is written in C++. Sadly enabling this for musl doesn't work so I've left a FIXME for someone else to look into it. This patch also runs autoreconf for gccWithoutTargetLibc, which is necessary to make libstdcxx disable link tests (which cannot be run without a libc). 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, libsanitizer is disabled because mlibc doesn't support libsanitizer 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. Also includes some refactoring around the `--disable-libsanitizer` configure flag.
It's only glibc with a quirk that makes it bad at static linking. mlibc, LLVM libc, and others are just fine with static linking.
This hack was removed recently. The comment doesn't describe anything useful now.
Sorry for the late fix, I've kinda been overextended on projects and life |
|
That looks like autoconf not liking mlibc's implementation of that function and trying to replace it, but many symbols in mlibc aren't marked weak so the linker throws an error. There's already a workaround for a similar function so it'd be easy to fix |
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 just enough to get bash running, I have follow-up patches for more stuff.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.