diff --git a/compiler/build.gradle b/compiler/build.gradle index 3c8e93584..b5efd6869 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -111,13 +111,12 @@ model { linker.args "-static", "-lprotoc", "-lprotobuf", "-static-libgcc", "-static-libstdc++", "-s" } else if (osdetector.arch == "ppcle_64") { - linker.args "-Wl,-Bstatic", "-lprotoc", "-lprotobuf", "-Wl,-Bdynamic", "-lpthread", "-s" + linker.args "-lprotoc", "-lprotobuf" } else { // Link protoc, protobuf, libgcc and libstdc++ statically. // Link other (system) libraries dynamically. // Clang under OSX doesn't support these options. - linker.args "-Wl,-Bstatic", "-lprotoc", "-lprotobuf", "-static-libgcc", - "-Wl,-Bdynamic", "-lpthread", "-s" + linker.args "-lprotoc", "-lprotobuf" } addEnvArgs("LDFLAGS", linker.args) } else if (toolChain in VisualCpp) { diff --git a/compiler/src/java_plugin/cpp/java_plugin.cpp b/compiler/src/java_plugin/cpp/java_plugin.cpp index c3aec58ed..7fedc6359 100644 --- a/compiler/src/java_plugin/cpp/java_plugin.cpp +++ b/compiler/src/java_plugin/cpp/java_plugin.cpp @@ -58,9 +58,15 @@ class JavaGrpcGenerator : public protobuf::compiler::CodeGenerator { return protobuf::Edition::EDITION_2023; } #else + #if GOOGLE_PROTOBUF_VERSION >= 3012000 uint64_t GetSupportedFeatures() const override { return Feature::FEATURE_PROTO3_OPTIONAL; } + #else + uint64_t GetSupportedFeatures() const { + return 0; + } + #endif #endif virtual bool Generate(const protobuf::FileDescriptor* file,