Skip to content

Commit 30f221b

Browse files
committed
Revert "[Symbolizer][Debuginfo] Add debuginfod client to llvm-symbolizer."
This reverts commit 5bba0fe. Makes lld depend on libcurl, see comments on https://reviews.llvm.org/D113717
1 parent 5a40df6 commit 30f221b

File tree

10 files changed

+6
-62
lines changed

10 files changed

+6
-62
lines changed

compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ if [[ ! -d ${LLVM_BUILD} ]]; then
143143
$LLVM_SRC
144144
fi
145145
cd ${LLVM_BUILD}
146-
ninja LLVMSymbolize LLVMObject LLVMBinaryFormat LLVMDebugInfoDWARF LLVMSupport LLVMDebugInfoPDB LLVMDebuginfod LLVMMC LLVMDemangle LLVMTextAPI
146+
ninja LLVMSymbolize LLVMObject LLVMBinaryFormat LLVMDebugInfoDWARF LLVMSupport LLVMDebugInfoPDB LLVMMC LLVMDemangle LLVMTextAPI
147147

148148
cd ${BUILD_DIR}
149149
rm -rf ${SYMBOLIZER_BUILD}
@@ -170,7 +170,6 @@ $SCRIPT_DIR/ar_to_bc.sh $LIBCXX_ARCHIVE_DIR/libc++.a \
170170
$LLVM_BUILD/lib/libLLVMDebugInfoPDB.a \
171171
$LLVM_BUILD/lib/libLLVMDebugInfoMSF.a \
172172
$LLVM_BUILD/lib/libLLVMDebugInfoCodeView.a \
173-
$LLVM_BUILD/lib/libLLVMDebuginfod.a \
174173
$LLVM_BUILD/lib/libLLVMDemangle.a \
175174
$LLVM_BUILD/lib/libLLVMMC.a \
176175
$LLVM_BUILD/lib/libLLVMTextAPI.a \

llvm/include/llvm/Debuginfod/HTTPClient.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,13 @@ class BufferedHTTPResponseHandler final : public HTTPResponseHandler {
7979
class HTTPClient {
8080
#ifdef LLVM_ENABLE_CURL
8181
void *Curl = nullptr;
82+
static bool IsInitialized;
8283
#endif
8384

8485
public:
8586
HTTPClient();
8687
~HTTPClient();
8788

88-
static bool IsInitialized;
89-
9089
/// Returns true only if LLVM has been compiled with a working HTTPClient.
9190
static bool isAvailable();
9291

llvm/lib/DebugInfo/Symbolize/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ add_llvm_component_library(LLVMSymbolize
99
LINK_COMPONENTS
1010
DebugInfoDWARF
1111
DebugInfoPDB
12-
Debuginfod
1312
Object
1413
Support
1514
Demangle

llvm/lib/DebugInfo/Symbolize/Symbolize.cpp

+1-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
2121
#include "llvm/DebugInfo/PDB/PDB.h"
2222
#include "llvm/DebugInfo/PDB/PDBContext.h"
23-
#include "llvm/Debuginfod/Debuginfod.h"
2423
#include "llvm/Demangle/Demangle.h"
2524
#include "llvm/Object/COFF.h"
2625
#include "llvm/Object/MachO.h"
@@ -385,14 +384,7 @@ bool findDebugBinary(const std::vector<std::string> &DebugFileDirectory,
385384
}
386385
}
387386
}
388-
// Try debuginfod client cache and known servers.
389-
Expected<std::string> PathOrErr = getCachedOrDownloadDebuginfo(BuildID);
390-
if (!PathOrErr) {
391-
consumeError(PathOrErr.takeError());
392-
return false;
393-
}
394-
Result = *PathOrErr;
395-
return true;
387+
return false;
396388
}
397389

398390
} // end anonymous namespace

llvm/lib/Debuginfod/Debuginfod.cpp

