diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index ab85d0f65e6c..2685687ba69f 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -9941,7 +9941,7 @@ void tools::Myriad::Linker::ConstructJob(Compilation &C, const JobAction &JA, static_cast(getToolChain()); const llvm::Triple &T = TC.getTriple(); ArgStringList CmdArgs; - bool UseStartfiles = !Args.hasArg(options::OPT_nostartfiles); + bool UseStartfiles = !Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles); bool UseDefaultLibs = !Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs); diff --git a/clang/test/Driver/myriad-toolchain.c b/clang/test/Driver/myriad-toolchain.c index e2222aced34a..bd543f68f8de 100644 --- a/clang/test/Driver/myriad-toolchain.c +++ b/clang/test/Driver/myriad-toolchain.c @@ -68,6 +68,7 @@ // STDLIBCXX: "-lstdc++" "-lc" "-lgcc" // RUN: %clang -target sparc-myriad -### -nostdlib %s 2>&1 | FileCheck %s --check-prefix=NOSTDLIB +// NOSTDLIB-NOT: crtbegin.o // NOSTDLIB-NOT: "-lc" // RUN: %clang -### -c -g %s -target sparc-myriad 2>&1 | FileCheck -check-prefix=G_SPARC %s