ndk icon indicating copy to clipboard operation
ndk copied to clipboard

Statically link glibc into NDK

Open SmallLars opened this issue 7 years ago • 15 comments

Please link glibc statically into the NDK instead of relying on system one. It would help us a lot if the NDK is more platform independent and ships their used libraries itself.

SmallLars avatar Nov 14 '18 09:11 SmallLars

This wouldn't work. The zygote will have already loaded bionic.

If you're having issues with the system libc, file bugs about that.

DanAlbert avatar Nov 14 '18 17:11 DanAlbert

... or did you mean the host tools? That's probably something we could/should do.

DanAlbert avatar Nov 14 '18 18:11 DanAlbert

That is what I mean, yes.

SmallLars avatar Nov 14 '18 18:11 SmallLars

What about a build for arm host? We can use it on Linux on Dex or with Linux Deploy. AIDE provides one but it is a bit old.

twaik avatar Nov 18 '18 19:11 twaik

What about a build for arm host? We can use it on Linux on Dex or with Linux Deploy. AIDE provides one but it is a bit old.

You're welcome to build your own from source, but that's not something we'll be supporting. https://android.googlesource.com/platform/ndk/+/master/README.md

DanAlbert avatar Nov 27 '18 00:11 DanAlbert

Is there any chance to plan this change? We would prefer so setup small alpine linux docker images for CI builds. But glibc is missing there.

SmallLars avatar Apr 09 '21 06:04 SmallLars

No plans.

DanAlbert avatar Apr 09 '21 08:04 DanAlbert

Is there any chance to plan this change?

I think you can try build NDK statically. It will force compiler to keep glibc inside binaries, no matter what libc host uses.

twaik avatar Apr 09 '21 09:04 twaik

Still no plan?

SmallLars avatar Nov 14 '23 14:11 SmallLars

no. for various reasons, we'll never statically link glibc into anything.

we may statically link musl at some point, but no-one's actively working on that right now, so even if does happen, that's years away.

enh-google avatar Nov 14 '23 14:11 enh-google

What about linking host tools to musl statically? It should work fine.

twaik avatar Nov 14 '23 14:11 twaik

What about linking host tools to musl statically? It should work fine.

like i said five minutes ago:

we may statically link musl at some point, but no-one's actively working on that right now, so even if does happen, that's years away.

enh-google avatar Nov 14 '23 15:11 enh-google

I mean: why it is so problematic?

twaik avatar Nov 14 '23 16:11 twaik

i take it you've never looked at how llvm is built :-)

enh-google avatar Nov 14 '23 18:11 enh-google

Is there any chance to plan this change? We would prefer so setup small alpine linux docker images for CI builds. But glibc is missing there.

@SmallLars: Did you confirm that the tools you want to use don't compile against musl? Using prebuilts is clearly not very smart unless there are prebuilts that are built against musl, but thankfully you should be able to build from source. You could also request prebuilts compiled against musl (it's not unheard of for such to be provided)

Mis012 avatar Jan 24 '24 21:01 Mis012