aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Meumertzheim <fabian@meumertzhe.im>2022-08-16 21:44:01 +0200
committerFabian Meumertzheim <fabian@meumertzhe.im>2022-08-19 17:14:53 +0200
commit8958f6b4daa5dcc23490e05c4252090d07486ac6 (patch)
treeecf40e93544b6adad5bd220fb8344b05429fb75a
parent485f8af313bf6433a064d8aa1a50bf64dae503f5 (diff)
downloadjazzer-api-8958f6b4daa5dcc23490e05c4252090d07486ac6.tar.gz
driver: Remove glog
Two `LOG(ERROR)` usages are converted to ordinary prints, one `LOG(INFO)` usage is dropped without replacement since the `JAVA_FUZZER_CLASSPATH` variable isn't even documented.
-rw-r--r--driver/BUILD.bazel2
-rw-r--r--driver/jazzer_main.cpp4
-rw-r--r--driver/jvm_tooling.cpp12
-rw-r--r--repositories.bzl9
4 files changed, 5 insertions, 22 deletions
diff --git a/driver/BUILD.bazel b/driver/BUILD.bazel
index ac285958..2d503cce 100644
--- a/driver/BUILD.bazel
+++ b/driver/BUILD.bazel
@@ -7,7 +7,6 @@ cc_library(
deps = [
":jvm_tooling_lib",
"@com_google_absl//absl/strings",
- "@com_google_glog//:glog",
"@fmeum_rules_jni//jni:libjvm",
"@jazzer_com_github_gflags_gflags//:gflags",
],
@@ -25,7 +24,6 @@ cc_library(
"@bazel_tools//tools/cpp/runfiles",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
- "@com_google_glog//:glog",
"@fmeum_rules_jni//jni",
"@jazzer_com_github_gflags_gflags//:gflags",
],
diff --git a/driver/jazzer_main.cpp b/driver/jazzer_main.cpp
index 01118813..c72e111f 100644
--- a/driver/jazzer_main.cpp
+++ b/driver/jazzer_main.cpp
@@ -29,7 +29,6 @@
#include "absl/strings/match.h"
#include "gflags/gflags.h"
-#include "glog/logging.h"
#include "jvm_tooling.h"
// Defined by glog
@@ -121,9 +120,6 @@ int StartLibFuzzer(std::unique_ptr<jazzer::JVM> jvm,
int main(int argc, char **argv) {
gflags::SetUsageMessage(kUsageMessage);
- // Disable glog log prefixes to mimic libFuzzer output.
- FLAGS_log_prefix = false;
- google::InitGoogleLogging(argv[0]);
rules_jni_init(argv[0]);
const auto argv_end = argv + argc;
diff --git a/driver/jvm_tooling.cpp b/driver/jvm_tooling.cpp
index 267639bd..71a5f581 100644
--- a/driver/jvm_tooling.cpp
+++ b/driver/jvm_tooling.cpp
@@ -26,7 +26,6 @@
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "gflags/gflags.h"
-#include "glog/logging.h"
#include "tools/cpp/runfiles/runfiles.h"
DEFINE_string(cp, ".",
@@ -158,8 +157,8 @@ std::string getInstrumentorAgentPath(const std::string &executable_path) {
// User provided agent location takes precedence.
if (!FLAGS_agent_path.empty()) {
if (std::ifstream(FLAGS_agent_path).good()) return FLAGS_agent_path;
- LOG(ERROR) << "Could not find " << kAgentFileName << " at \""
- << FLAGS_agent_path << "\"";
+ std::cerr << "ERROR: Could not find " << kAgentFileName << " at \""
+ << FLAGS_agent_path << "\"" << std::endl;
exit(1);
}
// First check if we are running inside the Bazel tree and use the agent
@@ -182,9 +181,9 @@ std::string getInstrumentorAgentPath(const std::string &executable_path) {
auto agent_path =
absl::StrFormat("%s%c%s", dir, kPathSeparator, kAgentFileName);
if (std::ifstream(agent_path).good()) return agent_path;
- LOG(ERROR) << "Could not find " << kAgentFileName
- << ". Please provide "
- "the pathname via the --agent_path flag.";
+ std::cerr << "ERROR: Could not find " << kAgentFileName
+ << ". Please provide the pathname via the --agent_path flag."
+ << std::endl;
exit(1);
}
@@ -262,7 +261,6 @@ JVM::JVM(const std::string &executable_path) {
}
class_path +=
absl::StrCat(ARG_SEPARATOR, getInstrumentorAgentPath(executable_path));
- LOG(INFO) << "got class path " << class_path;
std::vector<JavaVMOption> options;
options.push_back(
diff --git a/repositories.bzl b/repositories.bzl
index 8e757f15..7abffd87 100644
--- a/repositories.bzl
+++ b/repositories.bzl
@@ -47,15 +47,6 @@ def jazzer_dependencies():
maybe(
http_archive,
- name = "com_google_glog",
- repo_mapping = {"@com_github_gflags_gflags": "@jazzer_com_github_gflags_gflags"},
- sha256 = "8a83bf982f37bb70825df71a9709fa90ea9f4447fb3c099e1d720a439d88bad6",
- strip_prefix = "glog-0.6.0",
- url = "https://github.com/google/glog/archive/refs/tags/v0.6.0.tar.gz",
- )
-
- maybe(
- http_archive,
name = "com_google_absl",
sha256 = "4208129b49006089ba1d6710845a45e31c59b0ab6bff9e5788a87f55c5abd602",
strip_prefix = "abseil-cpp-20220623.0",