Musl library uses the following mechanism to detect arch: case "$target" in i?86*) ARCH=i386 Musl uses same code across *86 targets, developers want just to call source code folders as "i386". "ARCH" from musl "config.mak" is not target architecture, this is just special name for internal usage. This variable was not designed to be used as architecture name. # Fish out of config: # ARCH = ... # SUBARCH = ... # and print $(ARCH)$(SUBARCH). local arch=$(awk '{ k[$1] = $3 } END { printf("%s%s", k["ARCH"], k["SUBARCH"]); }' config.mak) [[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die It means that all *86 targets will have "ld-musl-i386.so.1" wrong ld name. Reproducible: Always Steps to Reproduce: 1. Use i686-gentoo-linux-musl image and emerge gcc + clang. 2. Compile one line c file using gcc, it will be linked with "ld-musl-i386.so.1". 3. Compile one line c file using clang, it will be linked with "ld-musl-i686.so.1" and it won't work.
Workaround: add "ld-musl-i686.so.1" -> "ld-musl-i386.so.1" symlink after musl re-installation.
Created attachment 661167 [details, diff] clang musl i386 patch
Personally I don't like symlink workarounds, than I am going to use patched clang for i686-gentoo-linux-musl image.
Created attachment 661263 [details, diff] relative patch for clang i386 quick fix: relative path to clang folder