`python/google/__init__.py` declares the top-level 'google' namespace so that
`google.protobuf` can be imported alongside other Google Python modules like
`google.auth`.
This works well when installing protobuf via Pip, but the Bazel `//:python_srcs`
rule doesn't include this file in its `srcs`. Bazel implicitly creates an empty
`google/__init__.py`, which does *not* set up a namespace. The result is that
consuming Python protobuf via Bazel breaks all other Google Python libraries.
This fixes#4658.
* CMake: Add comment for CMP0048
* CMake: osx use @rpath/ as target's install name (CMP0042)
On MacoS library should use @rpath/ as prefix path instead of absolute build path
e.g. otool -L libprotobuf.dylib
libprotobuf.dylib:
@rpath/libprotobuf.dylib (...)
...
* CMake: add rpath to target for LINUX and APPLE
* rewrite int128 long divison to avoid stackoverflow hit
Protobuf was showing Stackoverflow hits in the code base, primarily code written to calculate long division. This code was copied from a stackoverflow post, which means it would be licensed under CC BY-SA 3.0. Due to this license, IBM Legal did not want to include this OSS in our products and advised us to re-write this particular piece of code to avoid the license restriction. We have re-written the code for our own distribution, and are willing to merge it into the main code base for others who want to avoid the stackoverflow license issues to benefit as well.
The problem is that sched_yield is available on the target, but configure.ac is asking to build
a host binary using the AC_SEARCH_LIBS macro. It can't configure for Android, since sched_yield isn't
available on the host.
* Adopt php_metadata_namespace in php code generator
The php_metadata_namespace is corresponded to the relative directory of
the metadata file. e.g., previously, the metadata file of foo.proto was
GPBMetadata/Foo.php. If the php_metadata_namespace is "Metadata\\Bar",
the metadata file will be Metadata/Bar/Foo.php.
* Handle empty php_metadata_namespace
Signed integer overflow creates undefined behavior that may lead to unpredictable fails on different platforms.
One known example of the hardware where this code did fail is Apple A6 (32-bit Apple Swift CPU)
16777619, 16777499 - two prime numbers that typically used to get better dispersion.