-
-
Notifications
You must be signed in to change notification settings - Fork 12.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
gmp: fix cross compilation to windows #132188
Conversation
@@ -48,6 +48,10 @@ let self = stdenv.mkDerivation rec { | |||
++ optional (!withStatic && stdenv.hostPlatform.isWindows) "--disable-static --enable-shared" | |||
++ optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) "--disable-assembly"; | |||
|
|||
# Required for "undefined reference to __memset_chk" error | |||
# see https://github.com/msys2/MINGW-packages-dev/pull/6 | |||
NIX_LDFLAGS = lib.optionalString stdenv.targetPlatform.isWindows "-lssp"; |
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.
CPPFLAGS=-fstack-protector
also gets through the __memset_chk
error, but later hits undefined reference to `__stack_chk_fail'`
Not sure if this should be backported to |
Diff LGTM |
I just ran into the same issue when trying to build |
This one also needs to target staging, due to the number of rebuilds. |
fd24eca
to
c1bc3f3
Compare
Actually, I'm confused. |
That's because |
adding -lssp could probably go in pkgs/build-support/cc-wrapper/add-hardening.sh maybe? |
Turns out this isn't quite right.
This ended up breaking other things, including a dependency of
It seems actually fixing this requires #38632, which in turn requires #132340, so I'm marking this as a draft for the time being. |
* The __memcpy_chk fix is similar to what is proposed here NixOS#132188 * We also need pthreads Didn't test running, but compiles fine.
|
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)