Boost C++ Libraries: Ticket #10822: Boost.Thread fails to compile on Android https://svn.boost.org/trac10/ticket/10822 <p> Unfortunately the fix for ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7716" title="#7716: Patches: Fix issue with PAGE_SIZE undeclared on Android (closed: fixed)">#7716</a> of manually including asm/page.h has broken Boost.Thread on Android for the Android 5.0 NDK: </p> <p> In file included from ./boost/thread/thread_only.hpp:17:0, </p> <blockquote> <p> from libs/thread/src/pthread/thread.cpp:11: </p> </blockquote> <p> ./boost/thread/pthread/thread_data.hpp:28:81: fatal error: asm/page.h: No such file or directory </p> <blockquote> <p> #include &lt;asm/page.h&gt; <em> <a class="ext-link" href="http://code.google.com/p/android/issues/detail?id=39983"><span class="icon">​</span>http://code.google.com/p/android/issues/detail?id=39983</a> </em></p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> compilation terminated. </p> <p> This is because asm/page.h has gone away, and Android seems to dislike defining PAGE_SIZE anywhere when getpagesize() works perfectly well. </p> <p> Vicente, if it's okay with you can I hard code PAGE_SIZE to 4096 on Android if it is not already defined by a system header? Then the problem goes away, forever. </p> <p> Niall </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10822 Trac 1.4.3 viboes Thu, 27 Nov 2014 17:26:32 GMT version changed https://svn.boost.org/trac10/ticket/10822#comment:1 https://svn.boost.org/trac10/ticket/10822#comment:1 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.58.0</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> </ul> <p> Yes, please take care of this issue. what about checking for an Android version? </p> Ticket Niall Douglas Thu, 27 Nov 2014 17:49:13 GMT <link>https://svn.boost.org/trac10/ticket/10822#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10822#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/10822#comment:1" title="Comment 1">viboes</a>: </p> <blockquote class="citation"> <p> Yes, please take care of this issue. what about checking for an Android version? </p> </blockquote> <p> It seems that some NDKs pull in a definition and some require you to pull in that asm/page.h header because it basically got left out by accident for a few NDK revisions. Android 5.0 seems to have fixed the problem, and now system headers define PAGE_SIZE like the oldest NDKs did. </p> <p> Hence me thinking a simple #ifndef PAGE_SIZE as all current Android hardware has 4k page sizes. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 29 Nov 2014 13:31:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10822#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10822#comment:3</guid> <description> <p> Couldn't the change be done conditionally depending on the version? </p> <p> Please, do as you find it is more coherent. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Niall Douglas</dc:creator> <pubDate>Sat, 13 Dec 2014 14:09:10 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/10822#comment:4 https://svn.boost.org/trac10/ticket/10822#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket eazyigz@… Mon, 06 Jun 2016 15:27:14 GMT <link>https://svn.boost.org/trac10/ticket/10822#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10822#comment:5</guid> <description> <p> I am getting this error with boost 1_57 now. Is there a solution? </p> </description> <category>Ticket</category> </item> <item> <author>eazyigz@…</author> <pubDate>Thu, 11 May 2017 18:45:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10822#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10822#comment:6</guid> <description> <p> I am getting this error with boost 1_57 and android-ndk-<a class="changeset" href="https://svn.boost.org/trac10/changeset/16" title="*** empty log message *** ">r16</a> with CMake 3.6.3155560 now. There has been an issue filed against this for android NDK, but there doesn't seem to be a fix: <a class="ext-link" href="https://github.com/android-ndk/ndk/issues/302#issuecomment-300843092"><span class="icon">​</span>https://github.com/android-ndk/ndk/issues/302#issuecomment-300843092</a> </p> <p> Do you have a suggestion for a solution? </p> </description> <category>Ticket</category> </item> </channel> </rss>