FORUMS
Remove All Ads from XDA

[Q] [DEV] GLibC for Android - compiled but where to install?

474 posts
Thanks Meter: 254
 
By theGanymedes, Senior Member on 10th October 2011, 02:26 AM
Post Reply Email Thread
Hey guys,

For a few days, I was wondering what could happen if we could compile the Standard C library (not trimmed one like Bionic) and compile some linux applications for ARM processor (say, Desire). I successfully compiled the GlibC, and now do have the .a and .so files.

The problem is, I don't know where to put them, so the dynamically linked applications can reach them! I could put them to /system/lib, but I don't want to overwrite the files already there (I don't want to crash the working parts of the system). I was thinking to put them to (say) /data and create symbolic links to /system/lib, but - as I said - what about the libraries which have the same name?
 
 
10th October 2011, 07:08 PM |#2  
lufc's Avatar
Retired Senior Moderator / Resident Priest
Flag Blackpool UK
Thanks Meter: 1,585
 
Donate to Me
More
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums and Read THIS

Moving to General
11th October 2011, 01:40 PM |#3  
OP Senior Member
Thanks Meter: 254
 
More
Thumbs up
Sorry for the wrong section post. I found the solution though..

The thing is to be done is editing the Ramdisk/init.rc; changing LD_LIBRARY_PATH variable, accordingly (say, /data/lib). Once you do that, the system loads libraries from the folders, in specified order.

However, you must be cautious because since at the boot time, Data might not be mounted yet, the libraries that are installed there could not be read. Ergo, don't delete (or move) the system libraries (like I did ) - the phone won't boot without them.

Another issue is libc. Since bash shell is compiled with bionic, it requires bionic version of libc; not glibc. I'm going to try to overcome this by recompling shell; yet still there might be other problems (there might be other native executables need Bionic Libc)

I'll update this thread as I try new things.
2nd January 2014, 03:22 AM |#4  
Edge-Case's Avatar
Member
Thanks Meter: 26
 
More
Quote:
Originally Posted by theGanymedes

Sorry for the wrong section post. I found the solution though..

The thing is to be done is editing the Ramdisk/init.rc; changing LD_LIBRARY_PATH variable, accordingly (say, /data/lib). Once you do that, the system loads libraries from the folders, in specified order.

However, you must be cautious because since at the boot time, Data might not be mounted yet, the libraries that are installed there could not be read. Ergo, don't delete (or move) the system libraries (like I did ) - the phone won't boot without them.

Another issue is libc. Since bash shell is compiled with bionic, it requires bionic version of libc; not glibc. I'm going to try to overcome this by recompling shell; yet still there might be other problems (there might be other native executables need Bionic Libc)

I'll update this thread as I try new things.

I just put glibc in /lib, at boot /lib is empty, but then I mount the contents of /lib aftwards. Ideally it would mount from a custom init.rc script. I suppose if you put the libc in /data/lib you could sym link that to /lib during boot. I am pretty sure that /lib needs to be in the root dir and its contents must be executable. I found I had to edit some header file somewhere, I'll get back to ya once I start poking my head round Android again, syncing back up atm.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes