richfelker / musl-cross-make

Simple makefile-based build for musl cross compiler
MIT License
1.31k stars 266 forks source link

Wrong symlink for ld-musl-x86_64.so.1 #82

Open ddcc opened 4 years ago

ddcc commented 4 years ago

Not sure if this is an issue with musl or the build script, but after building with musl v1.1.24 and doing make install, I notice that the symbolic link for ld-musl-x86_64.so.1 is incorrect. I would assume it should be a relative symlink to libc.so.

lrwxrwxrwx 1 root root 12 Feb  4 11:26 /opt/cross/x86_64-linux-musl/lib/ld-musl-x86_64.so.1 -> /lib/libc.so
richfelker commented 4 years ago

I think this is a duplicate but I don't see the particular issue it's a duplicate of so maybe it's just related. The symlink there is a symlink to be installed/present on the target system (although arguably it's not even needed since mcm is building you a cross compiler, not a rootfs for the target system), not used on the host you're running the cross compiler on. However a number of users have inquired about this with intention of using qemu-user/binfmt_misc along with mcm for building software whose configure scripts aren't friendly to cross compiling, so it may be desirable to make the link relative or reverse its direction. Doing this however requires some makefile expressions to reverse a path with ..'s and of course also requires some consideration to make sure nothing is broken by the change.

ddcc commented 4 years ago

Ah, I see. I'm just looking to use gilbc and musl side-by-side on x86_64, so I can manually fix the symlink.

Somewhat off-topic, but do you know about plans/status of support for musl with libc++? I saw the page on the musl website, and some commits in libc++, but both seemed pretty old and I ran into a lot of issues trying to build libc++ with musl clang/system clang++ (libstdc++, so still linking against glibc). In the end, I gave up and went with the gcc toolchain.

rofl0r commented 4 years ago

do you know about plans/status of support for musl with libc++?

https://github.com/richfelker/musl-cross-make/issues/42#issuecomment-576076877

richfelker commented 4 years ago

Strictly speaking libc++ could be used with GCC too, but I don't know what's involved to get it to work. Building & using particular software with musl is outside the scope of musl-cross-make though; if you're having trouble with it the right place to ask would be on the mailing list or #musl irc.