+1-8
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,6 @@ Expected<std::string> getCachedOrDownloadArtifact(
139139
return createStringError(errc::io_error,
140140
"No working HTTP client is available.");
141141

142-
if (!HTTPClient::IsInitialized)
143-
return createStringError(
144-
errc::io_error,
145-
"A working HTTP client is available, but it is not initialized. To "
146-
"allow Debuginfod to make HTTP requests, call HTTPClient::initialize() "
147-
"at the beginning of main.");
148-
149142
HTTPClient Client;
150143
Client.setTimeout(Timeout);
151144
for (StringRef ServerUrl : DebuginfodUrls) {
@@ -164,7 +157,7 @@ Expected<std::string> getCachedOrDownloadArtifact(
164157
// file cache.
165158
Expected<std::unique_ptr<CachedFileStream>> FileStreamOrErr =
166159
CacheAddStream(Task);
167-
if (!FileStreamOrErr)
160+
if (FileStreamOrErr)
168161
return FileStreamOrErr.takeError();
169162
std::unique_ptr<CachedFileStream> &FileStream = *FileStreamOrErr;
170163
if (!Response.Body)

llvm/lib/Debuginfod/HTTPClient.cpp

+2-8
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@ Error BufferedHTTPResponseHandler::handleStatusCode(unsigned Code) {
7272
return Error::success();
7373
}
7474

75-
bool HTTPClient::IsInitialized = false;
76-
77-
class HTTPClientCleanup {
78-
public:
79-
~HTTPClientCleanup() { HTTPClient::cleanup(); }
80-
};
81-
static const HTTPClientCleanup Cleanup;
82-
8375
Expected<HTTPResponseBuffer> HTTPClient::perform(const HTTPRequest &Request) {
8476
BufferedHTTPResponseHandler Handler;
8577
if (Error Err = perform(Request, Handler))
@@ -96,6 +88,8 @@ Expected<HTTPResponseBuffer> HTTPClient::get(StringRef Url) {
9688

9789
bool HTTPClient::isAvailable() { return true; }
9890

91+
bool HTTPClient::IsInitialized = false;
92+
9993
void HTTPClient::initialize() {
10094
if (!IsInitialized) {
10195
curl_global_init(CURL_GLOBAL_ALL);

llvm/test/tools/llvm-symbolizer/debuginfod.test

-27
This file was deleted.

llvm/tools/llvm-symbolizer/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ add_public_tablegen_target(SymbolizerOptsTableGen)
1010
set(LLVM_LINK_COMPONENTS
1111
DebugInfoDWARF
1212
DebugInfoPDB
13-
Debuginfod
1413
Demangle
1514
Object
1615
Option

llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "llvm/Config/config.h"
2020
#include "llvm/DebugInfo/Symbolize/DIPrinter.h"
2121
#include "llvm/DebugInfo/Symbolize/Symbolize.h"
22-
#include "llvm/Debuginfod/HTTPClient.h"
2322
#include "llvm/Option/Arg.h"
2423
#include "llvm/Option/ArgList.h"
2524
#include "llvm/Option/Option.h"
@@ -262,8 +261,6 @@ static FunctionNameKind decideHowToPrintFunctions(const opt::InputArgList &Args,
262261

263262
int main(int argc, char **argv) {
264263
InitLLVM X(argc, argv);
265-
// The HTTPClient must be initialized for use by the debuginfod client.
266-
HTTPClient::initialize();
267264
sys::InitializeCOMRAII COM(sys::COMThreadingMode::MultiThreaded);
268265

269266
bool IsAddr2Line = sys::path::stem(argv[0]).contains("addr2line");

llvm/utils/gn/secondary/llvm/lib/DebugInfo/Symbolize/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ static_library("Symbolize") {
44
"//llvm/include/llvm/Config:config",
55
"//llvm/lib/DebugInfo/DWARF",
66
"//llvm/lib/DebugInfo/PDB",
7-
"//llvm/lib/Debuginfod",
87
"//llvm/lib/Demangle",
98
"//llvm/lib/Object",
109
"//llvm/lib/Support",

0 commit comments

Comments
 (0)