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

buildCross.nix-expr-c.x86_64-unknown-freebsd.x86_64-linux fails to compile #11835

Open
edolstra opened this issue Nov 8, 2024 · 4 comments
Open
Labels
bug build-problem Nix fails to compile or test; also improvements to build process

Comments

@edolstra
Copy link
Member

edolstra commented Nov 8, 2024

Describe the bug

https://hydra.nixos.org/build/277988251

It fails with

x86_64-unknown-freebsd-ld: error: undefined symbol: operator new(unsigned long, std::align_val_t)

due to

        void * p = ::operator new(
            sizeof(EvalState),
            static_cast<std::align_val_t>(alignof(EvalState)));

in src/libexpr-c/nix_api_expr.cc.

@Ericson2314 Do we actually need the explicit alignment?

Steps To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

nix-env --version output

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

@edolstra edolstra added bug build-problem Nix fails to compile or test; also improvements to build process labels Nov 8, 2024
@Ericson2314
Copy link
Member

CC @rhelmot @artemist do you know with the variosu C++ ABI changes whether this will start working in 24.11?

@edolstra I doubt the alignment is actually funky, but I also don't know whether it is for sure. We could do a static_assert or C-style allocation (with alignment) instead, but I am hoping that the problem will also just go away.

@artemist
Copy link
Member

Interesting... I've had issues with -Wl,-z,defs flags in lix that I fixed, but only for libc symbols, not for C++ symbols. The lix build issues were all fixed in 24.11, but IIRC C++ wasn't part of that, just Rust.

@rhelmot
Copy link

rhelmot commented Nov 11, 2024

I'm not actually sure how to reproduce this - when I try to nix build github:nixos/nixpkgs/nixos-24.05#pkgsCross.x86_64-freebsd.stdenv.cc as indicated by the flake I get a gcc internal compiler error: Segmentation fault while compiling llvm17?

@rhelmot
Copy link

rhelmot commented Nov 11, 2024

I ran across an old conversation (september) between myself and Joerg about this error specifically. It looks like we determined that it was already fixed by simply switching to nixpkgs-unstable, and at the time I identified NixOS/nixpkgs#316249 as the fix.

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

4 participants