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

Use the nix-support/cc-flags file to configure compiler flags #225

Closed
aherrmann opened this issue May 5, 2022 · 0 comments · Fixed by #227
Closed

Use the nix-support/cc-flags file to configure compiler flags #225

aherrmann opened this issue May 5, 2022 · 0 comments · Fixed by #227
Assignees
Labels
P2 major: an upcoming release type: feature request

Comments

@aherrmann
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently we configure default compiler flags in the Nix provided CC toolchain by creating a wrapper script around the compiler binary. However, nixpkgs already has a feature to configure such flags through the cc-flags and ld-flags file in the nix-support directory.

An issue with the wrapper approach is that the flags are passed indiscriminately of how the compiler is invoked. In certain invocations this can cause incompatibilities. For example, on MacOS Monterey on M1 with an LLVM toolchain it was found that calling the compiler with -v and any -l or -isystem flags caused errors. See digital-asset/daml@fb3ecdc for details.

Describe the solution you'd like
Configure any additional flags to the CC toolchain using the cc-flags or ld-flags files. An implementation that can be upstreamed exists here digital-asset/daml@fb3ecdc

Additional context
This was discovered while working on M1 support on Daml here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 major: an upcoming release type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants