{"id":1509,"date":"2012-03-13T23:54:21","date_gmt":"2012-03-13T14:54:21","guid":{"rendered":"http:\/\/www.codedojo.com\/?p=1509"},"modified":"2012-03-13T23:56:37","modified_gmt":"2012-03-13T14:56:37","slug":"androids-ndk-r7b-is-broken-on-tegra2-a-work-around","status":"publish","type":"post","link":"https:\/\/www.codedojo.com\/?p=1509","title":{"rendered":"Android&#8217;s NDK r7b is broken on tegra2?! &#8211; a work around"},"content":{"rendered":"<div id=\"attachment_754\" style=\"width: 138px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.codedojo.com\/wp-content\/uploads\/2010\/10\/android_128.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-754\" class=\"size-full wp-image-754\" title=\"android_128\" src=\"https:\/\/www.codedojo.com\/wp-content\/uploads\/2010\/10\/android_128.png\" alt=\"\" width=\"128\" height=\"150\" \/><\/a><p id=\"caption-attachment-754\" class=\"wp-caption-text\">The NDK law: Every new version will break your app in a magical new way<\/p><\/div>\n<p>Yesterday I finally updated to the NDK r7b for my Android builds &#8211; it worked great, until I tried a build on my Xoom.<\/p>\n<p>It crashed on some silly math function with an ILL_ILLOPC error. (<a href=\"http:\/\/grokbase.com\/t\/gg\/android-ndk\/122ht7havt\/ndk-r7b-macosx-illopc-in-cosf\">More info here<\/a>)<\/p>\n<p>The culprit is the armeabi-v7a\u00a0 <strong>gnustl_static static lib<\/strong> &#8211; which was compiled with incorrect options making it incompatible with the tegra2.<\/p>\n<p>Five <strong>different ways<\/strong> to work around the problem:<\/p>\n<ol>\n<li>Change <strong>-mfpu=vfpv3<\/strong> to <strong>-mfpu=vfp<\/strong> in <strong>android-ndk-r7b\\build\\tools\\build-gnu-libstdc++.sh<\/strong> and<strong> (edit: builder-funcs.sh<\/strong>\u00a0 too?) and recompile it<\/li>\n<li>(OR) Don&#8217;t use the gnustl libs&#8230; but you sort of have to if you want exceptions and rtti.\u00a0 Plus, the STLport and GAlibs have the same problem.<\/li>\n<li>(OR) Remove <strong>armeabi-v7a<\/strong> from your Application.mk.\u00a0 Bad, will slow your app down on good devices.<\/li>\n<li>(OR) Copy the files from <strong>android-ndk-r7b\\sources\\cxx-stl\\gnu-libstdc++\\libs\\armeabi<\/strong> to <strong>android-ndk-r7b\\sources\\cxx-stl\\gnu-libstdc++\\libs\\armeabi-v7a<\/strong> &#8211; the lib won&#8217;t be as fast as it could be, but at least your app can build an armabi-v7a version<\/li>\n<li>(OR) Go back to ndk r7&#8230; but it has its own issues, I don&#8217;t recommend it<\/li>\n<\/ol>\n<p>I was too lazy to do #1 so I did #4.\u00a0 Don&#8217;t forget to clean\/rebuild your project so it puts the new files in there.<\/p>\n<p>EDIT: Just noticed a google tech has commented on the subject <a href=\"https:\/\/code.google.com\/p\/android\/issues\/detail?id=26199#c2\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I finally updated to the NDK r7b for my Android builds &#8211; it worked great, until I tried a build on my Xoom. It crashed on some silly math function with an ILL_ILLOPC error. (More info here) The culprit is the armeabi-v7a\u00a0 gnustl_static static lib &#8211; which was compiled with incorrect options making it [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-1509","post","type-post","status-publish","format-standard","hentry","category-development","category-tech-tips"],"_links":{"self":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/1509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1509"}],"version-history":[{"count":14,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/1509\/revisions"}],"predecessor-version":[{"id":1523,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/1509\/revisions\/1523"}],"wp:attachment":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}