Index: lib/Driver/ToolChains/Gnu.cpp =================================================================== --- lib/Driver/ToolChains/Gnu.cpp +++ lib/Driver/ToolChains/Gnu.cpp @@ -1838,7 +1838,8 @@ "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", - "x86_64-slackware-linux", "x86_64-unknown-linux"}; + "x86_64-slackware-linux", "x86_64-unknown-linux", + "x86_64-amazon-linux"}; static const char *const X32LibDirs[] = {"/libx32"}; static const char *const X86LibDirs[] = {"/lib32", "/lib"}; static const char *const X86Triples[] = { Index: test/Driver/linux-ld.c =================================================================== --- test/Driver/linux-ld.c +++ test/Driver/linux-ld.c @@ -1792,3 +1792,25 @@ // CHECK-LD-RHLE7-DTS: Selected GCC installation: [[GCC_INSTALL:[[SYSROOT]]/lib/gcc/x86_64-redhat-linux/7]] // CHECK-LD-RHEL7-DTS-NOT: /usr/bin/ld // CHECK-LD-RHLE7-DTS: [[GCC_INSTALL]/../../../bin/ld + +// Check whether gcc7 install works fine on Amazon Linux AMI +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=x86_64-amazon-linux -rtlib=libgcc \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/ami_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-LD-AMI %s +// CHECK-LD-AMI-NOT: warning: +// CHECK-LD-AMI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-LD-AMI: "--eh-frame-hdr" +// CHECK-LD-AMI: "-m" "elf_x86_64" +// CHECK-LD-AMI: "-dynamic-linker" +// CHECK-LD-AMI: "{{.*}}/usr/lib/gcc/x86_64-amazon-linux/7{{/|\\\\}}crtbegin.o" +// CHECK-LD-AMI: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-amazon-linux/7" +// CHECK-LD-AMI: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-amazon-linux/7/../../../../lib64" +// CHECK-LD-AMI: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-amazon-linux/7/../../.." +// CHECK-LD-AMI: "-L[[SYSROOT]]/lib" +// CHECK-LD-AMI: "-L[[SYSROOT]]/usr/lib" +// CHECK-LD-AMI: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +// CHECK-LD-AMI: "-lc" +// CHECK-LD-AMI: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" +//