Fix conflicts casued by protobuf version up to 25.0 95/316995/2
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 23 Dec 2024 01:28:21 +0000 (10:28 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 23 Dec 2024 01:44:23 +0000 (10:44 +0900)
Firstly, the protobuf has changed not to accept base c++ standard
below 14. Therefore, fixed it to C++14.
  /usr/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions
   less than C++14 are not supported."
     79 | #error "C++ versions less than C++14 are not supported."

And the protobuf has removed SetLogHandler() as of the below commit at
version 22.0.
  Breaking change: Migrate to Abseil's logging library.
  (https://github.com/protocolbuffers/protobuf/commit/a9f1ea6)

Unfortunately, they have not offered any replacement function nor
guideline for alternative implementation of SetLogHandler() after
removing it. And the latest upstream nsjail has not fixed it too.
Therefore, removed the SetLogHandler() for now.

Change-Id: I2dbc35d499d71f63772d52e439738f14f460b6d5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Makefile
config.cc

index 6ce906c86a2acd20c86c2851c57c166db58d144d..b38a618f34e82c3f5b2e850d0bcfb8d77561e0f1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ COMMON_FLAGS += -O2 -c \
        -Wl,-z,relro
 
 CXXFLAGS += $(USER_DEFINES) $(COMMON_FLAGS) $(shell pkg-config --cflags protobuf) \
-       -std=c++11 -fno-exceptions -Wno-unused -Wno-unused-parameter
+       -std=c++14 -fno-exceptions -Wno-unused -Wno-unused-parameter
 LDFLAGS += -pie -Wl,-z,noexecstack -lpthread $(shell pkg-config --libs protobuf) \
           -Wl,-z,relro
 
index 413f6fc33e794efa1aebe5b6b49a5a0debb99daa..3ecc9938d630d1a1abe5f9327b349620911431bc 100644 (file)
--- a/config.cc
+++ b/config.cc
@@ -286,11 +286,6 @@ static bool configParseInternal(nsjconf_t* nsjconf, const nsjail::NsJailConfig&
        return true;
 }
 
-static void LogHandler(
-    google::protobuf::LogLevel level, const char* filename, int line, const std::string& message) {
-       LOG_W("config.cc: '%s'", message.c_str());
-}
-
 bool parseFile(nsjconf_t* nsjconf, const char* file) {
        LOG_D("Parsing configuration from '%s'", file);
 
@@ -300,7 +295,6 @@ bool parseFile(nsjconf_t* nsjconf, const char* file) {
                return false;
        }
 
-       SetLogHandler(LogHandler);
        google::protobuf::io::FileInputStream input(fd);
        input.SetCloseOnDelete(true);