-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
musl service pack #16217
musl service pack #16217
Conversation
By analyzing the blame information on this pull request, we identified @thoughtpolice, @wkennington and @edolstra to be potential reviewers |
So what is the deal with libgcc? Should it be a separate package, or should libgcc_s.so be copied to |
Also are linuxHeaders supposed to be included as part of the libc? Maybe having a package called base or something that depends on libgcc linuxHeaders and glibc would be good. So that if someone want's to use a different libc they can just override the libc without having to figure out how to include libgcc and linuxHeaders. Also I think that the dynamic linker name should be an attribute of libc, so that we can move that logic out of build support. Probably moving libc specific configure flags out into the libc's might be a good idea, and if there aren't any either complain it's an unsupported combination of libc/compiler. To modularize our toolchain/libc options/combinations, we should specify some sort of interface for the various components, maybe starting with libc. Does someone have some thoughts on this stuff? |
@dvc94ch: Sounds like a good idea to me. |
Who needs to sign off on this to get it integrated (ignoring the current merge conflict)? |
It actually breaks the bootstrap tools, haven't looked into why...
|
What do you mean it breaks the bootstrap tools? Can you point to a build failure or something for investigation? If nothing else I've been building on this so am interested in any known issues :). Thanks! |
Awesome to hear!! Here I make a change to bootstrap tools to use the gcc-musl toolchain instead of the musl gcc wrapper. If memory servers me correctly nix-build .../make-bootstrap-tools.nix errors. I think it was related to the linux-headers and libgcc, but it's been a while... |
Ah, okay. Well as a local kludge I added the linux headers to musl like glibc/uclibc do: commit 426994ad67ae1faf8cb710c1fb667b2676343658
Author: Will Dietz <[email protected]>
Date: Tue Jul 12 08:14:39 2016 -0500
Add linux headers to musl so we can build things like libunwind.
diff --git a/pkgs/os-specific/linux/musl/default.nix b/pkgs/os-specific/linux/musl/default.nix
index ba62652..665a504 100644
--- a/pkgs/os-specific/linux/musl/default.nix
+++ b/pkgs/os-specific/linux/musl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cross ? null, gccCross ? null }:
+{ stdenv, fetchurl, cross ? null, gccCross ? null, linuxHeaders }:
stdenv.mkDerivation rec {
name = "musl-${version}${stdenv.lib.optionalString (cross != null) ''-${cross.arch}''}";
@@ -30,6 +30,12 @@ stdenv.mkDerivation rec {
dontStrip = true;
dontCrossStrip = true;
+ postInstall = ''
+ # Make linux headers available to users of this libc.
+ # Not sure why, but link in all but scsi directory as that's what uclibc/glibc do.
+ (cd $dev/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
+ '';
+
passthru = {
# isMusl can be dropped when/if providing the dynamicLinker
# name through the libc is adopted Unfortunately my tree is a bit of a mess so rebase'ing bits or generally separating from my own changes will take some time 😇 . |
Thank you for picking up the ball ;-) |
Haha, well I'll see what I can do and will of course give you appropriate attribution if I end up being the one wrapping this up 👍 . Anyway, pushed a few related commits here: https://github.com/dtzWill/nixpkgs/commits/musl_misc_commits Lots of package fixes too but those will take more time and probably need some testing and review :). |
@dtzWill are you going to create a new pull request regarding this? |
I'll close this then, @dtzWill can open a new PR... |
Motivation for this change
checked with readelf to make sure there isn't any leakage. (on all tested platforms)
built and tested an arm-unknown-linux-musleabi cross toolchain (depends on #15867, gcc6)
built and tested a clang based toolchain, even the bsds still have a libgcc package. I think it should be it's own package. It's currently provided by the glibc package.
It appears I was reading outdated information, need to investigate the libgcc dependency further:
https://svnweb.freebsd.org/base?view=revision&revision=260849
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)