<font><font face="tahoma,sans-serif">Hi;<br></font></font><br><div class="gmail_quote">On Fri, Apr 6, 2012 at 10:14 PM, Simon Atanasyan <span dir="ltr"><<a href="mailto:satanasyan@mips.com">satanasyan@mips.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: atanasyan<br>
Date: Fri Apr 6 15:14:27 2012<br>
New Revision: 154200<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=154200&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=154200&view=rev</a><br>
Log:<br>
MIPS: Provide a correct path to the dynamic linker when build for MIPS 64-bit targets.<br>
<br>
Modified:<br>
cfe/trunk/lib/Driver/Tools.cpp<br>
cfe/trunk/test/Driver/linux-ld.c<br>
<br>
Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=154200&r1=154199&r2=154200&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=154200&r1=154199&r2=154200&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Apr 6 15:14:27 2012<br>
@@ -5164,6 +5164,9 @@<br>
else if (ToolChain.getArch() == llvm::Triple::mips ||<br>
ToolChain.getArch() == llvm::Triple::mipsel)<br>
CmdArgs.push_back("/lib/ld.so.1");<br>
+ else if (ToolChain.getArch() == llvm::Triple::mips64 ||<br>
+ ToolChain.getArch() == llvm::Triple::mips64el)<br>
+ CmdArgs.push_back("/lib64/ld.so.1");<br>
else if (ToolChain.getArch() == llvm::Triple::ppc)<br>
CmdArgs.push_back("/lib/ld.so.1");<br>
else if (ToolChain.getArch() == llvm::Triple::ppc64)<br>
<br>
Modified: cfe/trunk/test/Driver/linux-ld.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=154200&r1=154199&r2=154200&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=154200&r1=154199&r2=154200&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Driver/linux-ld.c (original)<br>
+++ cfe/trunk/test/Driver/linux-ld.c Fri Apr 6 15:14:27 2012<br>
@@ -187,26 +187,35 @@<br>
// CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/../lib64"<br>
//<br>
// Check that we do not pass --hash-style=gnu and --hash-style=both to linker<br>
-// when build for MIPS platforms.<br>
+// and provide correct path to the dynamic linker and emulation mode when build<br>
+// for MIPS platforms.<br>
// RUN: %clang %s -### -o %t.o 2>&1 \<br>
// RUN: -target mips-linux-gnu -ccc-clang-archs mips \<br>
// RUN: | FileCheck --check-prefix=CHECK-MIPS %s<br>
// CHECK-MIPS: "{{.*}}ld{{(.exe)?}}"<br>
+// CHECK-MIPS: "-m" "elf32btsmip"<br>
+// CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1"<br>
// CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"<br>
// RUN: %clang %s -### -o %t.o 2>&1 \<br>
// RUN: -target mipsel-linux-gnu -ccc-clang-archs mipsel \<br>
// RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s<br>
// CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}"<br>
+// CHECK-MIPSEL: "-m" "elf32ltsmip"<br>
+// CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib/ld.so.1"<br></blockquote><div><br></div><div>This last line breaks on Linux/x86-64 :</div><div><br></div>/home/abuild/rpmbuild/BUILD/llvm/tools/clang/test/Driver/linux-ld.c:197:16: error: expected string not found in input<br>
// CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1"<br> ^<br><stdin>:6:99: note: scanning from here<br> "/usr/bin/ld" "-z" "relro" "--build-id" "--enable-new-dtags" "--eh-frame-hdr" "-m" "elf32btsmip" "-dynamic-linker" "/lib64/ld.so.1" "-o" "/home/abuild/rpmbuild/BUILD/llvm/stage3/tools/clang/test/Driver/Output/linux-ld.c.tmp.o" "crt1.o" "crti.o" "crtbegin.o" "-L/lib" "-L/usr/lib" "/tmp/linux-ld-FjAs8Q.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "crtend.o" "crtn.o"<br>
<br>Regards,<br>ismail<div><br></div><div> </div></div>