Conversation
|
can you update patches/libbase/0002-remove-glibc-internal-headers-cdefs.h.patch instead? |
|
libbase/test_utils.cpp file is not required in cmake. I will remove it later with an exclude rule before creating tarball. |
So you're saying that the problem can be solved by the following? diff --git a/vendor/CMakeLists.libbase.txt b/vendor/CMakeLists.libbase.txt
index 08e0706..9210352 100644
--- a/vendor/CMakeLists.libbase.txt
+++ b/vendor/CMakeLists.libbase.txt
@@ -14,7 +14,6 @@ add_library(libbase STATIC
libbase/stringprintf.cpp
libbase/strings.cpp
libbase/threads.cpp
- libbase/test_utils.cpp
libbase/errors_unix.cpp)
target_include_directories(libbase PUBLIC |
it should. |
Yes, I have tried it with both Chimera Linux and Void Linux (musl). |
|
I also compiled for Void glibc, alpine x86_64 -> ppc64le cross and Windows x86_64. I suspected that Can you push this to master? This change is not appropriate for this PR and it is simple enough that me making another PR should not be necessary. I'll also close this PR, but discussion can continue here. |
Please see the description of the patch I added for an in length explanation.
Most distros dealing with musl already have a way around this. For example Alpine has the
bsd-compat-headersand Chimera Linux hasmusl-bsd-headers, which provide a small simplesys/cdefs.hreplacement. But it is a hack. Alpine's header even#warnings its users that it should not be included.I have faced issues while trying to cross compile my fork on musl, since the target environment does not have
sys/cdefs.h. I'm fairly certain that the same issue can occur in nmeum/android-tools, but it is a pain to cross compile nmeum/android-tools, I didn't want to cross compile all of its dependencies so I have not tested this.Alternative solutions include:
do nothing, musl users will have to install
bsd-compat-headersor an equivalent package (which might sometimes be pulled in transitively, as it is pulled in Alpine CI)Cross sysroots will have to have
sys/cdefs.havailable too, which isn't mandatory and for example musl-cross-make, which is used by my fork, does not provide this header (since musl doesn't provide it).vendor a
sys/cdefs.hfileTheoretically, overriding this project-wide and vendoring an empty file should work fine. A more targetted solution would be adding this to include path only where it's needed (
libbase/test_utils.cppoflibbase) and vendoring asys/cdefs.hwhich has at least some of the stuff its users would expect (Chimera's would be a good pick).But if what I've written in the patch description is correct,
sys/cdefs.his only needed for potential__BIONIC__macro definition, so an empty header file should be sufficient.Chimera's cdefs.h suitable for vendoring
do
__BIONIC__detection in CMake instead of in the headerThis solution is described in the patch description.
This is a 37.0.0 issue, 36.0.1 and earlier did not use
sys/cdefs.h.