Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds support for CYGWIN.
Hopefully, very few changes are needed.
absl/base/attributes.hTalking about shared libraries, CYGWIN shares the same behaviour of the traditional WIN32 binaries with DLLs.
So, exactly like MinGW, the compiler doesn't complain about the
weakattribute until it fails at the link step.Here, the solution is to avoid the
weakattribute, exactly like it has been already done for the existing MinGW support.absl/base/internal/low_level_alloc.hCYGWIN lacks support for low-level allocation of virtual memory, so here it follows again the same behaviour of WIN32.
absl/base/internal/sysinfo.ccabsl/base/internal/sysinfo.hOn CYGWIN, the function
GetTID()cannot be compiled becausepid_tand the return value ofpthread_self()are not compatible.pid_tis aninttype, so it's 32 bit on CYGWIN.pthread_self()returns apthread_twhich is an opaque object.And, on CYGWIN,
pthread_tis atypedefto a pointer.When compiling for x86_64, the size of the pointer is 64bit.
So, there is a mismatch because 32bit != 64bit.
Hopefully, it is already possible to support a different
pid_tintoabsl/base/internal/sysinfo.h, so I did the same thing that it has been done for_WIN32and I added it to be anuintptr_t, which is good for all conditions.However, into
absl/base/internal/sysinfo.cc, thestatic_castis not able to convert yet.It can work if
pthread_self()returns anint, but sincepthread_tis an opaque object and it must be assumed to be like that, here thereinterpret_castlooks a better solution.absl/base/policy_checks.hSince CYGWIN is supported after these changes, the lines for blocking the execution of the build process are not needed anymore and they have been removed from the code.
===
The library compiled fine in all conditions.
Tested build with both shared and static libraries.
Tested build with
ABSL_BUILD_MONOLITHIC_SHARED_LIBSto beONandOFF.Sadly, I have no chance to execute bazel or Docker inside CYGWIN for running the tests because they seems to be not supported.
However, the chance that everything is working fine looks very high because CYGWIN is using code that already existed.
A direct test has been done with direct use, when building gstreamer-1.0, since abseil-cpp is a dependency.
If you think that this may be enough or something more can be done, please let me know.
I hope that you will find this patch useful.
Sincerely.
Carlo Bramini.
===
Thank you for your contribution to Abseil!
Before submitting this PR, please be sure to read our contributing
guidelines.
If you are a Googler, please also note that it is required that you send us a
Piper CL instead of using the GitHub pull-request process. The code propagation
process will deliver the change to GitHub.