From a5b33da343b259227fd94ceafab2164e92bb57d6 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Sun, 2 Feb 2014 22:50:34 +0000 Subject: [PATCH] Use a switch for the emulation handling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200666 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index cc0f7795ad..4bfc272f74 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -6110,16 +6110,15 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA, } } - // When building 32-bit code on NetBSD/amd64, we have to explicitly - // instruct ld in the base system to link 32-bit code. - if (getToolChain().getArch() == llvm::Triple::x86) { + // Many NetBSD architectures support more than one ABI. + // Determine the correct emulation for ld. + switch (getToolChain().getArch()) { + case llvm::Triple::x86: CmdArgs.push_back("-m"); CmdArgs.push_back("elf_i386"); - } - - // On ARM, the linker can generate either EABI or the older APCS. - // Instruct it to use the correct emulation. - if (getToolChain().getArch() == llvm::Triple::arm) { + break; + case llvm::Triple::arm: + case llvm::Triple::thumb: CmdArgs.push_back("-m"); switch (getToolChain().getTriple().getEnvironment()) { case llvm::Triple::EABI: @@ -6132,6 +6131,9 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("armelf_nbsd"); break; } + break; + default: + break; } if (Output.isFilename()) { -- 2.40.0