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 cross-compilation fails to link libexpr-c #11546

Open
Mic92 opened this issue Sep 19, 2024 · 7 comments
Open

Freebsd cross-compilation fails to link libexpr-c #11546

Mic92 opened this issue Sep 19, 2024 · 7 comments
Labels
bug build-problem Nix fails to compile or test; also improvements to build process

Comments

@Mic92
Copy link
Member

Mic92 commented Sep 19, 2024

Describe the bug

$ nix develop .#packages.x86_64-linux.nix-x86_64-unknown-freebsd
$ ./configure $configureFlags
$ make

x86_64-unknown-freebsd-ld: error: undefined symbol: operator new(unsigned long, std::align_val_t)
>>> referenced by nix_api_expr.cc:108 (src/libexpr-c/nix_api_expr.cc:108)
>>>               src/libexpr-c/nix_api_expr.o:(nix_state_create)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mk/lib.mk:84: src/libexpr-c/libnixexprc.so] Error 1

Is freebsd not linking libc++ correctly?

@Mic92
Copy link
Member Author

Mic92 commented Sep 19, 2024

cc @rhelmot @Ericson2314 who may have interest in this.

@Mic92
Copy link
Member Author

Mic92 commented Sep 19, 2024

@rhelmot says it's because of wrong llvm configuration and it might be fixed in master.
Will test this.

@Mic92
Copy link
Member Author

Mic92 commented Sep 19, 2024

Switching to nixpkgs unstable fixes it.

@Ericson2314
Copy link
Member

The alignment of this is probably uninteresting, so we could write some fallback code too.

@roberth
Copy link
Member

roberth commented Sep 20, 2024

I think we should switch to nixos-unstable anyway, because we're developing for 24.11 at this point in time.

@roberth roberth added the build-problem Nix fails to compile or test; also improvements to build process label Sep 23, 2024
@Mic92
Copy link
Member Author

Mic92 commented Sep 24, 2024

nixpkgs-unstable now has an evaluation issue: NixOS/nixpkgs#344131
I am going to disable freebsd for this reason now in #11579

@Mic92
Copy link
Member Author

Mic92 commented Sep 24, 2024

Now we wait for NixOS/nixpkgs#344090 to hit nixpkgs-unstable.
https://nixpkgs-tracker.ocfox.me/?pr=344090

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build-problem Nix fails to compile or test; also improvements to build process
Projects
None yet
Development

No branches or pull requests

3 participants