[PATCH] D84947: Add libFuzzer shared object build output

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 5 12:09:09 PDT 2020


lebedev.ri added inline comments.


================
Comment at: compiler-rt/lib/fuzzer/CMakeLists.txt:192
+  set(LIBFUZZER_SHARED_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS})
+  list(APPEND LIBFUZZER_SHARED_LINK_LIBS "-lstdc++")
+  list(APPEND LIBFUZZER_SHARED_LINK_LIBS "-lm")
----------------
morehouse wrote:
> jfb wrote:
> > This is broken on non-Linux and non-Fuchsia architectures which don't have libstdc++, for example Darwin. Can you please fix or revert? 
> Would it be sufficient to add the following?
> ```
> if (DARWIN)
>   list(APPEND LIBFUZZER_SHARED_LINK_LIBS "-lc++")
> else()
>   list(APPEND LIBFUZZER_SHARED_LINK_LIBS "-lstdc++")
> endif()
> ```
> Or are there more platforms that are missing libstdc++?
Why is this particular line hardcoding some particular C++ STD implementation in the first place?
Ignoring distro defaults, one can always pass `-stdlib=libc++` to clang.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84947



More information about the llvm-commits mailing list