Index: lib/Driver/ToolChains/FreeBSD.cpp =================================================================== --- lib/Driver/ToolChains/FreeBSD.cpp +++ lib/Driver/ToolChains/FreeBSD.cpp @@ -156,12 +156,8 @@ CmdArgs.push_back("-dynamic-linker"); CmdArgs.push_back("/libexec/ld-elf.so.1"); } - if (ToolChain.getTriple().getOSMajorVersion() >= 9) { - if (Arch == llvm::Triple::arm || Arch == llvm::Triple::sparc || - Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64) { - CmdArgs.push_back("--hash-style=both"); - } - } + if (ToolChain.getTriple().getOSMajorVersion() >= 9) + CmdArgs.push_back("--hash-style=gnu"); CmdArgs.push_back("--enable-new-dtags"); } Index: test/Driver/freebsd.c =================================================================== --- test/Driver/freebsd.c +++ test/Driver/freebsd.c @@ -73,38 +73,10 @@ // 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-NOT: --hash-style=gnu // CHECK-LDFLAGS8: --enable-new-dtags -// CHECK-LDFLAGS9: --hash-style=both +// CHECK-LDFLAGS9: --hash-style=gnu // CHECK-LDFLAGS9: --enable-new-dtags -// -// 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 \ -// RUN: -target mips-unknown-freebsd10.0 \ -// RUN: | FileCheck --check-prefix=CHECK-MIPS %s -// CHECK-MIPS: "{{[^" ]*}}ld{{[^" ]*}}" -// CHECK-MIPS: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1" -// CHECK-MIPS-NOT: "--hash-style={{gnu|both}}" -// RUN: %clang %s -### -o %t.o 2>&1 \ -// RUN: -target mipsel-unknown-freebsd10.0 \ -// RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s -// CHECK-MIPSEL: "{{[^" ]*}}ld{{[^" ]*}}" -// CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1" -// CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}" -// RUN: %clang %s -### 2>&1 \ -// RUN: -target mips64-unknown-freebsd10.0 \ -// RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s -// CHECK-MIPS64: "{{[^" ]*}}ld{{[^" ]*}}" -// CHECK-MIPS64: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1" -// CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}" -// RUN: %clang %s -### 2>&1 \ -// RUN: -target mips64el-unknown-freebsd10.0 \ -// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s -// CHECK-MIPS64EL: "{{[^" ]*}}ld{{[^" ]*}}" -// CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1" -// CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}" // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \ // RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \