[libcxx-commits] [PATCH] D48680: Add missing visibility annotation for __base

Peter Collingbourne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 4 12:59:38 PDT 2019


pcc added a comment.

Here's a standalone reproducer for the problem:

  $ cat exe.cpp
  #include <functional>
  
  std::function<void()> f();
  
  int main() {
    f()();
  }
  $ cat dso.cpp
  #include <functional>
  
  __attribute__((visibility("default"))) std::function<void()> f() {
    return [](){};
  }
  $ ~/l3/ra-cmake/bin/clang++ -fsanitize=cfi -fvisibility=hidden dso.cpp -shared -flto -fuse-ld=lld -Wl,-soname,dso.so -o dso.so -stdlib=libc++ -fno-rtti -fno-exceptions
  $ ~/l3/ra-cmake/bin/clang++ -fsanitize=cfi -fvisibility=hidden exe.cpp  -flto -fuse-ld=lld dso.so -stdlib=libc++
  $ LD_LIBRARY_PATH=.:$HOME/l3/ra-cmake/lib ./a.out 
  Illegal instruction

With this patch:

  $ LD_LIBRARY_PATH=.:$HOME/l3/ra-cmake/lib ./a.out 
  [no output]


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D48680/new/

https://reviews.llvm.org/D48680





More information about the libcxx-commits mailing list