Skip to content

[tools] Fix LLVM_USE_SANITIZE_COVERAGE build #87722

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

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llvm/tools/llvm-dis-fuzzer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
set(LLVM_LINK_COMPONENTS
BitReader
Core
Support
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? They should already be transitive deps of BitReader:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be frank, I don't have a strong enough understanding of the LLVM build system to properly articulate an answer.

This change was necessary to get my local build working.

My local build uses -DBUILD_SHARED_LIBS=ON. When I tested -DBUILD_SHARED_LIBS=OFF, this change was not needed to use -DLLVM_USE_SANITIZE_COVERAGE=ON.

So, perhaps the transitive dependencies are not automatically added when using -DBUILD_SHARED_LIBS=ON. Does this seem reasonable to you @nikic?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm yeah, after looking at the cmake code a bit I think we make the dependencies of shared objects private.

)
add_llvm_fuzzer(llvm-dis-fuzzer
llvm-dis-fuzzer.cpp
Expand Down
2 changes: 2 additions & 0 deletions llvm/tools/vfabi-demangle-fuzzer/vfabi-demangler-fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
//===----------------------------------------------------------------------===//

#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/VFABIDemangler.h"
#include "llvm/Support/SourceMgr.h"

using namespace llvm;

Expand Down