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
WIP: Cross compilation to musl32 support #89471
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The makefile patch pulled from alpinelinux used to enable stackprotector unconditionally. This change use the nixpkgs flag hardeningEnable. This is required to support platform where stackprotector has problems.
The patches from alpinelinux failed to apply to v2.8.5, on the other hand upstream has added support for musl based system in the master branch on github [1]. The patch has been added to the nixpkgs repo since it needs to be modified slightly, a copyright notice has been removed, to apply cleanly. 1. linux-audit/audit-userspace@d579a08
Disable the pipe rewind related feature since musl has no support for it.
In order to support stackprotector on musl32, this change import a couple of patches from alpinelinux: 1. libssp_nonshared.a is built alongside musl's libc 2. the above library is automatically linked when compiling with gcc6 or gcc7
10 tasks
matthewbauer
reviewed
Jun 5, 2020
@@ -65,6 +65,10 @@ let majorVersion = "7"; | |||
}) | |||
++ optional langFortran ../gfortran-driving.patch | |||
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch | |||
++ optional (targetPlatform.libc == "musl" && targetPlatform.isx86_32) (fetchpatch { |
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.
is this still an issue with gcc 8+?
symphorien
reviewed
Jul 2, 2020
@@ -48,7 +47,7 @@ stdenv.mkDerivation rec { | |||
cp ${patch} $out | |||
substituteInPlace $out --replace \ | |||
'-* Copyright (c) 2007-09,2011-16,2018 Red Hat Inc., Durham, North Carolina.' \ | |||
'-* Copyright (c) 2007-09,2011-16 Red Hat Inc., Durham, North Carolina.' | |||
'-* Copyright (c) 2007-09,2012-19 Red Hat Inc., Durham, North Carolina.' |
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 patch does not apply.
$ nix-build . -A pkgsStatic.audit
these derivations will be built:
/nix/store/7si79l161j4vn7pkgbxis9n548q565jl-audit-2.8.5-x86_64-unknown-linux-musl.drv
building '/nix/store/7si79l161j4vn7pkgbxis9n548q565jl-audit-2.8.5-x86_64-unknown-linux-musl.drv'...
unpacking sources
unpacking source archive /nix/store/nbzjp4q72pb3rn4w03s6pwh2cqfyjvv1-audit-2.8.5.tar.gz
source root is audit-2.8.5
setting SOURCE_DATE_EPOCH to timestamp 1551474932 of file audit-2.8.5/bindings/swig/python3/audit.py
patching sources
applying patch /nix/store/38c3kkylsxv4bg1ya4gzlx1sdqcib733-Add-substitue-functions-for-strndupa-rawmemchr.patch-fix-copyright-merge-conflict
patching file ChangeLog
Hunk #1 succeeded at 32 with fuzz 2 (offset -30 lines).
patching file auparse/auparse.c
Hunk #2 succeeded at 1118 (offset -1 lines).
patching file auparse/interpret.c
Hunk #1 FAILED at 1.
Hunk #2 succeeded at 853 (offset -2 lines).
Hunk #3 succeeded at 870 (offset -2 lines).
1 out of 3 hunks FAILED -- saving rejects to file auparse/interpret.c.rej
patching file configure.ac
patching file src/ausearch-lol.c
builder for '/nix/store/7si79l161j4vn7pkgbxis9n548q565jl-audit-2.8.5-x86_64-unknown-linux-musl.drv' failed with exit code 1
error: build of '/nix/store/7si79l161j4vn7pkgbxis9n548q565jl-audit-2.8.5-x86_64-unknown-linux-musl.drv' failed
10 tasks
I marked this as stale due to inactivity. → More info |
stale
bot
added
the
2.status: stale
https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
label
Jul 21, 2021
was included in #112939 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
2.status: merge conflict
2.status: stale
https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
10.rebuild-darwin: 501-1000
10.rebuild-darwin: 501+
10.rebuild-linux: 501+
10.rebuild-linux: 1001-2500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the continuation of PR #62817
The original PR was based on master instead of the staging branch. I find easier to start a new PR.
I still need to review some commits.
Motivation for this change
Crosscompiling packages to musl32 lead to compilation errors due to the missing __stack_chk_fail_local symbol. Even building nix fails. This PR disable stackprotector for musl32.
Things done
Tested using sandboxing (nix.useSandbox on NixOS, or option
sandbox
innix.conf
on non-NixOS linux)Built on platform(s)
Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
Successful compilation of the following packages:
The following packages, among many others, does not build:
Tested execution of all binary files (usually in
./result/bin/
)Determined the impact on package closure size (by running
nix path-info -S
before and after)Ensured that relevant documentation is up to date
Fits CONTRIBUTING.md.