Okay, I'm having no success packaging libgssapi.so into the lib/$ABI folder
and my forehead is sore from beating it against the wall (metaphorically,
at least), so I'm going to ask for guidance on that process as well.

I've followed the same pattern for libgssapi.so that's used for libmozglue
in packager.mk and package-manifest.in. Here's the diff against changeset
e14094829697: http://pastebin.com/nSuhQGym

However, I'm getting this message when I run `./mach package`:

 0:23.10 creating res/xml/preferences_devtools.xml
 0:23.56 make[4]: Leaving directory
`/home/caleb/Projects/Mozilla/objdir-droid/mobile/android/base'
 0:23.58 mv: cannot stat ‘libgssapi.so’: No such file or directory
 0:23.58 make[3]: *** [make-package-internal] Error 1
 0:23.58 make[3]: Leaving directory
`/home/caleb/Projects/Mozilla/objdir-droid/mobile/android/installer'
 0:23.58 make[2]: *** [make-package] Error 2
 0:23.58 make[2]: Leaving directory
`/home/caleb/Projects/Mozilla/objdir-droid/mobile/android/installer'
 0:23.58 make[1]: *** [default] Error 2
 0:23.58 make[1]: Leaving directory
`/home/caleb/Projects/Mozilla/objdir-droid/mobile/android/installer'
 0:23.58 make: *** [package] Error 2
 0:23.58 make: Leaving directory `/home/caleb/Projects/Mozilla/objdir-droid'

Some find output after running `./mach package`:

~/Projects/Mozilla$ find ./ -name libmozglue.so
./objdir-droid/dist/fennec/lib/armeabi-v7a/libmozglue.so
./objdir-droid/dist/lib/libmozglue.so
./objdir-droid/dist/bin/libmozglue.so
./objdir-droid/mozglue/build/libmozglue.so

~/Projects/Mozilla$ find ./ -name libgssapi.so
./objdir-droid/dist/lib/libgssapi.so
./objdir-droid/dist/bin/libgssapi.so
./objdir-droid/libgssapi.so

I've tried removing the objdir-droid directory and rebuilding, but that
doesn't seem to help.

Any advice would be greatly appreciated.
-Caleb


On Mon, Aug 26, 2013 at 12:57 PM, Caleb <[email protected]>wrote:

> On Mon, Aug 26, 2013 at 9:19 AM, Nick Alexander <[email protected]>wrote:
>
>> On 13-08-25 10:58 PM, Caleb wrote:
>>
>>> Hi Nick,
>>>
>>> Thanks for the quick response! I edited the files as recommended--I also
>>> had to put the .so file in objdir-droid/dist/bin and re-run `./mach
>>> package`, but once that was done, I had a shiny .apk with the additional
>>> library in the assets folder. Thanks!
>>>
>>
>> Huzzah!
>>
>>
>>  Still getting library load failures, though, so the journey continues.
>>> My current guess is that the auth extensions are looking at the contents
>>> of the `lib/armeabi-v7a/` folder instead of `assets` folder of the
>>> Android package file. Do you happen to be able to confirm/deny that
>>> guess?
>>>
>>
>> There are a few reasons this could happen, but I'll need to know how
>> you're loading the library in order to help diagnose.  If you can post your
>> patches and a link to your APK, that would help.
>>
>> You are correct that loading a native library via System.loadLibrary()
>> will expect the library in the `lib/$ABI`.
>
>
> So far I've managed to avoid modifying the code base at all, except for
> the previously mentioned packaging edits. Here's the library loading code:
>
>
> http://mxr.mozilla.org/mozilla-central/source/extensions/auth/nsAuthGSSAPI.cpp#130
>
> This code calls PR_LoadLibrary, which eventually ends up here:
>
>
> http://mxr.mozilla.org/mozilla-central/source/nsprpub/pr/src/linking/prlink.c#642
>
> So it seems the system call in question is dlopen(). Hopefully the same
> expectations about file locations apply--I haven't been able to find much
> information about how dlopen handles relative paths in Android. I'll know
> more once I've tried packaging the .so file in `lib/$ABI` instead of
> `assets`
>
>
>> But if you're loading via Gecko, everything should be relative to
>> libxul.so.  You could add some test code around
>>
>> http://mxr.mozilla.org/**mozilla-central/source/**
>> mozglue/android/APKOpen.cpp#**167<http://mxr.mozilla.org/mozilla-central/source/mozglue/android/APKOpen.cpp#167>
>>
>> to manually load your library.  If it still doesn't load, we might have a
>> zip formatting issue; the loader expects libraries to be szipped and
>> zip-stored (not zip-compressed).  But I think the packager should arrange
>> this all for you.
>>
>> You could also test loading via ctypes and JNI; see, for example
>>
>> http://mxr.mozilla.org/**mozilla-central/source/mobile/**
>> android/modules/JNI.jsm<http://mxr.mozilla.org/mozilla-central/source/mobile/android/modules/JNI.jsm>
>>
>> and
>>
>> http://mxr.mozilla.org/**mozilla-central/source/mobile/**
>> android/base/tests/testJNI.js<http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/tests/testJNI.js>
>> .
>>
>> I will be only intermittently checking email for the next week, so delays
>> might be replied.
>>
>> Best of luck,
>> Nick
>>
>
>
> Thanks for the info!
> -Caleb
>
>
_______________________________________________
mobile-firefox-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/mobile-firefox-dev

Reply via email to