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

Alternative sysroots #20

Open
GregBowyer opened this issue May 19, 2023 · 1 comment
Open

Alternative sysroots #20

GregBowyer opened this issue May 19, 2023 · 1 comment

Comments

@GregBowyer
Copy link

Not quite sure how to ask this so well asking

How could this be used to create and use an alternate (not nixos) sysroot.

My usecase is drag the toolchain from the void ^H^H^H^H nixos but provide a sysroot from something old, gross and crufty.

My needs are:

  • Cross compilation linux -> OSX M1 (for example)
  • Linux binaries for RHEL7
@thoughtpolice
Copy link
Owner

thoughtpolice commented May 27, 2023

Sorry for missing this.

It's something I've thought about but it's definitely unsupported. I think you're probably best off using the upstream buck2-prelude and using something like Zig to compile binaries. You don't need the custom code or APIs to do that. There is upstream code to do it already.

This example calls the zig_cxx_toolchain function to download a Zig binary and configures buck2 to use zig cc as the C/C++ compiler. This can probably handle both the cases you want to some extent (M1 cross compilation is limited to non-Foundation libc, while I don't even know what glibc version RHEL 7 needs) but you'll likely need to fiddle with it yourself a bit.

https://github.com/facebook/buck2/tree/main/examples/toolchains/cxx_zig_toolchain
https://github.com/facebook/buck2/blob/main/examples/toolchains/cxx_zig_toolchain/toolchains/BUCK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants