link a binary to libdvm.so

166 views
Skip to first unread message

ANUDEEP REDDY GADDAM

unread,
Apr 27, 2012, 6:48:41 AM4/27/12
to android-platform
How do i link a binary to libdvm.so in android? because i need to run
a sample program using my newly generated libdvm.so(which was
achieved by making some changes to /dalvik/vm/interp/Jit.cpp)
something like $binary prog
how can i achieve this?

Thanks

Marcelo Silva Cintra

unread,
Apr 27, 2012, 5:34:22 PM4/27/12
to android-...@googlegroups.com
Hi Anudeep,

You don't need to build the whole android. You have two options to test your changes:

First, after modifing the vm (jit.cpp), you should do:
gmake libdvm  (I am workign on gingerbread)
This will produce a new libdvm.so file. In my configuration, the output file is in out/target/product/generic/system/lib/libdvm.so. If your configuration is different, use find to locate it.
Now you need to push it to your device:
adb root
adb remount
adb push out/target/product/generic/system/lib/libdvm.so /system/lib/libdvm.so
After this, just run your application.

The second choice is what I usally do:
Push the libdvm.so to a different directory (make sure you create it first), for example:
adb push out/target/product/generic/system/lib/libdvm.so /data/work/test/libdvm/ibdvm.so

Open a shell (either in the device or using adb shell)
Execute the following commands:
export LD_LIBRARY_PATH=/data/work/test/libdvm:$LD_LIBRARY_PATH
dalvikvm  <your options> <your application>

This will call the dalvikvm using the libdvm.so in /data/work/test/libdvm, which is safer.
I believe you should be able to start any application from the shel, although I have never tried.

I hope this helps.

Marcelo Cintra
PS: this is the second time I am sending this. I did not go through the first time..



--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.


Reply all
Reply to author
Forward
0 new messages