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

Cross glibc retains references to static gcc #35251

Closed
shlevy opened this issue Feb 20, 2018 · 16 comments
Closed

Cross glibc retains references to static gcc #35251

shlevy opened this issue Feb 20, 2018 · 16 comments
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: closure size The final size of a derivation, including its dependencies 6.topic: cross-compilation Building packages on a different platform than they will be used on

Comments

@shlevy
Copy link
Member

shlevy commented Feb 20, 2018

(and through it, the native stdenv)

@shlevy shlevy added 0.kind: bug Something is broken 6.topic: closure size The final size of a derivation, including its dependencies 6.topic: cross-compilation Building packages on a different platform than they will be used on labels Feb 20, 2018
@shlevy
Copy link
Member Author

shlevy commented Feb 20, 2018

@Ericson2314 Any ideas here?

@dtzWill
Copy link
Member

dtzWill commented Feb 21, 2018

Can you give an example of what you mean? What does nix why-depends say?

@shlevy
Copy link
Member Author

shlevy commented Feb 21, 2018

$ nix why-depends /nix/store/dpm7mia5w73bazhdp208qxq8k5l4wwvy-glibc-2.27-riscv64-unknown-linux-gnu/ /nix/store/rq593rsgmzl8mbx4khjx0gla3ws6nyn3-gcc-7.3.0-riscv64-unknown-linux-gnu-stage-static/
/nix/store/dpm7mia5w73bazhdp208qxq8k5l4wwvy-glibc-2.27-riscv64-unknown-linux-gnu
╚═══lib/Scrt1.o: …...................../nix/store/rq593rsgmzl8mbx4khjx0gla3ws6nyn3-gcc-7.3.0-riscv64-unknown-linux…
=> /nix/store/rq593rsgmzl8mbx4khjx0gla3ws6nyn3-gcc-7.3.0-riscv64-unknown-linux-gnu-stage-static

@Ericson2314
Copy link
Member

Ahhh. I bet this relates to how I had to nuke more refs in make-bootstrap-tools when I combined the native and cross versions.

I'm on my phone, so try git loging that to see what I changed and then look there.

@shlevy
Copy link
Member Author

shlevy commented Feb 21, 2018

@Ericson2314 Nothing obvious popping out, sorry

@dtzWill
Copy link
Member

dtzWill commented Feb 21, 2018

... why does Scrt1.o have path references/strings, anyway?

This may be specific to glibc 2.27 and/or gcc 7, which aren't used by other cross configurations... at least on master.

@dtzWill
Copy link
Member

dtzWill commented Feb 21, 2018

(this doesn't happen on, say, aarch64-musl, at least that's what I remember from poking at this last night... :))

@dtzWill
Copy link
Member

dtzWill commented Feb 21, 2018

Context for question on Scrt1.o: crt files are small (tiny! they're linked into all the things), usually defining a symbol or two .... for example on musl Scrt1 is a differently built crt1 with source like this:
https://git.musl-libc.org/cgit/musl/tree/crt/crt1.c

Hardly something you'd expect to retain the path of the compiler it was built with. I wonder if that happens with glib 2.27 on non cross or other archs?

@shlevy
Copy link
Member Author

shlevy commented Feb 21, 2018

Doesn't appear to happen on non-cross based on the glibc-2.27 branch

@Ericson2314
Copy link
Member

debug info, I'd think. Cross stuff has less stripping sometimes.

@Ericson2314
Copy link
Member

#36948 probably also fixes this?

@goertzenator
Copy link
Contributor

I ran into this in #53424 and after some experimentation landed here.

I commented out the glibc dontStrip = true line and all the extra dependencies fell away. Closure size went from 300M to 28M. So yes, it is debug info.

@lopsided98
Copy link
Contributor

Do we actually need to disable stripping anymore? Tracing back through git blame and the history of the glibc package, it seems like this might have initially been added by c6b5264 in 2009 and was carried through all the updates since then. It wouldn't surprise me if it was no longer necessary, but someone should check if anything breaks.

@goertzenator
Copy link
Contributor

There is a reference to cross-arm breakage, but I have no idea if that is still valid or not.

@stale
Copy link

stale bot commented Jun 3, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2020
@lopsided98
Copy link
Contributor

This was fixed by #59787.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: closure size The final size of a derivation, including its dependencies 6.topic: cross-compilation Building packages on a different platform than they will be used on
Projects
None yet
Development

No branches or pull requests

5 participants