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_12.stdenv is missing -lc++abi on darwin #181252

Closed
veprbl opened this issue Jul 12, 2022 · 1 comment
Closed

llvmPackages_12.stdenv is missing -lc++abi on darwin #181252

veprbl opened this issue Jul 12, 2022 · 1 comment
Labels
0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related

Comments

@veprbl
Copy link
Member

veprbl commented Jul 12, 2022

Describe the bug

llvmPackages_12.stdenv and llvmPackages_13.stdenv don't work on darwin. This makes it harder to use C++20 on darwin.

Steps To Reproduce

with import <nixpkgs> {};
  
llvmPackages_12.stdenv.mkDerivation {
  name = "test";
  input = builtins.toFile "test.cc" ''
  #include <iostream>

  int main() {
    std::cerr << "Hello, Nix!" << std::endl;
    return 0;
  }
  '';
  buildCommand = ''
    cp $input test.cc
    c++ test.cc -lc++abi # works
    ./a.out
    c++ test.cc # doesn't work
    ./a.out
  '';
}

Expected behavior

Should see:

Hello, Nix!
Hello, Nix!

Error

Undefined symbols for architecture x86_64:
  "operator delete(void*)", referenced from:
      std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in test-08e701.o
  "operator new(unsigned long)", referenced from:
      std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in test-08e701.o
  "___cxa_begin_catch", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-08e701.o
      ___clang_call_terminate in test-08e701.o
  "___cxa_end_catch", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-08e701.o
  "___gxx_personality_v0", referenced from:
      _main in test-08e701.o
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-08e701.o
      std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in test-08e701.o
      Dwarf Exception Unwind Info (__eh_frame) in test-08e701.o
ld: symbol(s) not found for architecture x86_64

Metadata

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

 - system: `"x86_64-darwin"`
 - sandbox: `relaxed`
@veprbl veprbl added 0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin labels Jul 12, 2022
@veprbl
Copy link
Member Author

veprbl commented Jul 12, 2022

Duplicate of #166205
Duplicate of #130963

@veprbl veprbl closed this as completed Jul 12, 2022
@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: darwin Running or building packages on Darwin 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related
Projects
None yet
Development

No branches or pull requests

2 participants