diff --git a/src/main.cpp b/src/main.cpp index 8805382f3..b793ff054 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -634,8 +634,11 @@ static int main0(int argc, char **argv) { case Stage2ClangArgL: // -l if (strcmp(it.only_arg, "c") == 0) have_libc = true; - if (strcmp(it.only_arg, "c++") == 0) + if (strcmp(it.only_arg, "c++") == 0 || + strcmp(it.only_arg, "stdc++") == 0) + { have_libcpp = true; + } link_libs.append(it.only_arg); break; case Stage2ClangArgIgnore: @@ -1018,7 +1021,7 @@ static int main0(int argc, char **argv) { const char *l = &arg[2]; if (strcmp(l, "c") == 0) have_libc = true; - if (strcmp(l, "c++") == 0) + if (strcmp(l, "c++") == 0 || strcmp(l, "stdc++") == 0) have_libcpp = true; link_libs.append(l); } else if (arg[1] == 'I' && arg[2] != 0) { @@ -1161,7 +1164,7 @@ static int main0(int argc, char **argv) { } else if (strcmp(arg, "--library") == 0 || strcmp(arg, "-l") == 0) { if (strcmp(argv[i], "c") == 0) have_libc = true; - if (strcmp(argv[i], "c++") == 0) + if (strcmp(argv[i], "c++") == 0 || strcmp(argv[i], "stdc++") == 0) have_libcpp = true; link_libs.append(argv[i]); } else if (strcmp(arg, "--forbid-library") == 0) {