SIGN IN SIGN UP

Protocol Buffers - Google's data interchange format

0 0 35 C++

Rolling forward after fixing the weak symbol linking for optimized iOS builds.

The previous CL's approach of using `__attribute__((weakref()))` was not actually behaving as expected, and the unit tests were not sufficient to catch this.

We now use inline assembly to achieve the functionality that we thought we were getting with `__attribute__((weakref()))`.  From assembly, we can create a weak symbol whose value is the same as another "stub" symbol in the same file.

Unfortunately we cannot have all of our weak symbols reference a single placeholder "empty" message, due to a bug I discovered in the LLVM linker and reported in https://github.com/llvm/llvm-project/issues/167262

If and when that bug is fixed, we should be able to get optimal tree shaking behavior, even on iOS.

PiperOrigin-RevId: 831396179
J
Joshua Haberman committed
af91d2a2fc54a3a2fd3fda5ab734635ed069ba19
Parent: eeb8777
Committed by Copybara-Service <copybara-worker@google.com> on 11/12/2025, 4:21:20 PM