@@ -553,21 +553,21 @@ fn addCmakeCfgOptionsToExe(
553553 // System -lc++ must be used because in this code path we are attempting to link
554554 // against system-provided LLVM, Clang, LLD.
555555 if (exe .target .getOsTag () == .linux ) {
556- // First we try to static link against gcc libstdc++. If that doesn't work,
556+ // First we try to dynamically link against gcc libstdc++. If that doesn't work,
557557 // we fall back to -lc++ and cross our fingers.
558- addCxxKnownPath (b , cfg , exe , "libstdc++.a " , "" , need_cpp_includes ) catch | err | switch (err ) {
558+ addCxxKnownPath (b , cfg , exe , "libstdc++.so " , "" , need_cpp_includes ) catch | err | switch (err ) {
559559 error .RequiredLibraryNotFound = > {
560560 exe .linkSystemLibrary ("c++" );
561561 },
562562 else = > | e | return e ,
563563 };
564564 exe .linkSystemLibrary ("unwind" );
565565 } else if (exe .target .isFreeBSD ()) {
566- try addCxxKnownPath (b , cfg , exe , "libc++.a " , null , need_cpp_includes );
566+ try addCxxKnownPath (b , cfg , exe , "libc++.so " , null , need_cpp_includes );
567567 exe .linkSystemLibrary ("pthread" );
568568 } else if (exe .target .getOsTag () == .openbsd ) {
569- try addCxxKnownPath (b , cfg , exe , "libc++.a " , null , need_cpp_includes );
570- try addCxxKnownPath (b , cfg , exe , "libc++abi.a " , null , need_cpp_includes );
569+ try addCxxKnownPath (b , cfg , exe , "libc++.so " , null , need_cpp_includes );
570+ try addCxxKnownPath (b , cfg , exe , "libc++abi.so " , null , need_cpp_includes );
571571 } else if (exe .target .isDarwin ()) {
572572 exe .linkSystemLibrary ("c++" );
573573 }
0 commit comments