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

llvmPackages_13.libcxxStdenv has wrong header search paths #151879

Closed
crabtw opened this issue Dec 23, 2021 · 1 comment · Fixed by #153963
Closed

llvmPackages_13.libcxxStdenv has wrong header search paths #151879

crabtw opened this issue Dec 23, 2021 · 1 comment · Fixed by #153963
Labels
0.kind: bug Something is broken 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related

Comments

@crabtw
Copy link
Contributor

crabtw commented Dec 23, 2021

Describe the bug

When using llvmPackages_13.libcxxStdenv to compile program, clang reports no member named 'abort' in namespace 'std'.
Comparing search paths with llvm12, llvm13 has 3 additional paths.

 /nix/store/h6d0c7lnxx65i925xmnxgwdfdvc7hc2p-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0
 /nix/store/h6d0c7lnxx65i925xmnxgwdfdvc7hc2p-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/x86_64-unknown-linux-gnu
 /nix/store/h6d0c7lnxx65i925xmnxgwdfdvc7hc2p-gcc-10.3.0/lib64/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../../include/c++/10.3.0/backward

Steps To Reproduce

Steps to reproduce the behavior:

$ clang++ -c test.cpp

#include <cstdlib>

int main() {
    std::abort();
    return 0;
}

Expected behavior

clang reports no error.

Notify maintainers

@lovek323 @raskin @dtzWill @primeos

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.87, NixOS, 22.05 (Quokka)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.6.0pre20211217_6e6e998`
 - channels(root): `"home-manager, nixos, sops-nix"`
 - channels(user): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@crabtw crabtw added the 0.kind: bug Something is broken label Dec 23, 2021
@crabtw
Copy link
Contributor Author

crabtw commented Dec 24, 2021

It seems the problem is https://github.com/llvm/llvm-project/blob/d7b669b3a30345cfcdb2fde2af6f48aa4b94845d/clang/lib/Driver/ToolChains/Gnu.cpp#L2885-L2886 is not replaced with true since the pattern is different

sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
-e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
lib/Driver/ToolChains/*.cpp

crabtw added a commit to crabtw/nixpkgs that referenced this issue Feb 14, 2022
This patch adds nostdlibinc flag after parsing arguments
instead of sed substitution.

Fix NixOS#151879
@crabtw crabtw closed this as completed Feb 14, 2022
github-actions bot pushed a commit that referenced this issue Feb 21, 2022
This patch adds nostdlibinc flag after parsing arguments
instead of sed substitution.

Fix #151879

(cherry picked from commit 2fe19fe)
yayayayaka pushed a commit to yayayayaka/nixpkgs that referenced this issue May 1, 2022
This patch adds nostdlibinc flag after parsing arguments
instead of sed substitution.

Fix NixOS#151879

(cherry picked from commit 2fe19fe)
jsoo1 pushed a commit to awakesecurity/nixpkgs that referenced this issue Jul 13, 2023
This patch adds nostdlibinc flag after parsing arguments
instead of sed substitution.

Fix NixOS#151879

(cherry picked from commit 2fe19fe)
@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
0.kind: bug Something is broken 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants