From 462964ed322503af52638d54c00a0a67d7133349 Mon Sep 17 00:00:00 2001 From: Lourens Veen Date: Mon, 27 Feb 2023 20:22:39 -0800 Subject: [PATCH] Fix shared object ABI exports (#5144) (#11032) On some linkers, the ABI definitions in src/libprotoc.map and friends do not match all symbols that need to be exported. This causes a linker error when trying to use the resulting shared object library: `undefined reference to 'scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto'` Quite a few people seem to be affected by this, see #5144 for discussion. It seems that yocto now applies this patch itself, but that doesn't help people building in other places (I encountered this on some HPC machines), so it would probably be good to apply it upstream as well. Closes #11032 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/11032 from LourensVeen:issue-5144-linker-maps 3039f932aaf212bcf2f14a3f2fd00dbfb881e46b PiperOrigin-RevId: 512810858 --- src/libprotobuf-lite.map | 2 ++ src/libprotobuf.map | 2 ++ src/libprotoc.map | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/libprotobuf-lite.map b/src/libprotobuf-lite.map index 3915546694..a1853ca6cb 100644 --- a/src/libprotobuf-lite.map +++ b/src/libprotobuf-lite.map @@ -3,6 +3,8 @@ extern "C++" { *google*; }; + scc_info_*; + descriptor_table_*; local: *; diff --git a/src/libprotobuf.map b/src/libprotobuf.map index 3915546694..a1853ca6cb 100644 --- a/src/libprotobuf.map +++ b/src/libprotobuf.map @@ -3,6 +3,8 @@ extern "C++" { *google*; }; + scc_info_*; + descriptor_table_*; local: *; diff --git a/src/libprotoc.map b/src/libprotoc.map index 3915546694..a1853ca6cb 100644 --- a/src/libprotoc.map +++ b/src/libprotoc.map @@ -3,6 +3,8 @@ extern "C++" { *google*; }; + scc_info_*; + descriptor_table_*; local: *;