1 // General tests that ld invocations on Linux targets sane. Note that we use 2 // sysroot to make these tests independent of the host system. 3 // 4 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 5 // RUN: --target=i386-unknown-linux \ 6 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 7 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s 8 // CHECK-LD-32-NOT: warning: 9 // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 10 // CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 11 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" 12 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" 13 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." 14 // CHECK-LD-32: "-L[[SYSROOT]]/lib" 15 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib" 16 // 17 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 18 // RUN: --target=x86_64-unknown-linux \ 19 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 20 // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s 21 // CHECK-LD-64-NOT: warning: 22 // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 23 // CHECK-LD-64: "--eh-frame-hdr" 24 // CHECK-LD-64: "-m" "elf_x86_64" 25 // CHECK-LD-64: "-dynamic-linker" 26 // CHECK-LD-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 27 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 28 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 29 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 30 // CHECK-LD-64: "-L[[SYSROOT]]/lib" 31 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib" 32 // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" 33 // CHECK-LD-64: "-lc" 34 // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" 35 // 36 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 37 // RUN: --target=x86_64-unknown-linux \ 38 // RUN: -static-libgcc \ 39 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 40 // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC-LIBGCC %s 41 // CHECK-LD-64-STATIC-LIBGCC-NOT: warning: 42 // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 43 // CHECK-LD-64-STATIC-LIBGCC: "--eh-frame-hdr" 44 // CHECK-LD-64-STATIC-LIBGCC: "-m" "elf_x86_64" 45 // CHECK-LD-64-STATIC-LIBGCC: "-dynamic-linker" 46 // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 47 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 48 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 49 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 50 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/lib" 51 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib" 52 // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" 53 // CHECK-LD-64-STATIC-LIBGCC: "-lc" 54 // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" 55 // 56 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 57 // RUN: --target=x86_64-unknown-linux \ 58 // RUN: -static \ 59 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 60 // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s 61 // CHECK-LD-64-STATIC-NOT: warning: 62 // CHECK-LD-64-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 63 // CHECK-LD-64-STATIC-NOT: "--eh-frame-hdr" 64 // CHECK-LD-64-STATIC: "-m" "elf_x86_64" 65 // CHECK-LD-64-STATIC-NOT: "-dynamic-linker" 66 // CHECK-LD-64-STATIC: "-static" 67 // CHECK-LD-64-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbeginT.o" 68 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 69 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 70 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 71 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/lib" 72 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib" 73 // CHECK-LD-64-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group" 74 // 75 // Check that flags can be combined. The -static dominates. 76 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 77 // RUN: --target=x86_64-unknown-linux \ 78 // RUN: -static-libgcc -static \ 79 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 80 // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s 81 // 82 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 83 // RUN: --target=i386-unknown-linux -m32 \ 84 // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \ 85 // RUN: | FileCheck --check-prefix=CHECK-32-TO-32 %s 86 // CHECK-32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 87 // CHECK-32-TO-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 88 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" 89 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib32" 90 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib32" 91 // CHECK-32-TO-32: "-L[[SYSROOT]]/lib/../lib32" 92 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32" 93 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" 94 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." 95 // CHECK-32-TO-32: "-L[[SYSROOT]]/lib" 96 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib" 97 // 98 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 99 // RUN: --target=i386-unknown-linux -m64 \ 100 // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \ 101 // RUN: | FileCheck --check-prefix=CHECK-32-TO-64 %s 102 // CHECK-32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 103 // CHECK-32-TO-64: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/64{{/|\\\\}}crtbegin.o" 104 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/64" 105 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib64" 106 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib64" 107 // CHECK-32-TO-64: "-L[[SYSROOT]]/lib/../lib64" 108 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64" 109 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" 110 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" 111 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." 112 // CHECK-32-TO-64: "-L[[SYSROOT]]/lib" 113 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib" 114 // 115 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 116 // RUN: --target=x86_64-unknown-linux -m64 \ 117 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \ 118 // RUN: | FileCheck --check-prefix=CHECK-64-TO-64 %s 119 // CHECK-64-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 120 // CHECK-64-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 121 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 122 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib64" 123 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib64" 124 // CHECK-64-TO-64: "-L[[SYSROOT]]/lib/../lib64" 125 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64" 126 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 127 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 128 // CHECK-64-TO-64: "-L[[SYSROOT]]/lib" 129 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib" 130 // 131 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 132 // RUN: --target=x86_64-unknown-linux -m32 \ 133 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \ 134 // RUN: | FileCheck --check-prefix=CHECK-64-TO-32 %s 135 // CHECK-64-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 136 // CHECK-64-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o" 137 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32" 138 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib32" 139 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib32" 140 // CHECK-64-TO-32: "-L[[SYSROOT]]/lib/../lib32" 141 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32" 142 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 143 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 144 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 145 // CHECK-64-TO-32: "-L[[SYSROOT]]/lib" 146 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib" 147 // 148 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 149 // RUN: --target=x86_64-unknown-linux -m32 \ 150 // RUN: --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \ 151 // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \ 152 // RUN: | FileCheck --check-prefix=CHECK-64-TO-32-SYSROOT %s 153 // CHECK-64-TO-32-SYSROOT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 154 // CHECK-64-TO-32-SYSROOT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o" 155 // CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32" 156 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib/../lib32" 157 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib/../lib32" 158 // CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 159 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib" 160 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib" 161 // 162 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 163 // RUN: --target=i386-unknown-linux -m32 \ 164 // RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \ 165 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 166 // RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-32 %s 167 // CHECK-INSTALL-DIR-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 168 // CHECK-INSTALL-DIR-32: "{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0{{/|\\\\}}crtbegin.o" 169 // CHECK-INSTALL-DIR-32: "-L{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0" 170 // 171 // Check that with 64-bit builds, we don't actually use the install directory 172 // as its version of GCC is lower than our sysrooted version. 173 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 174 // RUN: --target=x86_64-unknown-linux -m64 \ 175 // RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \ 176 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 177 // RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-64 %s 178 // CHECK-INSTALL-DIR-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 179 // CHECK-INSTALL-DIR-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 180 // CHECK-INSTALL-DIR-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 181 // 182 // Check that we support unusual patch version formats, including missing that 183 // component. 184 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 185 // RUN: --target=i386-unknown-linux -m32 \ 186 // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing1/bin \ 187 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 188 // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION1 %s 189 // CHECK-GCC-VERSION1: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 190 // CHECK-GCC-VERSION1: "{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7{{/|\\\\}}crtbegin.o" 191 // CHECK-GCC-VERSION1: "-L{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7" 192 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 193 // RUN: --target=i386-unknown-linux -m32 \ 194 // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing2/bin \ 195 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 196 // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION2 %s 197 // CHECK-GCC-VERSION2: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 198 // CHECK-GCC-VERSION2: "{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x{{/|\\\\}}crtbegin.o" 199 // CHECK-GCC-VERSION2: "-L{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x" 200 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 201 // RUN: --target=i386-unknown-linux -m32 \ 202 // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing3/bin \ 203 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 204 // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION3 %s 205 // CHECK-GCC-VERSION3: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 206 // CHECK-GCC-VERSION3: "{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5{{/|\\\\}}crtbegin.o" 207 // CHECK-GCC-VERSION3: "-L{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5" 208 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 209 // RUN: --target=i386-unknown-linux -m32 \ 210 // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing4/bin \ 211 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 212 // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION4 %s 213 // CHECK-GCC-VERSION4: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 214 // CHECK-GCC-VERSION4: "{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99{{/|\\\\}}crtbegin.o" 215 // CHECK-GCC-VERSION4: "-L{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99" 216 // 217 // Test a very broken version of multiarch that shipped in Ubuntu 11.04. 218 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 219 // RUN: --target=i386-unknown-linux \ 220 // RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \ 221 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s 222 // CHECK-UBUNTU-11-04: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 223 // CHECK-UBUNTU-11-04: "{{.*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 224 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" 225 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../i386-linux-gnu" 226 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu" 227 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." 228 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/lib" 229 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib" 230 // 231 // Check multi arch support on Ubuntu 12.04 LTS. 232 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 233 // RUN: --target=arm-unknown-linux-gnueabihf \ 234 // RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \ 235 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM-HF %s 236 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 237 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crt1.o" 238 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crti.o" 239 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtbegin.o" 240 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3" 241 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf" 242 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/lib/arm-linux-gnueabihf" 243 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabihf" 244 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../.." 245 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtend.o" 246 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crtn.o" 247 // 248 // Check fedora 18 on arm. 249 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 250 // RUN: --target=armv7-unknown-linux-gnueabihf \ 251 // RUN: --sysroot=%S/Inputs/fedora_18_tree \ 252 // RUN: | FileCheck --check-prefix=CHECK-FEDORA-18-ARM-HF %s 253 // CHECK-FEDORA-18-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 254 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../..{{/|\\\\}}crt1.o" 255 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../..{{/|\\\\}}crti.o" 256 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtbegin.o" 257 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2" 258 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../.." 259 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/lib" 260 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib" 261 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtend.o" 262 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../..{{/|\\\\}}crtn.o" 263 // 264 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 265 // RUN: --target=arm-unknown-linux-gnueabi \ 266 // RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \ 267 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM %s 268 // CHECK-UBUNTU-12-04-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 269 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crt1.o" 270 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crti.o" 271 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtbegin.o" 272 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1" 273 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi" 274 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/lib/arm-linux-gnueabi" 275 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabi" 276 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../.." 277 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtend.o" 278 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crtn.o" 279 // 280 // Test the setup that shipped in SUSE 10.3 on ppc64. 281 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 282 // RUN: --target=powerpc64-suse-linux \ 283 // RUN: --sysroot=%S/Inputs/suse_10.3_ppc64_tree \ 284 // RUN: | FileCheck --check-prefix=CHECK-SUSE-10-3-PPC64 %s 285 // CHECK-SUSE-10-3-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 286 // CHECK-SUSE-10-3-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64{{/|\\\\}}crtbegin.o" 287 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64" 288 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib64" 289 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/lib/../lib64" 290 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/../lib64" 291 // 292 // Check dynamic-linker for different archs 293 // RUN: %clang %s -### -o %t.o 2>&1 \ 294 // RUN: --target=arm-linux-gnueabi \ 295 // RUN: | FileCheck --check-prefix=CHECK-ARM %s 296 // CHECK-ARM: "{{.*}}ld{{(.exe)?}}" 297 // CHECK-ARM: "-m" "armelf_linux_eabi" 298 // CHECK-ARM: "-dynamic-linker" "{{.*}}/lib/ld-linux.so.3" 299 // 300 // RUN: %clang %s -### -o %t.o 2>&1 \ 301 // RUN: --target=arm-linux-gnueabihf \ 302 // RUN: | FileCheck --check-prefix=CHECK-ARM-HF %s 303 // CHECK-ARM-HF: "{{.*}}ld{{(.exe)?}}" 304 // CHECK-ARM-HF: "-m" "armelf_linux_eabi" 305 // CHECK-ARM-HF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3" 306 // 307 // Check that we do not pass --hash-style=gnu and --hash-style=both to linker 308 // and provide correct path to the dynamic linker and emulation mode when build 309 // for MIPS platforms. 310 // RUN: %clang %s -### -o %t.o 2>&1 \ 311 // RUN: --target=mips-linux-gnu \ 312 // RUN: | FileCheck --check-prefix=CHECK-MIPS %s 313 // CHECK-MIPS: "{{.*}}ld{{(.exe)?}}" 314 // CHECK-MIPS: "-m" "elf32btsmip" 315 // CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1" 316 // CHECK-MIPS-NOT: "--hash-style={{gnu|both}}" 317 // RUN: %clang %s -### -o %t.o 2>&1 \ 318 // RUN: --target=mipsel-linux-gnu \ 319 // RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s 320 // CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}" 321 // CHECK-MIPSEL: "-m" "elf32ltsmip" 322 // CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib/ld.so.1" 323 // CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}" 324 // RUN: %clang %s -### -o %t.o 2>&1 \ 325 // RUN: --target=mips64-linux-gnu \ 326 // RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s 327 // CHECK-MIPS64: "{{.*}}ld{{(.exe)?}}" 328 // CHECK-MIPS64: "-m" "elf64btsmip" 329 // CHECK-MIPS64: "-dynamic-linker" "{{.*}}/lib64/ld.so.1" 330 // CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}" 331 // RUN: %clang %s -### -o %t.o 2>&1 \ 332 // RUN: --target=mips64el-linux-gnu \ 333 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s 334 // CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}" 335 // CHECK-MIPS64EL: "-m" "elf64ltsmip" 336 // CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/lib64/ld.so.1" 337 // CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}" 338 // RUN: %clang %s -### -o %t.o 2>&1 \ 339 // RUN: --target=mips64-linux-gnu -mabi=n32 \ 340 // RUN: | FileCheck --check-prefix=CHECK-MIPS64-N32 %s 341 // CHECK-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" 342 // CHECK-MIPS64-N32: "-m" "elf32btsmipn32" 343 // CHECK-MIPS64-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1" 344 // CHECK-MIPS64-N32-NOT: "--hash-style={{gnu|both}}" 345 // RUN: %clang %s -### -o %t.o 2>&1 \ 346 // RUN: --target=mips64el-linux-gnu -mabi=n32 \ 347 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-N32 %s 348 // CHECK-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" 349 // CHECK-MIPS64EL-N32: "-m" "elf32ltsmipn32" 350 // CHECK-MIPS64EL-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1" 351 // CHECK-MIPS64EL-N32-NOT: "--hash-style={{gnu|both}}" 352 // 353 // Thoroughly exercise the Debian multiarch environment. 354 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 355 // RUN: --target=i686-linux-gnu \ 356 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 357 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s 358 // CHECK-DEBIAN-X86: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 359 // CHECK-DEBIAN-X86: "{{.*}}/usr/lib/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 360 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5" 361 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../i386-linux-gnu" 362 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu" 363 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../.." 364 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/lib" 365 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib" 366 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 367 // RUN: --target=x86_64-linux-gnu \ 368 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 369 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s 370 // CHECK-DEBIAN-X86-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 371 // CHECK-DEBIAN-X86-64: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 372 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5" 373 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../x86_64-linux-gnu" 374 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu" 375 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../.." 376 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/lib" 377 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib" 378 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 379 // RUN: --target=powerpc-linux-gnu \ 380 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 381 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s 382 // CHECK-DEBIAN-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 383 // CHECK-DEBIAN-PPC: "{{.*}}/usr/lib/gcc/powerpc-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 384 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5" 385 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../powerpc-linux-gnu" 386 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/powerpc-linux-gnu" 387 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../.." 388 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/lib" 389 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib" 390 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 391 // RUN: --target=powerpc64-linux-gnu \ 392 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 393 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s 394 // CHECK-DEBIAN-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 395 // CHECK-DEBIAN-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 396 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5" 397 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../powerpc64-linux-gnu" 398 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/powerpc64-linux-gnu" 399 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../.." 400 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/lib" 401 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib" 402 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 403 // RUN: --target=mips-linux-gnu \ 404 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 405 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS %s 406 // CHECK-DEBIAN-MIPS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 407 // CHECK-DEBIAN-MIPS: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 408 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5" 409 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../../mips-linux-gnu" 410 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/mips-linux-gnu" 411 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.." 412 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/lib" 413 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib" 414 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 415 // RUN: --target=mipsel-linux-gnu \ 416 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 417 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPSEL %s 418 // CHECK-DEBIAN-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 419 // CHECK-DEBIAN-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 420 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5" 421 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../../mipsel-linux-gnu" 422 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/mipsel-linux-gnu" 423 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.." 424 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/lib" 425 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib" 426 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 427 // RUN: --target=mips64-linux-gnu \ 428 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 429 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64 %s 430 // CHECK-DEBIAN-MIPS64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 431 // CHECK-DEBIAN-MIPS64: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o" 432 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/64" 433 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5" 434 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.." 435 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/lib" 436 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib" 437 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 438 // RUN: --target=mips64el-linux-gnu \ 439 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 440 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL %s 441 // CHECK-DEBIAN-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 442 // CHECK-DEBIAN-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o" 443 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/64" 444 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5" 445 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.." 446 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/lib" 447 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib" 448 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 449 // RUN: --target=mips64-linux-gnu -mabi=n32 \ 450 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 451 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64-N32 %s 452 // CHECK-DEBIAN-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 453 // CHECK-DEBIAN-MIPS64-N32: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o" 454 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/n32" 455 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5" 456 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.." 457 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/lib" 458 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib" 459 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 460 // RUN: --target=mips64el-linux-gnu -mabi=n32 \ 461 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 462 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL-N32 %s 463 // CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 464 // CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o" 465 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/n32" 466 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5" 467 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.." 468 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/lib" 469 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib" 470 // 471 // Test linker invocation on Android. 472 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 473 // RUN: --target=arm-linux-androideabi \ 474 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 475 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 476 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 477 // RUN: --target=arm-linux-android \ 478 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 479 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 480 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 481 // RUN: --target=mipsel-linux-android \ 482 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 483 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 484 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 485 // RUN: --target=i386-linux-android \ 486 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 487 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 488 // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 489 // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o" 490 // CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib" 491 // CHECK-ANDROID-NOT: "gcc_s" 492 // CHECK-ANDROID: "-lgcc" 493 // CHECK-ANDROID: "-ldl" 494 // CHECK-ANDROID-NOT: "gcc_s" 495 // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o" 496 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 497 // RUN: --target=arm-linux-androideabi \ 498 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 499 // RUN: -shared \ 500 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 501 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 502 // RUN: --target=arm-linux-android \ 503 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 504 // RUN: -shared \ 505 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 506 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 507 // RUN: --target=mipsel-linux-android \ 508 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 509 // RUN: -shared \ 510 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 511 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 512 // RUN: --target=i386-linux-android \ 513 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 514 // RUN: -shared \ 515 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 516 // CHECK-ANDROID-SO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 517 // CHECK-ANDROID-SO: "-Bsymbolic" 518 // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtbegin_so.o" 519 // CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib" 520 // CHECK-ANDROID-SO-NOT: "gcc_s" 521 // CHECK-ANDROID-SO: "-lgcc" 522 // CHECK-ANDROID-SO: "-ldl" 523 // CHECK-ANDROID-SO-NOT: "gcc_s" 524 // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o" 525 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 526 // RUN: --target=arm-linux-androideabi \ 527 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 528 // RUN: -static \ 529 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 530 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 531 // RUN: --target=arm-linux-android \ 532 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 533 // RUN: -static \ 534 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 535 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 536 // RUN: --target=mipsel-linux-android \ 537 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 538 // RUN: -static \ 539 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 540 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 541 // RUN: --target=i386-linux-android \ 542 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 543 // RUN: -static \ 544 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 545 // CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 546 // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtbegin_static.o" 547 // CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib" 548 // CHECK-ANDROID-STATIC-NOT: "gcc_s" 549 // CHECK-ANDROID-STATIC: "-lgcc" 550 // CHECK-ANDROID-STATIC-NOT: "-ldl" 551 // CHECK-ANDROID-STATIC-NOT: "gcc_s" 552 // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o" 553 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 554 // RUN: --target=arm-linux-androideabi \ 555 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 556 // RUN: -pie \ 557 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 558 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 559 // RUN: --target=arm-linux-android \ 560 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 561 // RUN: -pie \ 562 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 563 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 564 // RUN: --target=mipsel-linux-android \ 565 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 566 // RUN: -pie \ 567 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 568 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 569 // RUN: --target=i386-linux-android \ 570 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 571 // RUN: -pie \ 572 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 573 // CHECK-ANDROID-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 574 // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o" 575 // CHECK-ANDROID-PIE: "-L[[SYSROOT]]/usr/lib" 576 // CHECK-ANDROID-PIE-NOT: "gcc_s" 577 // CHECK-ANDROID-PIE: "-lgcc" 578 // CHECK-ANDROID-PIE-NOT: "gcc_s" 579 // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtend_android.o" 580 // 581 // Check linker invocation on Debian 6 MIPS 32/64-bit. 582 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 583 // RUN: --target=mipsel-linux-gnu \ 584 // RUN: --sysroot=%S/Inputs/debian_6_mips_tree \ 585 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPSEL %s 586 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 587 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crt1.o" 588 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crti.o" 589 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4{{/|\\\\}}crtbegin.o" 590 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4" 591 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib" 592 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib/../lib" 593 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/../lib" 594 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.." 595 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib" 596 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib" 597 // 598 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 599 // RUN: --target=mips64el-linux-gnu \ 600 // RUN: --sysroot=%S/Inputs/debian_6_mips_tree \ 601 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL %s 602 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 603 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crt1.o" 604 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crti.o" 605 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/64{{/|\\\\}}crtbegin.o" 606 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/64" 607 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64" 608 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib/../lib64" 609 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/../lib64" 610 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.." 611 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib" 612 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib" 613 // 614 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 615 // RUN: --target=mips64el-linux-gnu -mabi=n32 \ 616 // RUN: --sysroot=%S/Inputs/debian_6_mips_tree \ 617 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-N32 %s 618 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 619 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crt1.o" 620 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crti.o" 621 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/n32{{/|\\\\}}crtbegin.o" 622 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/n32" 623 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32" 624 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib/../lib32" 625 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/../lib32" 626 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.." 627 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib" 628 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib" 629 // 630 // Test linker invocation for Freescale SDK (OpenEmbedded). 631 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 632 // RUN: --target=powerpc-fsl-linux \ 633 // RUN: --sysroot=%S/Inputs/freescale_ppc_tree \ 634 // RUN: | FileCheck --check-prefix=CHECK-FSL-PPC %s 635 // CHECK-FSL-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 636 // CHECK-FSL-PPC: "-m" "elf32ppclinux" 637 // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crt1.o" 638 // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crtbegin.o" 639 // CHECK-FSL-PPC: "-L[[SYSROOT]]/usr/lib" 640 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 641 // RUN: --target=powerpc64-fsl-linux \ 642 // RUN: --sysroot=%S/Inputs/freescale_ppc64_tree \ 643 // RUN: | FileCheck --check-prefix=CHECK-FSL-PPC64 %s 644 // CHECK-FSL-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 645 // CHECK-FSL-PPC64: "-m" "elf64ppc" 646 // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crt1.o" 647 // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crtbegin.o" 648 // CHECK-FSL-PPC64: "-L[[SYSROOT]]/usr/lib64/powerpc64-fsl-linux/4.6.2/../.." 649 // 650 // Check that crtfastmath.o is linked with -ffast-math. 651 // RUN: %clang --target=x86_64-unknown-linux -### %s \ 652 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 653 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s 654 // RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math \ 655 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 656 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s 657 // RUN: %clang --target=x86_64-unknown-linux -### %s -funsafe-math-optimizations\ 658 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 659 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s 660 // RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -fno-fast-math \ 661 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 662 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s 663 // We don't have crtfastmath.o in the i386 tree, use it to check that file 664 // detection works. 665 // RUN: %clang --target=i386-unknown-linux -### %s -ffast-math \ 666 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 667 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s 668 // CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtfastmath.o 669 // CHECK-NOCRTFASTMATH-NOT: crtfastmath.o 670 671 // Check that we link in gcrt1.o when compiling with -pg 672 // RUN: %clang -pg --target=x86_64-unknown-linux -### %s \ 673 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \ 674 // RUN: | FileCheck --check-prefix=CHECK-PG %s 675 // CHECK-PG: gcrt1.o 676