Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boost 1.83.0 Beta 1 fails to build for Android API level 19 #150

Closed
gjasny opened this issue Jul 13, 2023 · 6 comments
Closed

Boost 1.83.0 Beta 1 fails to build for Android API level 19 #150

gjasny opened this issue Jul 13, 2023 · 6 comments

Comments

@gjasny
Copy link

gjasny commented Jul 13, 2023

Hello,

while testing Boost 1.83.0-beta1 I noticed the following new compile error with Android armeabi-v7a and API level 19:

    "/opt/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi19-clang++"   -O3 -Wall -fvisibility=default -Wno-inline -fexceptions -fpic -frtti -std=c++20 -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_USE_LIB=1 -DNDEBUG   -I"."  -c -o "/home/ec2-user/3xjwvqlbcmbwqe3/_output/Applications_Android_armeabi-v7a_cxx20/boost/bin.v2/libs/wave/build/clang-linux-android/release/link-static/pch-off/target-os-android/threading-multi/visibility-global/instantiate_has_include_grammar.o" "libs/wave/src/instantiate_has_include_grammar.cpp"

...failed clang-linux.compile.c++ /home/ec2-user/3xjwvqlbcmbwqe3/_output/Applications_Android_armeabi-v7a_cxx20/boost/bin.v2/libs/wave/build/clang-linux-android/release/link-static/pch-off/target-os-android/threading-multi/visibility-global/instantiate_has_include_grammar.o...
clang-linux.compile.c++ /home/ec2-user/3xjwvqlbcmbwqe3/_output/Applications_Android_armeabi-v7a_cxx20/boost/bin.v2/libs/wave/build/clang-linux-android/release/link-static/pch-off/target-os-android/threading-multi/visibility-global/instantiate_cpp_exprgrammar.o
In file included from libs/wave/src/instantiate_cpp_exprgrammar.cpp:24:
In file included from ./boost/wave/grammars/cpp_expression_grammar.hpp:17:
In file included from ./boost/spirit/include/classic_core.hpp:11:
In file included from ./boost/spirit/home/classic/core.hpp:42:
In file included from ./boost/spirit/home/classic/core/non_terminal/grammar.hpp:21:
In file included from ./boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp:15:
In file included from ./boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp:14:
In file included from ./boost/shared_ptr.hpp:17:
In file included from ./boost/smart_ptr/shared_ptr.hpp:30:
In file included from ./boost/smart_ptr/detail/spinlock_pool.hpp:25:
In file included from ./boost/smart_ptr/detail/spinlock.hpp:42:
In file included from ./boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14:
In file included from ./boost/smart_ptr/detail/yield_k.hpp:22:
In file included from ./boost/core/yield_primitives.hpp:10:
./boost/core/detail/sp_thread_sleep.hpp:73:29: error: use of undeclared identifier 'PTHREAD_CANCEL_DISABLE'
    pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &oldst );
                            ^
./boost/core/detail/sp_thread_sleep.hpp:90:5: error: use of undeclared identifier 'pthread_setcancelstate'
    pthread_setcancelstate( oldst, &oldst );
    ^
2 errors generated.

I could not find any reference to pthread_setcancelstate in Android NDK r25c, so I guess the Android platform does not implement pthread_setcancelstate.

This seemed to be introduced by @pdimov in 23ef6d3.

Thanks,
Gregor

@gjasny
Copy link
Author

gjasny commented Jul 13, 2023

CC: @mclow

@pdimov
Copy link
Member

pdimov commented Jul 13, 2023

Looks like we need to add a check for Android here and here.

@pdimov
Copy link
Member

pdimov commented Jul 25, 2023

Can you please check whether c713490 fixes the issue?

@gjasny
Copy link
Author

gjasny commented Jul 25, 2023

Can you please check whether c713490 fixes the issue?

Thanks for the fix. I’m traveling right now an won’t be able to verify in time for the next boost release.

@pdimov
Copy link
Member

pdimov commented Jul 25, 2023

I can't verify it either so the best I can do is apply it and hope for the best. :-)

@pdimov pdimov closed this as completed in c713490 Jul 26, 2023
@MarcelRaad
Copy link

Hi, I verified that it fixes the build of Boost.Test and Boost.Thread for Android. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants