Nixpkgs: clangMultiStdenv is unable to link i686 code

Created on 27 Jul 2020  Â·  8Comments  Â·  Source: NixOS/nixpkgs

Describe the bug
Currently on a local checkout of c83e13315caadef275a5d074243c67503c558b3b, clangMultiStdenv is incapable of linking i686 code. If attempting to do so, ld finds only the x86_64 variants of some of the crucial compiler dependencies. I think this Hydra test is a relevant failure, started failing 2020-07-03.

To Reproduce
Steps to reproduce the behavior:

  1. Try to build a 32-bit binary in a derivation via clangMultiStdenv (specifically this stdenv, not just clang_multi)

Linker will be unable to find any of the gcc dependencies (-lgcc, libgcc_s.so.1, crtbeginS.o, crtendS.o, …)

Expected behavior
The code compiles fine without any problems. (https://github.com/darlinghq/darling/tree/master/src/libelfloader/native)

Screenshots
(Code is a derivation I've been working on, shouldn't matter for this bug.)
grafik

Additional context
Fetching a shell with clang_multi and running the same command works fine.

Notify maintainers
Don't know who or what broke it, only that it did break at some point.

Metadata

  • system: "x86_64-linux"
  • host os: Linux 4.14.176, NixOS, 19.09.2518.8260cd5bc65 (Loris)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.3
  • channels(root): "nixos-19.09.2518.8260cd5bc65"
  • channels(bt1cn): "unstable-20.09pre235279.5717d9d2f7c, stable-19.09.1686.69ed29f5f41"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

(I know I should update my system)

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
- clangMultiStdenv
# a list of nixos modules affected by the problem
module:
bug

Most helpful comment

Has there been any progress on fixing this? It would be great to have clangMultiStdenv working again before the 20.09 release.

All 8 comments

I've also encountered this problem, but I switched to gccMultiStdenv and forgot about it.

It's unfortunately not that easy for my use case, I am trying to package something that specifically requires Clang capable of linking both 64-bit and 32-bit code.

I rebased my derivation on a checkout of 1f03d4980f163bc485960c793159d90afe4ea62b (last known-good commit for this test) and the build indeed progresses past the first 32-bit linking. I'll try to figure out the exact commit that broke this when I have abit more time at hand.

@OPNA2608 Oh sorry, I meant that I forgot to report an issue because I found a workaround. I didn't mean to suggest it as a solution. I would still prefer to use clangMultiStenv so I will spend some time looking into this too.

Been running a git bisect since yesterday, still need to do the final build but it seems like it's homing in on 704daf7a6e4e5f26c5b0ad67ed8bd1b2090aa8ed being the breaking commit.

Bisect indeed blames 704daf7a6e4e5f26c5b0ad67ed8bd1b2090aa8ed. CC @Ericson2314 because you committed it, can you take a closer look at this?

Yes this is my fault and I need to fix it.

Has there been any progress on fixing this? It would be great to have clangMultiStdenv working again before the 20.09 release.

I found https://github.com/NixOS/nixpkgs/commit/4a78b2b04f3f63eaf1c29dca12d44d820bb9374a to be the first commit introducing the break.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

teto picture teto  Â·  3Comments

rzetterberg picture rzetterberg  Â·  3Comments

ayyess picture ayyess  Â·  3Comments

grahamc picture grahamc  Â·  3Comments

chris-martin picture chris-martin  Â·  3Comments