I've successfully cross-compiled Ruby for Android and everything goes ok in the emulator.

But while I'm testing these funny things on my device (Nexus4) I noticed that /sdcard (or /storage/emulated/0) is a fuse mount with no execution permissions.

How can I execute something on the SD card?

I saw that on Linux you can pass it as argument to the linker. In Android this does not work: /system/bin/linker wants a pointer to a special struct. I believe that I can write a small C program that creates that structure and run the linker to execute a readable program.

But what about shared libraries? Ruby load tens of shared libraries (every time you have a "require"), I bet that execute permissions are required for loading shared libraries.

Moving the executable to /data/data/my.app.name/files/ or any other place is not a solution, my binaries are very fat (statically linked) and users should be free to specify any location where storing them.

  • This rather seems to be a programming problem, not an Android problem. – ale Jun 7 '14 at 13:55
  • @AlE. why? it's a programming problem if /sdcard has no execution permissions? btw, i think that the solution is in the kernel, i have to find the way to get the list struct fuse from the kernel... – tux_mind Jun 11 '14 at 0:36

i found a workaround/hack to list them.

when you open a file on the mountpoint the fuse FS handler will open it too.

i used this information and i wrote a small C program that use proc to find source directories.

if you are interested the project is hosted on github.

regards, tux_mind.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.