From dceac987bd219730f99b477f7d730486ad39d683 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Mon, 26 Jan 2015 12:30:16 +0000 Subject: [PATCH] For NetBSD/ARM-EB, link with --be8. Support for the older BE32 is currently not planned. llvm-svn: 227088 --- clang/lib/Driver/Tools.cpp | 2 ++ clang/test/Driver/netbsd.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 21c8580..55d5283 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -6902,6 +6902,8 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA, break; case llvm::Triple::armeb: case llvm::Triple::thumbeb: + if (!Args.hasArg(options::OPT_r)) + CmdArgs.push_back("--be8"); CmdArgs.push_back("-m"); switch (getToolChain().getTriple().getEnvironment()) { case llvm::Triple::EABI: diff --git a/clang/test/Driver/netbsd.c b/clang/test/Driver/netbsd.c index eded7f5..26d6483 100644 --- a/clang/test/Driver/netbsd.c +++ b/clang/test/Driver/netbsd.c @@ -19,6 +19,9 @@ // RUN: %clang -no-canonical-prefixes -target armeb--netbsd-eabi \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARMEB %s +// RUN: %clang -r -no-canonical-prefixes -target armeb--netbsd-eabi \ +// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix=ARMEB-R %s // RUN: %clang -no-canonical-prefixes -target arm--netbsd \ // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=ARM-APCS %s @@ -132,12 +135,15 @@ // ARMEB: clang{{.*}}" "-cc1" "-triple" "armebv5e--netbsd-eabi" // ARMEB: as{{.*}}" "-mcpu=arm926ej-s" "-o" // ARMEB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" -// ARMEB: "-m" "armelfb_nbsd_eabi" +// ARMEB: "--be8" "-m" "armelfb_nbsd_eabi" // ARMEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" // ARMEB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o" // ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc" // ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o" +// ARMEB-R: ld{{.*}}" +// ARMEB-R-NOT: "--be8" + // ARM-APCS: clang{{.*}}" "-cc1" "-triple" "armv4--netbsd" // ARM-APCS: as{{.*}}" "-mcpu=strongarm" "-o" // ARM-APCS: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so" -- 2.7.4