diff -Nurp a/dmd/src/dmd/link.d b/dmd/src/dmd/link.d --- a/dmd/src/dmd/link.d +++ b/dmd/src/dmd/link.d @@ -746,6 +746,8 @@ argv.push("-lrt"); // Link against libdl for phobos usage of dlopen argv.push("-ldl"); + // Musl + argv.push("-lexecinfo"); } if (global.params.verbose) { diff -Nurp a/dmd/src/dmd/mars.d b/dmd/src/dmd/mars.d --- a/dmd/src/dmd/mars.d +++ b/dmd/src/dmd/mars.d @@ -1194,7 +1194,10 @@ void addDefaultVersionIdentifiers(const ref Param params) // See https://github.com/dlang/dmd/pull/8020 // And https://wiki.osdev.org/Target_Triplet version (CRuntime_Musl) + { VersionCondition.addPredefinedGlobalIdent("CRuntime_Musl"); + VersionCondition.addPredefinedGlobalIdent("ExtExecinfo_BSDFmt"); + } else VersionCondition.addPredefinedGlobalIdent("CRuntime_Glibc"); VersionCondition.addPredefinedGlobalIdent("CppRuntime_Gcc");