Bionic + glibc on same image

235 views
Skip to first unread message

JAlexoid (Aleksandr Panzin)

unread,
Mar 23, 2011, 10:57:28 AM3/23/11
to android-platform
Can GNU libc coexist with bionic in the same userspace?
Has anyone tried? And failed or succeeded?

Horace

unread,
Mar 25, 2011, 6:37:15 AM3/25/11
to android-platform
Hello,

I think it should fail.
You'd better use -static option during the compile time if you want to
use libc.


On 3월23일, 오후11시57분, "JAlexoid (Aleksandr Panzin)" <jalex...@gmail.com>
wrote:

Anil Sasidharan

unread,
Mar 25, 2011, 8:32:02 AM3/25/11
to android-...@googlegroups.com, JAlexoid (Aleksandr Panzin)
Hi,

The answer is yes and no.

1. Its not possible if the executables linked to BIONIC and GLIBC are expected to coexist in the same root file system unless the GLIBC ones are statically linked.

2. Its possible if there are 2 root file systems (one is BIONIC specific and the other is GLIBC specific) with "chroot" from one root-fs to the other.

Warm Regards,
Anil

On Wed, Mar 23, 2011 at 8:27 PM, JAlexoid (Aleksandr Panzin) <jale...@gmail.com> wrote:
Can GNU libc coexist with bionic in the same userspace?
Has anyone tried? And failed or succeeded?

--
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.


David Turner

unread,
Mar 25, 2011, 9:41:45 AM3/25/11
to android-...@googlegroups.com, JAlexoid (Aleksandr Panzin)
On Wed, Mar 23, 2011 at 3:57 PM, JAlexoid (Aleksandr Panzin) <jale...@gmail.com> wrote:
Can GNU libc coexist with bionic in the same userspace?
Has anyone tried? And failed or succeeded?

Nope, they will conflict on many front. For example, each malloc() implementation thinks it is handling sbrk() exclusively so expect some weird memory corruption issues.
Also, plenty of other stuff regarding threads, standard file descriptors, errno, the dynamic linker and others will simply not work correctly.

David Turner

unread,
Mar 25, 2011, 9:43:05 AM3/25/11
to android-...@googlegroups.com, JAlexoid (Aleksandr Panzin)
On Fri, Mar 25, 2011 at 2:41 PM, David Turner <di...@android.com> wrote:


On Wed, Mar 23, 2011 at 3:57 PM, JAlexoid (Aleksandr Panzin) <jale...@gmail.com> wrote:
Can GNU libc coexist with bionic in the same userspace?
Has anyone tried? And failed or succeeded?

Nope, they will conflict on many front. For example, each malloc() implementation thinks it is handling sbrk() exclusively so expect some weird memory corruption issues.
Also, plenty of other stuff regarding threads, standard file descriptors, errno, the dynamic linker and others will simply not work correctly.

Clarification: I assumed you were talking about using both C libraries inside the same program/process.

You can have GLibc-linked binaries and Bionic-linked ones on the same filesystem. However system libraries are linked against Bionic and cannot be loaded by any program that uses GLibc
(you can still generate your own GLibc-linked shared libraries though).

Erick Arroyo

unread,
Sep 19, 2015, 4:37:16 PM9/19/15
to android-platform, jale...@gmail.com
Hi,

I am having a problem i think is related with this post. I have some binaries linked by glibc and other with bionic. And the bionic ones show me a segmentation fault, when i execute them.

The processes don't use bionic and glibc at the same time, they are independent. But i have this problem with the bionic ones. I also test these bionic processes with a bionic file system an they execute correctly.

So, if someone can explain me what is the problem behind using these two linkers in the same file system, would be very helpful. 

El viernes, 25 de marzo de 2011, 6:32:02 (UTC-6), Anil escribió:
Hi,

The answer is yes and no.

1. Its not possible if the executables linked to BIONIC and GLIBC are expected to coexist in the same root file system unless the GLIBC ones are statically linked.

2. Its possible if there are 2 root file systems (one is BIONIC specific and the other is GLIBC specific) with "chroot" from one root-fs to the other.

Warm Regards,
Anil

On Wed, Mar 23, 2011 at 8:27 PM, JAlexoid (Aleksandr Panzin) <jale...@gmail.com> wrote:
Can GNU libc coexist with bionic in the same userspace?
Has anyone tried? And failed or succeeded?

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform@googlegroups.com.
To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages