[PATCH] D32269: [Driver] Add iSOFTLinux to GNU ToolChains X86Triple

Leslie Zhai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 24 21:54:06 PDT 2017


xiangzhai updated this revision to Diff 96497.
xiangzhai added a comment.

Hi Saleem,

Please check whether or not "the correct GCC search dir" for x86_64-isoft-linux firstly, please point out my fault, thanks!

And sysroot structure shown as:

  $ tree clang/test/Driver/Inputs/isoft_linux_4_tree
  
  ├── lib
  └── usr
      ├── lib
      │   └── gcc
      │       └── x86_64-isoft-linux
      │           └── 6.3.0
      │               ├── crtbegin.o
      │               ├── crtbeginT.o
      │               └── crtfastmath.o
      └── x86_64-isoft-linux
          └── lib

Regards,
Leslie Zhai


Repository:
  rL LLVM

https://reviews.llvm.org/D32269

Files:
  lib/Driver/ToolChains/Gnu.cpp
  test/Driver/linux-ld.c


Index: test/Driver/linux-ld.c
===================================================================
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -443,6 +443,33 @@
 // CHECK-BASIC-LIBCXX-C-LINK: "--sysroot=[[SYSROOT]]"
 // CHECK-BASIC-LIBCXX-C-LINK: "-L[[SYSROOT]]/usr/bin/../lib"
 //
+// Check iSOFTLinux v4.0 on x86
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN:     --target=x86_64-isoft-linux -rtlib=platform \
+// RUN:     --gcc-toolchain="" \
+// RUN:     --sysroot=%S/Inputs/isoft_linux_4_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-ISOFT-4-X86_64 %s
+// CHECK-ISOFT-4-X86_64--NOT: warning:
+// CHECK-ISOFT-4-X86_64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-ISOFT-4-X86_64: "--eh-frame-hdr"
+// CHECK-ISOFT-4-X86_64: "-m" "elf_x86_64"
+// CHECK-ISOFT-4-X86_64: "-dynamic-linker"
+// CHECK-ISOFT-4-X86_64: "{{.*}}/usr/lib/gcc/x86_64-isoft-linux/6.3.0{{/|\\\\}}crtbegin.o"
+// CHECK-ISOFT-4-X86_64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-isoft-linux/6.3.0"
+// CHECK-ISOFT-4-X86_64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-isoft-linux/6.3.0/../../../../x86_64-isoft-linux/lib"
+// CHECK-ISOFT-4-X86_64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-isoft-linux/6.3.0/../../.."
+// CHECK-ISOFT-4-X86_64: "-L[[SYSROOT]]/lib"
+// CHECK-ISOFT-4-X86_64: "-L[[SYSROOT]]/usr/lib"
+// CHECK-ISOFT-4-X86_64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// CHECK-ISOFT-4-X86_64: "-lc"
+// CHECK-ISOFT-4-X86_64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+//
+// RUN: %clang %s -### -o %t.o 2>&1 --target=x86_64-everest-linux
+// RUN: %clang %s -### -o %t.o 2>&1 --target=x86_64-pure64-linux
+// RUN: %clang %s -### -o %t.o 2>&1 --target=i686-isoft-linux
+// RUN: %clang %s -### -o %t.o 2>&1 --target=i686-everest-linux
+// RUN: %clang %s -### -o %t.o 2>&1 --target=i686-pure64-linux
+//
 // Test a very broken version of multiarch that shipped in Ubuntu 11.04.
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN:     --target=i386-unknown-linux \
Index: lib/Driver/ToolChains/Gnu.cpp
===================================================================
--- lib/Driver/ToolChains/Gnu.cpp
+++ lib/Driver/ToolChains/Gnu.cpp
@@ -1759,6 +1759,9 @@
   static const char *const X86_64LibDirs[] = {"/lib64", "/lib"};
   static const char *const X86_64Triples[] = {
       "x86_64-linux-gnu",       "x86_64-unknown-linux-gnu",
+      "x86_64-isoft-linux",     "x86_64-isoft-linux-gnu",
+      "x86_64-everest-linux",   "x86_64-everest-linux-gnu",
+      "x86_64-pure64-linux",    "x86_64-pure64-linux-gnu",
       "x86_64-pc-linux-gnu",    "x86_64-redhat-linux6E",
       "x86_64-redhat-linux",    "x86_64-suse-linux",
       "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
@@ -1768,6 +1771,9 @@
   static const char *const X86LibDirs[] = {"/lib32", "/lib"};
   static const char *const X86Triples[] = {
       "i686-linux-gnu",       "i686-pc-linux-gnu",     "i486-linux-gnu",
+      "i686-isoft-linux",     "i686-isoft-linux-gnu",
+      "i686-everest-linux",   "i686-everest-linux-gnu",
+      "i686-pure64-linux",    "i686-pure64-linux-gnu",
       "i386-linux-gnu",       "i386-redhat-linux6E",   "i686-redhat-linux",
       "i586-redhat-linux",    "i386-redhat-linux",     "i586-suse-linux",
       "i486-slackware-linux", "i686-montavista-linux", "i686-linux-android",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32269.96497.patch
Type: text/x-patch
Size: 3327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170425/251d82c8/attachment.bin>


More information about the cfe-commits mailing list