Skip to content

libc should just be another library #26004

@Ericson2314

Description

@Ericson2314

Right now, libc is special: instead of just being another library dependency, it is passed to cc-wrapper where a bunch of magic happens for dynamic linking. I rather it just be another library with the caveat that if you don't depend on it dynamic linking won't work. Worst case, some of that dynamic-linking logic would go from the wrapper to the setup hook. mkDerivation would add that dependency by default, but packages (e.g. libc itself for obvious reasons) would opt out.

Relatedly, when bootstrapping (a new stdenv from a tarball or a cross stdenv), we current build "static" versions of the compiler that's aren't wrapped with libc, and then build libc, and then build the compiler again. At the very last, I'd like to just re-wrap the old compiler with libc and avoid the rebuild, but if we're not wrapping libc too, then let's just build and wrap the compiler once.

I assume there's a reason for all the double wrapping and double building we do now, but I don't know what it is.

CC @copumpkin @vcunat @DavidEGrayson @elitak @dmjio @eternaleye

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancementAdd something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: cross-compilationBuilding packages on a different platform than they will be used on9.needs: community feedbackThis needs feedback from more community members.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions