From 36da487350cbda869337bd09872e56da87fa29b2 Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Tue, 26 Nov 2013 11:57:48 +0000 Subject: [PATCH] [Mips] Add support for nan2008 libraries and headers look up for Code Sourcery MIPS toolchain. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195753 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains.cpp | 2 + .../4.6.3/include-fixed/nan2008/el/.keep | 0 .../mips-linux-gnu/4.6.3/nan2008/crtbegin.o | 0 .../gcc/mips-linux-gnu/4.6.3/nan2008/crtend.o | 0 .../4.6.3/nan2008/el/crtbegin.o | 0 .../mips-linux-gnu/4.6.3/nan2008/el/crtend.o | 0 .../mips-linux-gnu/lib/nan2008/el/.keep | 0 .../mips-linux-gnu/libc/nan2008/el/lib/.keep | 0 .../libc/nan2008/el/usr/lib/crt1.o | 0 .../libc/nan2008/el/usr/lib/crti.o | 0 .../libc/nan2008/el/usr/lib/crtn.o | 0 .../mips-linux-gnu/libc/nan2008/lib/.keep | 0 .../libc/nan2008/usr/lib/crt1.o | 0 .../libc/nan2008/usr/lib/crti.o | 0 .../libc/nan2008/usr/lib/crtn.o | 0 test/Driver/mips-cs.cpp | 56 +++++++++++++++++++ 16 files changed, 58 insertions(+) create mode 100644 test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/nan2008/el/.keep create mode 100644 test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/crtbegin.o create mode 100644 test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/crtend.o create mode 100644 test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/el/crtbegin.o create mode 100644 test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/el/crtend.o create mode 100644 test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/nan2008/el/.keep create mode 100644 test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/lib/.keep create mode 100644 test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/usr/lib/crt1.o create mode 100644 test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/usr/lib/crti.o create mode 100644 test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/usr/lib/crtn.o create mode 100644 test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/lib/.keep create mode 100644 test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/usr/lib/crt1.o create mode 100644 test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/usr/lib/crti.o create mode 100644 test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/usr/lib/crtn.o diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index b9e97fdc38..0472cdca39 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1457,6 +1457,8 @@ void Generic_GCC::GCCInstallationDetector::findMIPSABIDirSuffix( if (isSoftFloatABI(Args)) Suffix += "/soft-float"; + else if (isMipsNan2008(Args)) + Suffix += "/nan2008"; if (TargetArch == llvm::Triple::mipsel || TargetArch == llvm::Triple::mips64el) diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/nan2008/el/.keep b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/include-fixed/nan2008/el/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/crtbegin.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/crtbegin.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/crtend.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/crtend.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/el/crtbegin.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/el/crtbegin.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/el/crtend.o b/test/Driver/Inputs/mips_cs_tree/lib/gcc/mips-linux-gnu/4.6.3/nan2008/el/crtend.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/nan2008/el/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/lib/nan2008/el/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/lib/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/lib/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/usr/lib/crt1.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/usr/lib/crt1.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/usr/lib/crti.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/usr/lib/crti.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/usr/lib/crtn.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/el/usr/lib/crtn.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/lib/.keep b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/lib/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/usr/lib/crt1.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/usr/lib/crt1.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/usr/lib/crti.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/usr/lib/crti.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/usr/lib/crtn.o b/test/Driver/Inputs/mips_cs_tree/mips-linux-gnu/libc/nan2008/usr/lib/crtn.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/mips-cs.cpp b/test/Driver/mips-cs.cpp index 86675a3c83..1e05939f5a 100644 --- a/test/Driver/mips-cs.cpp +++ b/test/Driver/mips-cs.cpp @@ -83,6 +83,34 @@ // CHECK-BE-HF-MICRO: "[[TC]]/micromips{{/|\\\\}}crtend.o" // CHECK-BE-HF-MICRO: "[[TC]]/../../../../mips-linux-gnu/libc/micromips/usr/lib/../lib{{/|\\\\}}crtn.o" // +// = Big-endian, hard float, nan2008 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=mips-linux-gnu -mnan=2008 \ +// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \ +// RUN: | FileCheck --check-prefix=CHECK-BE-HF-NAN %s +// CHECK-BE-HF-NAN: "-internal-isystem" +// CHECK-BE-HF-NAN: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3" +// CHECK-BE-HF-NAN: "-internal-isystem" +// CHECK-BE-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/mips-linux-gnu/nan2008" +// CHECK-BE-HF-NAN: "-internal-isystem" +// CHECK-BE-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/backward" +// CHECK-BE-HF-NAN: "-internal-externc-isystem" +// CHECK-BE-HF-NAN: "[[TC]]/include" +// CHECK-BE-HF-NAN: "-internal-externc-isystem" +// CHECK-BE-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/usr/include" +// CHECK-BE-HF-NAN: "{{.*}}ld{{(.exe)?}}" +// CHECK-BE-HF-NAN: "--sysroot=[[SR:[^"]+]]/../../../../mips-linux-gnu/libc/nan2008" +// CHECK-BE-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/nan2008/usr/lib/../lib{{/|\\\\}}crt1.o" +// CHECK-BE-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/nan2008/usr/lib/../lib{{/|\\\\}}crti.o" +// CHECK-BE-HF-NAN: "[[TC]]/nan2008{{/|\\\\}}crtbegin.o" +// CHECK-BE-HF-NAN: "-L[[SR]]/nan2008" +// CHECK-BE-HF-NAN: "-L[[SR]]/../../../../mips-linux-gnu/lib/../lib/nan2008" +// CHECK-BE-HF-NAN-NOT: "-L[[SR]]" +// CHECK-BE-HF-NAN: "-L[[SR]]/../../../../mips-linux-gnu/libc/nan2008/lib/../lib" +// CHECK-BE-HF-NAN: "-L[[SR]]/../../../../mips-linux-gnu/libc/nan2008/usr/lib/../lib" +// CHECK-BE-HF-NAN: "[[TC]]/nan2008{{/|\\\\}}crtend.o" +// CHECK-BE-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/nan2008/usr/lib/../lib{{/|\\\\}}crtn.o" +// // = Big-endian, soft float // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=mips-linux-gnu -msoft-float \ @@ -307,6 +335,34 @@ // CHECK-EL-HF-MICRO: "[[TC]]/micromips/el{{/|\\\\}}crtend.o" // CHECK-EL-HF-MICRO: "[[TC]]/../../../../mips-linux-gnu/libc/micromips/el/usr/lib/../lib{{/|\\\\}}crtn.o" // +// = Little-endian, hard float, nan2008 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=mipsel-linux-gnu -mnan=2008 \ +// RUN: --gcc-toolchain=%S/Inputs/mips_cs_tree \ +// RUN: | FileCheck --check-prefix=CHECK-EL-HF-NAN %s +// CHECK-EL-HF-NAN: "-internal-isystem" +// CHECK-EL-HF-NAN: "[[TC:[^"]+/lib/gcc/mips-linux-gnu/4.6.3]]/../../../../mips-linux-gnu/include/c++/4.6.3" +// CHECK-EL-HF-NAN: "-internal-isystem" +// CHECK-EL-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/mips-linux-gnu/nan2008/el" +// CHECK-EL-HF-NAN: "-internal-isystem" +// CHECK-EL-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/include/c++/4.6.3/backward" +// CHECK-EL-HF-NAN: "-internal-externc-isystem" +// CHECK-EL-HF-NAN: "[[TC]]/include" +// CHECK-EL-HF-NAN: "-internal-externc-isystem" +// CHECK-EL-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/usr/include" +// CHECK-EL-HF-NAN: "{{.*}}ld{{(.exe)?}}" +// CHECK-EL-HF-NAN: "--sysroot=[[SR:[^"]+]]/../../../../mips-linux-gnu/libc/nan2008/el" +// CHECK-EL-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/nan2008/el/usr/lib/../lib{{/|\\\\}}crt1.o" +// CHECK-EL-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/nan2008/el/usr/lib/../lib{{/|\\\\}}crti.o" +// CHECK-EL-HF-NAN: "[[TC]]/nan2008/el{{/|\\\\}}crtbegin.o" +// CHECK-EL-HF-NAN: "-L[[SR]]/nan2008/el" +// CHECK-EL-HF-NAN: "-L[[SR]]/../../../../mips-linux-gnu/lib/../lib/nan2008/el" +// CHECK-EL-HF-NAN-NOT: "-L[[SR]]" +// CHECK-EL-HF-NAN: "-L[[SR]]/../../../../mips-linux-gnu/libc/nan2008/el/lib/../lib" +// CHECK-EL-HF-NAN: "-L[[SR]]/../../../../mips-linux-gnu/libc/nan2008/el/usr/lib/../lib" +// CHECK-EL-HF-NAN: "[[TC]]/nan2008/el{{/|\\\\}}crtend.o" +// CHECK-EL-HF-NAN: "[[TC]]/../../../../mips-linux-gnu/libc/nan2008/el/usr/lib/../lib{{/|\\\\}}crtn.o" +// // = Little-endian, soft float // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=mipsel-linux-gnu -mfloat-abi=soft \ -- 2.40.0