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

Clang can't find headers when cross-compiling back to same platform #310651

Closed
thenhnn opened this issue May 10, 2024 · 1 comment
Closed

Clang can't find headers when cross-compiling back to same platform #310651

thenhnn opened this issue May 10, 2024 · 1 comment
Labels
0.kind: build failure A package fails to build 6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: stdenv Standard environment

Comments

@thenhnn
Copy link
Contributor

thenhnn commented May 10, 2024

Steps To Reproduce

Steps to reproduce the behavior:

  1. build following expression on latest nixos-unstable:
let
  nixpkgs = builtins.getFlake "nixpkgs";
  pkgs = import nixpkgs {
    localSystem = "x86_64-linux";
    crossSystem = {
      system = "x86_64-linux";
      useLLVM = true;
      linker = "lld";
    };
  };
in
  pkgs.stdenv.mkDerivation {
    phases = ["build"];
    name = "test";
    build = ''
      echo "#include <iostream>" | $CXX -xc++ -E - > $out
    '';
  }

(It works, the problem is in something else)

Build log

test-x86_64-unknown-linux-gnu> Running phase: build
test-x86_64-unknown-linux-gnu> <stdin>:1:10: fatal error: 'iostream' file not found
test-x86_64-unknown-linux-gnu>     1 | #include <iostream>
test-x86_64-unknown-linux-gnu>       |          ^~~~~~~~~~
test-x86_64-unknown-linux-gnu> 1 error generated.

Additional context

Probably regression from #264865?

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.30, NixOS, 24.05 (Uakari), 24.05.20240507.b211b39`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/f0ssy3p6898x9k880l23mhd0fl6rvrb2-source`

Add a 👍 reaction to issues you find important.

@thenhnn thenhnn added the 0.kind: build failure A package fails to build label May 10, 2024
@K900 K900 added 6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: stdenv Standard environment labels May 10, 2024
@thenhnn
Copy link
Contributor Author

thenhnn commented May 12, 2024

Ooops. Sorry, it was XY problem. I will create other issue.

@thenhnn thenhnn changed the title Clang can't find headers when cross-compiling back to same platform Clang doesn't use lld (even with linker = "lld";) when cross-compiling back to same platform May 12, 2024
@thenhnn thenhnn changed the title Clang doesn't use lld (even with linker = "lld";) when cross-compiling back to same platform Clang can't find headers when cross-compiling back to same platform May 12, 2024
@thenhnn thenhnn closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build 6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: stdenv Standard environment
Projects
None yet
Development

No branches or pull requests

2 participants