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

cc-wrapper: -nostdlib does not imply -nostdinc++ #111970

Merged
merged 1 commit into from
Mar 20, 2021

Conversation

ttuegel
Copy link
Member

@ttuegel ttuegel commented Feb 4, 2021

Motivation for this change

The check for including the C++ standard library headers was nested inside the
check for linking with the C++ standard library. As a result, the -nostdlib
flag incorrectly implied -nostdinc++, which made it virtually impossible to
partially link C++ objects.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The check for including the C++ standard library headers was nested inside the
check for linking with the C++ standard library. As a result, the `-nostdlib`
flag incorrectly implied `-nostdinc++`, which made it virtually impossible to
partially link C++ objects.
@thefloweringash
Copy link
Member

I think this broke darwin.network_cmds by including a c++ library with a module map when compiling a c program. This package is doing something weird by enabling modules with -fmodules and setting the language via -x c. I don't know if this is a sensible configuration, but it compiles without error on system clang.

Short reproduction (observed on x86_64-linux and x86_64-darwin):

nix run -f . llvmPackages.tools.libcxxClang -c clang -fmodules -x c -c <(echo "#include <string.h>")

veprbl added a commit to veprbl/nixpkgs that referenced this pull request May 2, 2021
jwiegley pushed a commit to jwiegley/nixpkgs that referenced this pull request May 8, 2021
jwiegley pushed a commit to jwiegley/nixpkgs that referenced this pull request May 11, 2021
jwiegley pushed a commit to jwiegley/nixpkgs that referenced this pull request May 12, 2021
jwiegley pushed a commit to jwiegley/nixpkgs that referenced this pull request May 12, 2021
jwiegley pushed a commit to jwiegley/nixpkgs that referenced this pull request May 13, 2021
jwiegley pushed a commit to jwiegley/nixpkgs that referenced this pull request May 14, 2021
jwiegley pushed a commit to jwiegley/nixpkgs that referenced this pull request May 14, 2021
jwiegley pushed a commit to jwiegley/nixpkgs that referenced this pull request May 15, 2021
jwiegley pushed a commit to jwiegley/nixpkgs that referenced this pull request May 16, 2021
jwiegley pushed a commit to jwiegley/nixpkgs that referenced this pull request May 17, 2021
@rrbutani rrbutani added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ 10.rebuild-linux-stdenv This PR causes stdenv to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants