Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Linux apps compiled and linked against musl #1070

Closed
wkozaczuk opened this issue Dec 27, 2019 · 1 comment
Closed

Running Linux apps compiled and linked against musl #1070

wkozaczuk opened this issue Dec 27, 2019 · 1 comment

Comments

@wkozaczuk
Copy link
Collaborator

I think there are many apps these days built to run on Alpine Linux that uses musl instead of glibc.

Given that OSv uses musl and extends it to expose as a subset of glibc, how difficult would it be to expose musl as-is at the same time and thus support musl-built Linux binaries? Is it even possible?

wkozaczuk added a commit that referenced this issue Jan 10, 2020
This patch exposes the libc implementation which is greatly
a subset of musl as such so that binaries built for musl-based
Linux distributions like alpine do not complain about its absence.

References #1070.

Signed-off-by: Waldemar Kozaczuk <[email protected]>
@wkozaczuk
Copy link
Collaborator Author

Recently I have played trying to build and test some app images on OSv using alpine linux which uses musl instead of glibc. I have successfully tried busybox, lighttpd and nodejs. Both worked fine. I have pushed the commit 287c379 that officially exposes OSv libc as musl.

Lighttpd required adding this missing symbol explicit_bzero (see the commit e5515cf) which makes me think that maybe some executables use some sort of glibc-compatibility layer. But ldd does not show it:

/ # ldd /usr/sbin/lighttpd
	/lib/ld-musl-x86_64.so.1 (0x7f658931c000)
	libpcre.so.1 => /usr/lib/libpcre.so.1 (0x7f658927c000)
	libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x7f6589000000)
	libfam.so.0 => /usr/lib/libfam.so.0 (0x7f6588ff7000)
	libev.so.4 => /usr/lib/libev.so.4 (0x7f6588fe9000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f658931c000)
/ # ldd /bin/busybox 
	/lib/ld-musl-x86_64.so.1 (0x7f8cc7076000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f8cc7076000)
/ # ldd /usr/bin/node 
	/lib/ld-musl-x86_64.so.1 (0x7f7735235000)
	libz.so.1 => /lib/libz.so.1 (0x7f773363a000)
	libuv.so.1 => /usr/lib/libuv.so.1 (0x7f7733610000)
	libcares.so.2 => /usr/lib/libcares.so.2 (0x7f77335fe000)
	libnghttp2.so.14 => /usr/lib/libnghttp2.so.14 (0x7f77335d9000)
	libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x7f773335d000)
	libssl.so.1.1 => /lib/libssl.so.1.1 (0x7f77332dd000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f7733144000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f7733130000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f7735235000)

In either case, I think we might close this issue.

@nyh nyh closed this as completed Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants