From 8e1df82a5583d2c43c37c0d8a7fb4fcef2582763 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Mon, 23 Dec 2024 10:28:21 +0900 Subject: [PATCH] Fix conflicts casued by protobuf version up to 25.0 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 --- Makefile | 2 +- config.cc | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 6ce906c..b38a618 100644 --- 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 diff --git a/config.cc b/config.cc index 413f6fc..3ecc993 100644 --- 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); -- 2.34.1