r249893 - [Myriad]: put libstdc++ and libc in the right order
Douglas Katzman via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 9 13:26:21 PDT 2015
Author: dougk
Date: Fri Oct 9 15:26:20 2015
New Revision: 249893
URL: http://llvm.org/viewvc/llvm-project?rev=249893&view=rev
Log:
[Myriad]: put libstdc++ and libc in the right order
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/myriad-toolchain.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=249893&r1=249892&r2=249893&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Oct 9 15:26:20 2015
@@ -9885,6 +9885,8 @@ void tools::Myriad::Linker::ConstructJob
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
if (UseDefaultLibs) {
+ if (C.getDriver().CCCIsCXX())
+ CmdArgs.push_back("-lstdc++");
if (T.getOS() == llvm::Triple::RTEMS) {
CmdArgs.push_back("--start-group");
CmdArgs.push_back("-lc");
@@ -9895,8 +9897,6 @@ void tools::Myriad::Linker::ConstructJob
} else {
CmdArgs.push_back("-lc");
}
- if (C.getDriver().CCCIsCXX())
- CmdArgs.push_back("-lstdc++");
CmdArgs.push_back("-lgcc");
}
if (UseStartfiles) {
Modified: cfe/trunk/test/Driver/myriad-toolchain.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/myriad-toolchain.c?rev=249893&r1=249892&r2=249893&view=diff
==============================================================================
--- cfe/trunk/test/Driver/myriad-toolchain.c (original)
+++ cfe/trunk/test/Driver/myriad-toolchain.c Fri Oct 9 15:26:20 2015
@@ -54,8 +54,10 @@
// RUN: | FileCheck %s -check-prefix=MDMF
// MDMF: "-S" "-MD" "-MF" "dep.d" "-MT" "foo.o"
+// RUN: %clang -target sparc-myriad -### --driver-mode=g++ %s 2>&1 | FileCheck %s --check-prefix=STDLIBCXX
+// STDLIBCXX: "-lstdc++" "-lc" "-lgcc"
+
// RUN: %clang -target sparc-myriad -### -nostdlib %s 2>&1 | FileCheck %s --check-prefix=NOSTDLIB
-//
// NOSTDLIB-NOT: "-lc"
// RUN: %clang -### -c -g %s -target sparc-myriad 2>&1 | FileCheck -check-prefix=G_SPARC %s
More information about the cfe-commits
mailing list