2012-10-10 04:46:28 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes \
|
2014-11-14 00:55:42 +08:00
|
|
|
// RUN: -target aarch64-pc-freebsd11 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ARM64 %s
|
|
|
|
// CHECK-ARM64: "-cc1" "-triple" "aarch64-pc-freebsd11"
|
|
|
|
// CHECK-ARM64: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
|
|
|
// CHECK-ARM64: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"
|
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes \
|
2012-04-10 04:40:11 +08:00
|
|
|
// RUN: -target powerpc-pc-freebsd8 %s \
|
2012-01-26 09:35:15 +08:00
|
|
|
// RUN: --sysroot=%S/Inputs/basic_freebsd_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-PPC %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-PPC: "-cc1" "-triple" "powerpc-pc-freebsd8"
|
2012-01-25 18:50:34 +08:00
|
|
|
// CHECK-PPC: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
|
|
|
// CHECK-PPC: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"
|
2010-08-11 01:39:05 +08:00
|
|
|
//
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes \
|
2012-04-10 04:40:11 +08:00
|
|
|
// RUN: -target powerpc64-pc-freebsd8 %s \
|
2012-01-26 09:35:15 +08:00
|
|
|
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-PPC64 %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-PPC64: "-cc1" "-triple" "powerpc64-pc-freebsd8"
|
2012-01-26 09:35:15 +08:00
|
|
|
// CHECK-PPC64: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
|
|
|
// CHECK-PPC64: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"
|
|
|
|
//
|
2010-08-11 01:39:05 +08:00
|
|
|
//
|
2012-01-26 09:35:15 +08:00
|
|
|
// Check that -m32 properly adjusts the toolchain flags.
|
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LIB32 %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-LIB32: "-cc1" "-triple" "i386-pc-freebsd8"
|
2010-08-11 01:39:05 +08:00
|
|
|
// CHECK-LIB32: ld{{.*}}" {{.*}} "-m" "elf_i386_fbsd"
|
|
|
|
//
|
2012-01-26 09:35:15 +08:00
|
|
|
// RUN: %clang -target x86_64-pc-freebsd8 -m32 %s 2>&1 \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -print-search-dirs 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LIB32PATHS %s
|
2011-01-29 02:28:30 +08:00
|
|
|
// CHECK-LIB32PATHS: libraries: ={{.*:?}}/usr/lib32
|
2012-07-16 05:18:01 +08:00
|
|
|
//
|
2018-02-13 06:22:01 +08:00
|
|
|
// Check that O32 MIPS uses /usr/lib32 on a 64-bit tree.
|
|
|
|
//
|
|
|
|
// RUN: %clang -target mips-freebsd12 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -print-search-dirs 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LIB32PATHS %s
|
|
|
|
//
|
2018-06-27 08:02:16 +08:00
|
|
|
// Check that MIPS passes the correct linker emulation.
|
|
|
|
//
|
|
|
|
// RUN: %clang -target mips-freebsd %s -### %s 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS-LD %s
|
|
|
|
// CHECK-MIPS-LD: ld{{.*}}" {{.*}} "-m" "elf32btsmip_fbsd"
|
|
|
|
// RUN: %clang -target mipsel-freebsd %s -### %s 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPSEL-LD %s
|
|
|
|
// CHECK-MIPSEL-LD: ld{{.*}}" {{.*}} "-m" "elf32ltsmip_fbsd"
|
|
|
|
// RUN: %clang -target mips64-freebsd %s -### %s 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS64-LD %s
|
|
|
|
// CHECK-MIPS64-LD: ld{{.*}}" {{.*}} "-m" "elf64btsmip_fbsd"
|
|
|
|
// RUN: %clang -target mips64el-freebsd %s -### %s 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s
|
|
|
|
// CHECK-MIPS64EL-LD: ld{{.*}}" {{.*}} "-m" "elf64ltsmip_fbsd"
|
|
|
|
// RUN: %clang -target mips64-freebsd -mabi=n32 %s -### %s 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPSN32-LD %s
|
|
|
|
// CHECK-MIPSN32-LD: ld{{.*}}" {{.*}} "-m" "elf32btsmipn32_fbsd"
|
|
|
|
// RUN: %clang -target mips64el-freebsd -mabi=n32 %s -### %s 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPSN32EL-LD %s
|
|
|
|
// CHECK-MIPSN32EL-LD: ld{{.*}}" {{.*}} "-m" "elf32ltsmipn32_fbsd"
|
|
|
|
//
|
[RISCV] Add FreeBSD targets
Reviewers: asb
Reviewed By: asb
Subscribers: simoncook, s.egerton, lenary, psnobl, benna, mhorne, emaste, kito-cheng, shiva0217, rogfer01, rkruppe, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D57795
Patch by James Clarke (jrtc27)
llvm-svn: 367557
2019-08-01 21:14:30 +08:00
|
|
|
// Check that RISC-V passes the correct linker emulation.
|
|
|
|
//
|
|
|
|
// RUN: %clang -target riscv32-freebsd %s -### %s 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-RV32I-LD %s
|
|
|
|
// CHECK-RV32I-LD: ld{{.*}}" {{.*}} "-m" "elf32lriscv"
|
|
|
|
// RUN: %clang -target riscv64-freebsd %s -### %s 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-RV64I-LD %s
|
|
|
|
// CHECK-RV64I-LD: ld{{.*}}" {{.*}} "-m" "elf64lriscv"
|
|
|
|
//
|
2012-07-16 05:18:01 +08:00
|
|
|
// Check that the new linker flags are passed to FreeBSD
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
2012-07-29 23:24:44 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LDFLAGS8 %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd9 -m32 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LDFLAGS9 %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd10.0 -m32 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LDFLAGS9 %s
|
|
|
|
// CHECK-LDFLAGS8-NOT: --hash-style=both
|
|
|
|
// CHECK-LDFLAGS8: --enable-new-dtags
|
|
|
|
// CHECK-LDFLAGS9: --hash-style=both
|
|
|
|
// CHECK-LDFLAGS9: --enable-new-dtags
|
2012-09-06 05:32:44 +08:00
|
|
|
//
|
|
|
|
// Check that we do not pass --hash-style=gnu and --hash-style=both to linker
|
|
|
|
// and provide correct path to the dynamic linker for MIPS platforms.
|
|
|
|
// Also verify that we tell the assembler to target the right ISA and ABI.
|
|
|
|
// RUN: %clang %s -### -o %t.o 2>&1 \
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: -target mips-unknown-freebsd10.0 \
|
2012-09-06 05:32:44 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS %s
|
2012-09-07 00:29:03 +08:00
|
|
|
// CHECK-MIPS: "{{[^" ]*}}ld{{[^" ]*}}"
|
2012-09-06 05:32:44 +08:00
|
|
|
// CHECK-MIPS: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
|
|
|
|
// CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
|
|
|
|
// RUN: %clang %s -### -o %t.o 2>&1 \
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: -target mipsel-unknown-freebsd10.0 \
|
2012-09-06 05:32:44 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s
|
2012-09-07 00:29:03 +08:00
|
|
|
// CHECK-MIPSEL: "{{[^" ]*}}ld{{[^" ]*}}"
|
2012-09-06 05:32:44 +08:00
|
|
|
// CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
|
|
|
|
// CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang %s -### 2>&1 \
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: -target mips64-unknown-freebsd10.0 \
|
2012-09-06 05:32:44 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s
|
2012-09-07 00:29:03 +08:00
|
|
|
// CHECK-MIPS64: "{{[^" ]*}}ld{{[^" ]*}}"
|
2012-09-06 05:32:44 +08:00
|
|
|
// CHECK-MIPS64: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
|
|
|
|
// CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang %s -### 2>&1 \
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: -target mips64el-unknown-freebsd10.0 \
|
2012-09-06 05:32:44 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s
|
2012-09-07 00:29:03 +08:00
|
|
|
// CHECK-MIPS64EL: "{{[^" ]*}}ld{{[^" ]*}}"
|
2012-09-06 05:32:44 +08:00
|
|
|
// CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
|
|
|
|
// CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"
|
2012-07-16 05:18:01 +08:00
|
|
|
|
2012-08-28 23:09:03 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-STATIC %s
|
2016-04-13 05:11:46 +08:00
|
|
|
// CHECK-STATIC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
|
2012-08-28 23:09:03 +08:00
|
|
|
// CHECK-STATIC: crt1.o
|
|
|
|
// CHECK-STATIC: crtbeginT.o
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -shared %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-SHARED %s
|
|
|
|
// CHECK-SHARED: crti.o
|
|
|
|
// CHECK-SHARED: crtbeginS.o
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -pie %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-PIE %s
|
|
|
|
// CHECK-PIE: pie
|
|
|
|
// CHECK-PIE: Scrt1.o
|
|
|
|
// CHECK-PIE: crtbeginS.o
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-NORMAL %s
|
|
|
|
// CHECK-NORMAL: crt1.o
|
|
|
|
// CHECK-NORMAL: crtbegin.o
|
2012-12-13 12:17:14 +08:00
|
|
|
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang %s -### -target arm-unknown-freebsd10.0 -no-integrated-as 2>&1 \
|
2012-12-13 12:17:14 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ARM %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-ARM: "-cc1"{{.*}}" "-fsjlj-exceptions"
|
2012-12-13 12:17:14 +08:00
|
|
|
// CHECK-ARM: as{{.*}}" "-mfpu=softvfp"{{.*}}"-matpcs"
|
2014-02-19 18:44:07 +08:00
|
|
|
// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp"
|
2012-12-13 12:17:14 +08:00
|
|
|
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang %s -### -target arm-gnueabi-freebsd10.0 -no-integrated-as 2>&1 \
|
2012-12-13 12:17:14 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ARM-EABI %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-ARM-EABI-NOT: "-cc1"{{.*}}" "-fsjlj-exceptions"
|
2013-03-18 15:59:20 +08:00
|
|
|
// CHECK-ARM-EABI: as{{.*}}" "-mfpu=softvfp" "-meabi=5"
|
2014-02-19 18:44:07 +08:00
|
|
|
// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp"
|
2012-12-13 12:17:14 +08:00
|
|
|
// CHECK-ARM-EABI-NOT: as{{.*}}" "-matpcs"
|
2013-11-12 02:24:28 +08:00
|
|
|
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang %s -### -target arm-gnueabihf-freebsd10.0 -no-integrated-as 2>&1 \
|
2014-02-19 18:44:07 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ARM-EABIHF %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-ARM-EABIHF-NOT: "-cc1"{{.*}}" "-fsjlj-exceptions"
|
2014-02-19 18:44:07 +08:00
|
|
|
// CHECK-ARM-EABIHF: as{{.*}}" "-mfpu=vfp" "-meabi=5"
|
|
|
|
// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-mfpu=softvfp"
|
|
|
|
// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-matpcs"
|
|
|
|
|
2015-01-14 15:55:36 +08:00
|
|
|
// RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic -no-integrated-as 2>&1 \
|
2014-01-03 01:18:03 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-SPARC-PIE %s
|
|
|
|
// CHECK-SPARC-PIE: as{{.*}}" "-KPIC
|
2014-02-26 02:35:30 +08:00
|
|
|
|
2015-01-14 15:55:36 +08:00
|
|
|
// RUN: %clang -mcpu=ultrasparc -target sparc64-unknown-freebsd8 %s -### -no-integrated-as 2>&1 \
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-SPARC-CPU %s
|
|
|
|
// CHECK-SPARC-CPU: cc1{{.*}}" "-target-cpu" "ultrasparc"
|
2015-11-10 08:40:29 +08:00
|
|
|
// CHECK-SPARC-CPU: as{{.*}}" "-Av9
|
For FreeBSD on mips, pass -G options to the linker
Summary:
On {mips,mipsel,mips64,mips64el}-freebsd, we need to pass any -G option to the linker. See also:
https://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html#index-G-2007
This has been adapted from https://reviews.freebsd.org/D1190, with an added test case.
Reviewers: theraven, atanasyan, emaste
Subscribers: brooks, tomatabacu, cfe-commits, seanbruno, emaste
Differential Revision: http://reviews.llvm.org/D9114
llvm-svn: 256461
2015-12-27 14:47:09 +08:00
|
|
|
|
|
|
|
// Check that -G flags are passed to the linker for mips
|
|
|
|
// RUN: %clang -target mips-unknown-freebsd %s -### -G0 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS-G %s
|
|
|
|
// CHECK-MIPS-G: ld{{.*}}" "-G0"
|
2018-06-27 03:48:05 +08:00
|
|
|
|
|
|
|
// Check CPU type for MIPS
|
|
|
|
// RUN: %clang -target mips-unknown-freebsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-MIPS-CPU %s
|
|
|
|
// RUN: %clang -target mipsel-unknown-freebsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-MIPS-CPU %s
|
|
|
|
// CHECK-MIPS-CPU: "-target-cpu" "mips2"
|
|
|
|
|
|
|
|
// Check CPU type for MIPS64
|
|
|
|
// RUN: %clang -target mips64-unknown-freebsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-MIPS64-CPU %s
|
|
|
|
// RUN: %clang -target mips64el-unknown-freebsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-MIPS64-CPU %s
|
|
|
|
// CHECK-MIPS64-CPU: "-target-cpu" "mips3"
|
2018-06-30 03:03:03 +08:00
|
|
|
|
2019-04-08 08:03:01 +08:00
|
|
|
// Check that the integrated assembler is enabled for SPARC64
|
2019-04-08 07:12:31 +08:00
|
|
|
// RUN: %clang -target sparc64-unknown-freebsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-IAS %s
|
|
|
|
// CHECK-IAS-NOT: "-no-integrated-as"
|
2019-11-15 22:30:24 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target ppc64-unknown-freebsd13.0 -### -S %s 2>&1 | \
|
|
|
|
// RUN: FileCheck -check-prefix=PPC64-MUNWIND %s
|
|
|
|
// PPC64-MUNWIND: -munwind-table
|