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

doc/stdenv/cross-compilation: Add 'Using -static outside a isStatic platform' #344985

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

Artturin
Copy link
Member

This issue often comes up when builds use -static in their own build
system

This may not be the correct location for this as it's not strictly a
cross issue, but it's the best one I can think of

Inspired by someone wanting to build a riscv-busybox-initramfs and just
adding pkgsCross.riscv32.stdenv.cc to nativeBuildInputs

@Artturin Artturin changed the title doc/stdenv/cross-compilation: Add Using -static outside a isStatic platform doc/stdenv/cross-compilation: Add 'Using -static outside a isStatic platform' Sep 28, 2024
@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Sep 28, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Sep 28, 2024
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Sep 29, 2024

Example of an error which this fixes.

`cannot find -lm: No such file or directory`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add -lc as its common one too

@shelvacu
Copy link
Contributor

Isn't the "right" solution to use an isStatic platform? I'm not against including these instructions (for those "im in a wierd situation please just tell me how to do the thing" situations) but they should start out with "you should probably be using an isStatic platform"

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Oct 16, 2024
@shelvacu
Copy link
Contributor

Inspired by someone wanting to build a riscv-busybox-initramfs and just
adding pkgsCross.riscv32.stdenv.cc to nativeBuildInputs

What is riscv-busybox-initramfs? Could you make a repro for this? (even though it isn't really a bug)

@Artturin
Copy link
Member Author

Isn't the "right" solution to use an isStatic platform? I'm not against including these instructions (for those "im in a wierd situation please just tell me how to do the thing" situations) but they should start out with "you should probably be using an isStatic platform"

Added a note

…c` platform'

This issue often comes up when builds use `-static` in their own build
system

This may not be the correct location for this as it's not strictly a
cross issue, but it's the best one I can think of

Inspired by someone wanting to build a `riscv-busybox-initramfs` and just
adding `pkgsCross.riscv32.stdenv.cc` to `nativeBuildInputs`
@Artturin
Copy link
Member Author

Inspired by someone wanting to build a riscv-busybox-initramfs and just
adding pkgsCross.riscv32.stdenv.cc to nativeBuildInputs

What is riscv-busybox-initramfs? Could you make a repro for this? (even though it isn't really a bug)

It was just something in the matrix cross room, I don't have it.

@Artturin Artturin merged commit 2db8942 into NixOS:master Oct 20, 2024
25 checks passed
@Artturin Artturin deleted the adddoccross branch October 20, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 8.has: documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants