[cfe-commits] r155656 - in /cfe/trunk: lib/Driver/ToolChains.cpp test/Driver/linux-ld.c
Chandler Carruth
chandlerc at google.com
Thu Apr 26 13:00:28 PDT 2012
On Thu, Apr 26, 2012 at 12:57 PM, Simon Atanasyan <satanasyan at mips.com>wrote:
> Author: atanasyan
> Date: Thu Apr 26 14:57:02 2012
> New Revision: 155656
>
> URL: http://llvm.org/viewvc/llvm-project?rev=155656&view=rev
> Log:
> MIPS: Add support for 64-bit MIPS targets: mips64 / mips64el.
>
Very cool!
>
> Modified:
> cfe/trunk/lib/Driver/ToolChains.cpp
> cfe/trunk/test/Driver/linux-ld.c
>
> Modified: cfe/trunk/lib/Driver/ToolChains.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=155656&r1=155655&r2=155656&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Driver/ToolChains.cpp (original)
> +++ cfe/trunk/lib/Driver/ToolChains.cpp Thu Apr 26 14:57:02 2012
> @@ -1218,6 +1218,11 @@
> static const char *const MIPSELLibDirs[] = { "/lib" };
> static const char *const MIPSELTriples[] = { "mipsel-linux-gnu" };
>
> + static const char *const MIPS64LibDirs[] = { "/lib64", "/lib" };
> + static const char *const MIPS64Triples[] = { "mips64-linux-gnu" };
> + static const char *const MIPS64ELLibDirs[] = { "/lib64", "/lib" };
> + static const char *const MIPS64ELTriples[] = { "mips64el-linux-gnu" };
> +
> static const char *const PPCLibDirs[] = { "/lib32", "/lib" };
> static const char *const PPCTriples[] = {
> "powerpc-linux-gnu",
> @@ -1263,12 +1268,40 @@
> MIPSLibDirs, MIPSLibDirs + llvm::array_lengthof(MIPSLibDirs));
> TripleAliases.append(
> MIPSTriples, MIPSTriples + llvm::array_lengthof(MIPSTriples));
> + MultiarchLibDirs.append(
> + MIPS64LibDirs, MIPS64LibDirs + llvm::array_lengthof(MIPS64LibDirs));
> + MultiarchTripleAliases.append(
> + MIPS64Triples, MIPS64Triples + llvm::array_lengthof(MIPS64Triples));
> break;
> case llvm::Triple::mipsel:
> LibDirs.append(
> MIPSELLibDirs, MIPSELLibDirs + llvm::array_lengthof(MIPSELLibDirs));
> TripleAliases.append(
> MIPSELTriples, MIPSELTriples + llvm::array_lengthof(MIPSELTriples));
> + MultiarchLibDirs.append(
> + MIPS64ELLibDirs, MIPS64ELLibDirs +
> llvm::array_lengthof(MIPS64ELLibDirs));
> + MultiarchTripleAliases.append(
> + MIPS64ELTriples, MIPS64ELTriples +
> llvm::array_lengthof(MIPS64ELTriples));
> + break;
> + case llvm::Triple::mips64:
> + LibDirs.append(
> + MIPS64LibDirs, MIPS64LibDirs + llvm::array_lengthof(MIPS64LibDirs));
> + TripleAliases.append(
> + MIPS64Triples, MIPS64Triples + llvm::array_lengthof(MIPS64Triples));
> + MultiarchLibDirs.append(
> + MIPSLibDirs, MIPSLibDirs + llvm::array_lengthof(MIPSLibDirs));
> + MultiarchTripleAliases.append(
> + MIPSTriples, MIPSTriples + llvm::array_lengthof(MIPSTriples));
> + break;
> + case llvm::Triple::mips64el:
> + LibDirs.append(
> + MIPS64ELLibDirs, MIPS64ELLibDirs +
> llvm::array_lengthof(MIPS64ELLibDirs));
> + TripleAliases.append(
> + MIPS64ELTriples, MIPS64ELTriples +
> llvm::array_lengthof(MIPS64ELTriples));
> + MultiarchLibDirs.append(
> + MIPSELLibDirs, MIPSELLibDirs + llvm::array_lengthof(MIPSELLibDirs));
> + MultiarchTripleAliases.append(
> + MIPSELTriples, MIPSELTriples + llvm::array_lengthof(MIPSELTriples));
> break;
> case llvm::Triple::ppc:
> LibDirs.append(PPCLibDirs, PPCLibDirs +
> llvm::array_lengthof(PPCLibDirs));
> @@ -1350,7 +1383,9 @@
> // crtbegin.o without the subdirectory.
> StringRef MultiarchSuffix
> = (TargetArch == llvm::Triple::x86_64 ||
> - TargetArch == llvm::Triple::ppc64) ? "/64" : "/32";
> + TargetArch == llvm::Triple::ppc64 ||
> + TargetArch == llvm::Triple::mips64 ||
> + TargetArch == llvm::Triple::mips64el) ? "/64" : "/32";
> if (llvm::sys::fs::exists(LI->path() + MultiarchSuffix +
> "/crtbegin.o")) {
> GCCMultiarchSuffix = MultiarchSuffix.str();
> } else {
>
> Modified: cfe/trunk/test/Driver/linux-ld.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=155656&r1=155655&r2=155656&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Driver/linux-ld.c (original)
> +++ cfe/trunk/test/Driver/linux-ld.c Thu Apr 26 14:57:02 2012
> @@ -291,6 +291,28 @@
> // CHECK-DEBIAN-MIPSEL:
> "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
> // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/lib"
> // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib"
> +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
> +// RUN: -target mips64-linux-gnu \
> +// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
> +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64 %s
> +// CHECK-DEBIAN-MIPS64: "{{.*}}ld{{(.exe)?}}"
> "--sysroot=[[SYSROOT:[^"]+]]"
> +// CHECK-DEBIAN-MIPS64:
> "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/64/crtbegin.o"
> +// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/64"
> +// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
> +// CHECK-DEBIAN-MIPS64:
> "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
> +// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/lib"
> +// CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib"
> +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
> +// RUN: -target mips64el-linux-gnu \
> +// RUN: --sysroot=%S/Inputs/debian_multiarch_tree \
> +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL %s
> +// CHECK-DEBIAN-MIPS64EL: "{{.*}}ld{{(.exe)?}}"
> "--sysroot=[[SYSROOT:[^"]+]]"
> +// CHECK-DEBIAN-MIPS64EL:
> "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/64/crtbegin.o"
> +// CHECK-DEBIAN-MIPS64EL:
> "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/64"
> +// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
> +// CHECK-DEBIAN-MIPS64EL:
> "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
> +// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/lib"
> +// CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
Please add a multilib tree and test against that as well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120426/0ec8cb72/attachment.html>
More information about the cfe-commits
mailing list