posts/Make sure glue isn't strippedBeuc's Bloghttps://blog.beuc.net/posts/Make_sure_glue_isn__39__t_stripped/Beuc's Blogikiwiki2020-02-04T15:26:58ZStrip subfileshttps://blog.beuc.net/posts/Make_sure_glue_isn__39__t_stripped/comment_1_8d12926da3f25a66081dec67d74f48b0/Anonymous2020-02-04T15:26:58Z2012-02-08T14:08:21Z
Oh, but the compiler/linker can strip down by function, e.g. with -ffunction-sections or LTO. It’s a great optimisation. You just have to tell it what to include in the native part and that it makes a native library… all a matter of calling the toolchain correctly.
Re: native libhttps://blog.beuc.net/posts/Make_sure_glue_isn__39__t_stripped/comment_2_fbd1ac0e02a17c659f8fccbd4c41ab60/beuc2020-02-04T15:26:58Z2012-02-09T21:55:48Z
<p>Hi,</p>
<p>It's already a native lib (obj/local/armeabi/libandroid_native_app_glue.a), but it's stripped nonetheless. Can you precise what you meant?</p>
comment 3https://blog.beuc.net/posts/Make_sure_glue_isn__39__t_stripped/comment_3_ef8db8aa9a92cde2307813ccf6d5254b/Anonymous2020-02-04T15:26:58Z2012-02-11T13:05:53Z
If it’s a .a archite, it’s not a native library (.so/.dll). Those archives are made for the precise PURPOSE of only including the files referenced by other code. So using these is doing it wrong <img src="https://blog.beuc.net/smileys/smile4.png" alt=";-)" /> You basically must compile the C part to the equivalent of a plugin.
Re: .a archivehttps://blog.beuc.net/posts/Make_sure_glue_isn__39__t_stripped/comment_4_d55825200c51ea3537a9865718bd56aa/beuc2020-02-04T15:26:58Z2012-02-12T22:26:11Z
<p>Note that it's Google/Android doing, not mine <img src="https://blog.beuc.net/smileys/smile4.png" alt=";)" /></p>
<p>The use case if indeed uncommon: bundled a set of standard entry points in your .so library.
Plus, since the final .so is loaded by JNI it's probably inconvenient to ship 2 .so (one with the standard entry points, one with your additions).</p>
<p>Not sure there's a good answer here.</p>
Important notehttps://blog.beuc.net/posts/Make_sure_glue_isn__39__t_stripped/comment_5_341adff2adfcfce9aac3246a028217eb/Anonymous2020-02-04T15:26:58Z2012-09-08T12:54:18Z
<p>Thanks for the info, it helped a lot! However, the function was stripped anyway because I had the -fvisibility=hidden attribute set in my APP_CFLAGS. I don't know exactly why I had it set but I guess it came from the Xcode project which is compiling my engine/game for iOS. Hope this will save someone time <img src="https://blog.beuc.net/smileys/smile.png" alt=":)" />
Cheers! Alex</p>