Skip to content

Restore the ability to build with clang on linux #4129

Closed

Description

@thufschmitt

Is your feature request related to a problem? Please describe.

Before the migration to a flake, the shell.nix file took a useClang argument that allowed to easily use clangStdenv rather than the default one. This argument doesn't exist anymore, and to the best of my knowledge, the only way to use clang is to patch the flake.nix file

Describe the solution you'd like

Restore a simple way to use clang rather than gcc for the build

Additional context

I guess adding back use useClang argument isn't possible (#3843 (comment)). Maybe it's possible to just add a new set of platforms (something like x86_64-linux-clang and friends) to the flake, but I'm not aware of anything on the nixpkgs side to handle that

Activity

  1. stale commented on Apr 10, 2021

    @stale

    I marked this as stale due to inactivity. → More info

  2. nixos-discourse commented on Jul 2, 2021

    @nixos-discourse

    This issue has been mentioned on NixOS Discourse. There might be relevant details there:

    https://discourse.nixos.org/t/tweag-fellowship-fuzzing-nix-1/13904/1

  3. self-assigned this
    on Jul 7, 2021
  4. added 4 commits that reference this issue on Jul 8, 2021
    7e7c615
    cd656ea
    1dcb30e
    d700ebd
  5. added a commit that references this issue on Jul 29, 2021
    c500e9b
  6. fzakaria commented on Nov 25, 2021

    @fzakaria
    Contributor

    @regnat would love to see this as a switch back + documentation in the Hacking Docs.

    I recently made local modifications to support Clang, that were fairly straightforward. I am not familiar enough with Flakes though to make it generic.
    https://gist.github.com/fzakaria/00dafaec3b3f0864d136470bf6579099

    Can flakes also add additional "build modes" ?
    For instance, I did some work to add sanitiziers with Clang and they needed some modifications to the LDFLAGS (i.e. removing -z,-def and adding -fno-omit-frame-pointer.
    https://gist.github.com/fzakaria/eab8d14695549ddefdf9ba09038016ad

  7. added 2 commits that reference this issue on Nov 26, 2021
    e8deedd
    e588f4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions