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

FreeBSD support with knowledge about Linux emulation #704

Merged
merged 5 commits into from
Nov 24, 2015
Merged

FreeBSD support with knowledge about Linux emulation #704

merged 5 commits into from
Nov 24, 2015

Conversation

ysangkok
Copy link
Contributor

This is just the build fixes of #657 with the additional canBuildLocally patch to ensure that Nix knows it can build i686 Linux binaries even if it is a FreeBSD machine. Linux emulation does not work for 64-bit binaries, so this is not enabled.

manueljacob and others added 5 commits October 6, 2015 22:28
Previously, pkg-config was already queried for libsqlite3's and
libcurl's link flags.  However they were not used, but hardcoded
instead.  This commit replaces the hardcoded LDFLAGS by the ones
provided by pkg-config in a similar pattern as already used for
libsodium.
Eventually the nested if statements should be replaced by a more general
condition, but this is sufficient to make it work on FreeBSD.
There is no libdl on FreeBSD.  Instead the symbols are included in libc.
Some evidence that defining it to be 0 is right:
* OS X headers define it to be 0.
* Other code uses 0 instead of SOL_LOCAL to check for peer credentials
  (e.g. FreeBSD's implementation of getpeereid).
@Ericson2314
Copy link
Member

Hmm, someone should try with with branded zones on Illumos.

@vizanto
Copy link
Contributor

vizanto commented Nov 20, 2015

@Ericson2314 an lx branded zone presents itself as Linux :)
I have a SmartOS image 90% ready, just needs to be published to datasets.at

@Ericson2314
Copy link
Member

@vizanto Sure one can do run everything on an lx branded zone (and good job doing that BTW!), but I meant have Nix running "natively" and build both illumos and Linux binaries (and spin up lx branded zones for building the latter I suppose).

That's more work than this patch alone of course.

@vizanto
Copy link
Contributor

vizanto commented Nov 20, 2015

Yes, indeed it is @Ericson2314 NixOS/nixpkgs#11067
Not sure how to build a linux binary in a non-lx branded illumos zone though.

@Ericson2314
Copy link
Member

Oh wow, that's wonderful! Mmm I think one would use lx-branded zones. Now that our build-sandboxing support has been generalized to work for Linux and Darwin, hopefully it wouldn't be too hard to make it understand zones on Illumos.

@ysangkok
Copy link
Contributor Author

@edolstra I tested this, and I believe we decided at the NixCon that this is ready to merge. Patchelf issue 36 still applies though.

edolstra added a commit that referenced this pull request Nov 24, 2015
FreeBSD support with knowledge about Linux emulation
@edolstra edolstra merged commit cad40ad into NixOS:master Nov 24, 2015
@edolstra
Copy link
Member

Thanks, merged!

@ysangkok ysangkok deleted the freebsd-support branch November 24, 2015 23:34
@vcunat
Copy link
Member

vcunat commented Nov 25, 2015

Hey, FreeBSD users, does #55 still apply? (I unfortunately don't have elevated rights in this repo, so I would be unable to close it myself.)

edolstra added a commit that referenced this pull request Nov 25, 2015
Also, make the FreeBSD checks conditional on FreeBSD.
zolodev pushed a commit to zolodev/nix that referenced this pull request Jan 1, 2024
Use bold instead of monospace for emphasis
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

Successfully merging this pull request may close these issues.

7 participants