From 9280054eab31eae2d63c9768d52a94a4e9c47cd2 Mon Sep 17 00:00:00 2001 From: Thad House Date: Thu, 23 Nov 2023 21:47:18 -0800 Subject: [PATCH] Revert "[build] Export wpimath protobuf symbols (#5952)" This reverts commit c80b2d20176215e1066279755869644bc22f32c8. --- shared/java/javacommon.gradle | 4 +-- .../0001-Fix-sign-compare-warnings.patch | 2 +- .../0002-Remove-redundant-move.patch | 2 +- ...003-Fix-maybe-uninitialized-warnings.patch | 2 +- .../0004-Fix-coded_stream-WriteRaw.patch | 2 +- ...uppress-enum-enum-conversion-warning.patch | 2 +- ...0006-Fix-noreturn-function-returning.patch | 2 +- ...GCC-12-restrict-warning-compiler-bug.patch | 2 +- .../0008-Disable-MSVC-switch-warning.patch | 2 +- ...0009-Disable-unused-function-warning.patch | 2 +- .../0010-Disable-pedantic-warning.patch | 2 +- .../0011-Avoid-use-of-sprintf.patch | 2 +- ...gop-overflow-warning-false-positives.patch | 2 +- .../0013-Include-WPI-SymbolExports.patch | 30 ------------------- upstream_utils/update_protobuf.py | 1 - .../include/google/protobuf/port_def.inc | 7 ----- 16 files changed, 13 insertions(+), 53 deletions(-) delete mode 100644 upstream_utils/protobuf_patches/0013-Include-WPI-SymbolExports.patch diff --git a/shared/java/javacommon.gradle b/shared/java/javacommon.gradle index 975bfc67e6..f5813328cd 100644 --- a/shared/java/javacommon.gradle +++ b/shared/java/javacommon.gradle @@ -154,9 +154,7 @@ protobuf { generateProtoTasks { all().configureEach { task -> task.builtins { - cpp { - option "dllexport_decl=WPILIB_DLLEXPORT" - } + cpp {} remove java } task.plugins { diff --git a/upstream_utils/protobuf_patches/0001-Fix-sign-compare-warnings.patch b/upstream_utils/protobuf_patches/0001-Fix-sign-compare-warnings.patch index 123b23c4e1..d3ac55c09d 100644 --- a/upstream_utils/protobuf_patches/0001-Fix-sign-compare-warnings.patch +++ b/upstream_utils/protobuf_patches/0001-Fix-sign-compare-warnings.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 10 Jun 2023 14:13:07 -0700 -Subject: [PATCH 01/13] Fix sign-compare warnings +Subject: [PATCH 01/12] Fix sign-compare warnings --- src/google/protobuf/compiler/importer.cc | 2 +- diff --git a/upstream_utils/protobuf_patches/0002-Remove-redundant-move.patch b/upstream_utils/protobuf_patches/0002-Remove-redundant-move.patch index 7028820858..6916c98bd2 100644 --- a/upstream_utils/protobuf_patches/0002-Remove-redundant-move.patch +++ b/upstream_utils/protobuf_patches/0002-Remove-redundant-move.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 10 Jun 2023 14:41:39 -0700 -Subject: [PATCH 02/13] Remove redundant move +Subject: [PATCH 02/12] Remove redundant move --- src/google/protobuf/extension_set.h | 2 +- diff --git a/upstream_utils/protobuf_patches/0003-Fix-maybe-uninitialized-warnings.patch b/upstream_utils/protobuf_patches/0003-Fix-maybe-uninitialized-warnings.patch index 1f54467220..6888dd25ee 100644 --- a/upstream_utils/protobuf_patches/0003-Fix-maybe-uninitialized-warnings.patch +++ b/upstream_utils/protobuf_patches/0003-Fix-maybe-uninitialized-warnings.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 10 Jun 2023 15:00:20 -0700 -Subject: [PATCH 03/13] Fix maybe-uninitialized warnings +Subject: [PATCH 03/12] Fix maybe-uninitialized warnings --- src/google/protobuf/arena.cc | 6 +++--- diff --git a/upstream_utils/protobuf_patches/0004-Fix-coded_stream-WriteRaw.patch b/upstream_utils/protobuf_patches/0004-Fix-coded_stream-WriteRaw.patch index e164913755..dc17497b7b 100644 --- a/upstream_utils/protobuf_patches/0004-Fix-coded_stream-WriteRaw.patch +++ b/upstream_utils/protobuf_patches/0004-Fix-coded_stream-WriteRaw.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 10 Jun 2023 15:03:38 -0700 -Subject: [PATCH 04/13] Fix coded_stream WriteRaw +Subject: [PATCH 04/12] Fix coded_stream WriteRaw --- src/google/protobuf/implicit_weak_message.h | 2 +- diff --git a/upstream_utils/protobuf_patches/0005-Suppress-enum-enum-conversion-warning.patch b/upstream_utils/protobuf_patches/0005-Suppress-enum-enum-conversion-warning.patch index 84712afc3b..2919644e3e 100644 --- a/upstream_utils/protobuf_patches/0005-Suppress-enum-enum-conversion-warning.patch +++ b/upstream_utils/protobuf_patches/0005-Suppress-enum-enum-conversion-warning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 10 Jun 2023 15:13:45 -0700 -Subject: [PATCH 05/13] Suppress enum-enum conversion warning +Subject: [PATCH 05/12] Suppress enum-enum conversion warning --- src/google/protobuf/generated_message_tctable_impl.h | 9 +++++++++ diff --git a/upstream_utils/protobuf_patches/0006-Fix-noreturn-function-returning.patch b/upstream_utils/protobuf_patches/0006-Fix-noreturn-function-returning.patch index 70841fe653..abaa0a20b9 100644 --- a/upstream_utils/protobuf_patches/0006-Fix-noreturn-function-returning.patch +++ b/upstream_utils/protobuf_patches/0006-Fix-noreturn-function-returning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 10 Jun 2023 15:16:46 -0700 -Subject: [PATCH 06/13] Fix noreturn function returning +Subject: [PATCH 06/12] Fix noreturn function returning --- src/google/protobuf/generated_message_tctable_impl.h | 3 +++ diff --git a/upstream_utils/protobuf_patches/0007-Work-around-GCC-12-restrict-warning-compiler-bug.patch b/upstream_utils/protobuf_patches/0007-Work-around-GCC-12-restrict-warning-compiler-bug.patch index 0f1a050190..543896c2bc 100644 --- a/upstream_utils/protobuf_patches/0007-Work-around-GCC-12-restrict-warning-compiler-bug.patch +++ b/upstream_utils/protobuf_patches/0007-Work-around-GCC-12-restrict-warning-compiler-bug.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 10 Jun 2023 15:59:45 -0700 -Subject: [PATCH 07/13] Work around GCC 12 restrict warning compiler bug +Subject: [PATCH 07/12] Work around GCC 12 restrict warning compiler bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 --- diff --git a/upstream_utils/protobuf_patches/0008-Disable-MSVC-switch-warning.patch b/upstream_utils/protobuf_patches/0008-Disable-MSVC-switch-warning.patch index 716a28f8c7..92654f0ff6 100644 --- a/upstream_utils/protobuf_patches/0008-Disable-MSVC-switch-warning.patch +++ b/upstream_utils/protobuf_patches/0008-Disable-MSVC-switch-warning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 13 Jun 2023 23:56:15 -0700 -Subject: [PATCH 08/13] Disable MSVC switch warning +Subject: [PATCH 08/12] Disable MSVC switch warning --- src/google/protobuf/generated_message_reflection.cc | 4 ++++ diff --git a/upstream_utils/protobuf_patches/0009-Disable-unused-function-warning.patch b/upstream_utils/protobuf_patches/0009-Disable-unused-function-warning.patch index 7c427f11f8..9a8864951c 100644 --- a/upstream_utils/protobuf_patches/0009-Disable-unused-function-warning.patch +++ b/upstream_utils/protobuf_patches/0009-Disable-unused-function-warning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 13 Jun 2023 23:58:50 -0700 -Subject: [PATCH 09/13] Disable unused function warning +Subject: [PATCH 09/12] Disable unused function warning --- src/google/protobuf/generated_message_tctable_lite.cc | 4 ++++ diff --git a/upstream_utils/protobuf_patches/0010-Disable-pedantic-warning.patch b/upstream_utils/protobuf_patches/0010-Disable-pedantic-warning.patch index 5ae5a9c5b6..dd1860e79d 100644 --- a/upstream_utils/protobuf_patches/0010-Disable-pedantic-warning.patch +++ b/upstream_utils/protobuf_patches/0010-Disable-pedantic-warning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 14 Jun 2023 00:02:26 -0700 -Subject: [PATCH 10/13] Disable pedantic warning +Subject: [PATCH 10/12] Disable pedantic warning --- src/google/protobuf/descriptor.h | 8 ++++++++ diff --git a/upstream_utils/protobuf_patches/0011-Avoid-use-of-sprintf.patch b/upstream_utils/protobuf_patches/0011-Avoid-use-of-sprintf.patch index 2d5692ccf7..a0dfad8655 100644 --- a/upstream_utils/protobuf_patches/0011-Avoid-use-of-sprintf.patch +++ b/upstream_utils/protobuf_patches/0011-Avoid-use-of-sprintf.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 9 Oct 2023 19:28:08 -0700 -Subject: [PATCH 11/13] Avoid use of sprintf +Subject: [PATCH 11/12] Avoid use of sprintf --- src/google/protobuf/stubs/strutil.cc | 14 +++++++++++--- diff --git a/upstream_utils/protobuf_patches/0012-Suppress-stringop-overflow-warning-false-positives.patch b/upstream_utils/protobuf_patches/0012-Suppress-stringop-overflow-warning-false-positives.patch index 809bb24a75..929c117fce 100644 --- a/upstream_utils/protobuf_patches/0012-Suppress-stringop-overflow-warning-false-positives.patch +++ b/upstream_utils/protobuf_patches/0012-Suppress-stringop-overflow-warning-false-positives.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Fri, 10 Nov 2023 14:17:53 -0800 -Subject: [PATCH 12/13] Suppress stringop-overflow warning false positives +Subject: [PATCH 12/12] Suppress stringop-overflow warning false positives --- src/google/protobuf/io/coded_stream.h | 7 +++++++ diff --git a/upstream_utils/protobuf_patches/0013-Include-WPI-SymbolExports.patch b/upstream_utils/protobuf_patches/0013-Include-WPI-SymbolExports.patch deleted file mode 100644 index d8c2c0f822..0000000000 --- a/upstream_utils/protobuf_patches/0013-Include-WPI-SymbolExports.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Johnson -Date: Thu, 23 Nov 2023 10:32:59 -0800 -Subject: [PATCH 13/13] Include WPI SymbolExports - -Also suppress 4275 warning on MSVC. - -This is needed to enable WPILIB_DLLEXPORT from wpimath. ---- - src/google/protobuf/port_def.inc | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc -index 6c6aa1834b0cbf38b16660e6231f24da72157306..dd1798ce8b3806efb26187f4cb91b209498af2f8 100644 ---- a/src/google/protobuf/port_def.inc -+++ b/src/google/protobuf/port_def.inc -@@ -48,6 +48,13 @@ - // detect/prohibit anytime it is #included twice without a corresponding - // #undef. - -+#if __has_include("wpi/SymbolExports.h") -+#include "wpi/SymbolExports.h" -+#ifdef _MSC_VER -+#pragma warning(disable : 4275) -+#endif -+#endif -+ - // The definitions in this file are intended to be portable across Clang, - // GCC, and MSVC. Function-like macros are usable without an #ifdef guard. - // Syntax macros (for example, attributes) are always defined, although diff --git a/upstream_utils/update_protobuf.py b/upstream_utils/update_protobuf.py index 2579cdcbe5..1f004cd0c4 100755 --- a/upstream_utils/update_protobuf.py +++ b/upstream_utils/update_protobuf.py @@ -277,7 +277,6 @@ def main(): "0010-Disable-pedantic-warning.patch", "0011-Avoid-use-of-sprintf.patch", "0012-Suppress-stringop-overflow-warning-false-positives.patch", - "0013-Include-WPI-SymbolExports.patch", ]: git_am(os.path.join(wpilib_root, "upstream_utils/protobuf_patches", f)) diff --git a/wpiutil/src/main/native/thirdparty/protobuf/include/google/protobuf/port_def.inc b/wpiutil/src/main/native/thirdparty/protobuf/include/google/protobuf/port_def.inc index dd1798ce8b..6c6aa1834b 100644 --- a/wpiutil/src/main/native/thirdparty/protobuf/include/google/protobuf/port_def.inc +++ b/wpiutil/src/main/native/thirdparty/protobuf/include/google/protobuf/port_def.inc @@ -48,13 +48,6 @@ // detect/prohibit anytime it is #included twice without a corresponding // #undef. -#if __has_include("wpi/SymbolExports.h") -#include "wpi/SymbolExports.h" -#ifdef _MSC_VER -#pragma warning(disable : 4275) -#endif -#endif - // The definitions in this file are intended to be portable across Clang, // GCC, and MSVC. Function-like macros are usable without an #ifdef guard. // Syntax macros (for example, attributes) are always defined, although