Coverage Report

Created: 2020-02-25 14:32

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Driver/ToolChains/NetBSD.cpp
Line
Count
Source (jump to first uncovered line)
1
//===--- NetBSD.cpp - NetBSD ToolChain Implementations ----------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "NetBSD.h"
10
#include "Arch/ARM.h"
11
#include "Arch/Mips.h"
12
#include "Arch/Sparc.h"
13
#include "CommonArgs.h"
14
#include "clang/Driver/Compilation.h"
15
#include "clang/Driver/Driver.h"
16
#include "clang/Driver/Options.h"
17
#include "clang/Driver/SanitizerArgs.h"
18
#include "llvm/Option/ArgList.h"
19
#include "llvm/Support/VirtualFileSystem.h"
20
21
using namespace clang::driver;
22
using namespace clang::driver::tools;
23
using namespace clang::driver::toolchains;
24
using namespace clang;
25
using namespace llvm::opt;
26
27
void netbsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
28
                                     const InputInfo &Output,
29
                                     const InputInfoList &Inputs,
30
                                     const ArgList &Args,
31
65
                                     const char *LinkingOutput) const {
32
65
  claimNoWarnArgs(Args);
33
65
  ArgStringList CmdArgs;
34
65
35
65
  // GNU as needs different flags for creating the correct output format
36
65
  // on architectures with different ABIs or optional feature sets.
37
65
  switch (getToolChain().getArch()) {
38
0
  case llvm::Triple::x86:
39
0
    CmdArgs.push_back("--32");
40
0
    break;
41
9
  case llvm::Triple::arm:
42
9
  case llvm::Triple::armeb:
43
9
  case llvm::Triple::thumb:
44
9
  case llvm::Triple::thumbeb: {
45
9
    StringRef MArch, MCPU;
46
9
    arm::getARMArchCPUFromArgs(Args, MArch, MCPU, /*FromAs*/ true);
47
9
    std::string Arch =
48
9
        arm::getARMTargetCPU(MCPU, MArch, getToolChain().getTriple());
49
9
    CmdArgs.push_back(Args.MakeArgString("-mcpu=" + Arch));
50
9
    break;
51
9
  }
52
9
53
9
  case llvm::Triple::mips:
54
0
  case llvm::Triple::mipsel:
55
0
  case llvm::Triple::mips64:
56
0
  case llvm::Triple::mips64el: {
57
0
    StringRef CPUName;
58
0
    StringRef ABIName;
59
0
    mips::getMipsCPUAndABI(Args, getToolChain().getTriple(), CPUName, ABIName);
60
0
61
0
    CmdArgs.push_back("-march");
62
0
    CmdArgs.push_back(CPUName.data());
63
0
64
0
    CmdArgs.push_back("-mabi");
65
0
    CmdArgs.push_back(mips::getGnuCompatibleMipsABIName(ABIName).data());
66
0
67
0
    if (getToolChain().getTriple().isLittleEndian())
68
0
      CmdArgs.push_back("-EL");
69
0
    else
70
0
      CmdArgs.push_back("-EB");
71
0
72
0
    AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
73
0
    break;
74
0
  }
75
0
76
27
  case llvm::Triple::sparc:
77
27
  case llvm::Triple::sparcel: {
78
27
    CmdArgs.push_back("-32");
79
27
    std::string CPU = getCPUName(Args, getToolChain().getTriple());
80
27
    CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
81
27
    AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
82
27
    break;
83
27
  }
84
27
85
28
  case llvm::Triple::sparcv9: {
86
28
    CmdArgs.push_back("-64");
87
28
    std::string CPU = getCPUName(Args, getToolChain().getTriple());
88
28
    CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
89
28
    AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
90
28
    break;
91
27
  }
92
27
93
27
  default:
94
1
    break;
95
65
  }
96
65
97
65
  Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
98
65
99
65
  CmdArgs.push_back("-o");
100
65
  CmdArgs.push_back(Output.getFilename());
101
65
102
65
  for (const auto &II : Inputs)
103
65
    CmdArgs.push_back(II.getFilename());
104
65
105
65
  const char *Exec = Args.MakeArgString((getToolChain().GetProgramPath("as")));
106
65
  C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
107
65
}
108
109
void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
110
                                  const InputInfo &Output,
111
                                  const InputInfoList &Inputs,
112
                                  const ArgList &Args,
113
157
                                  const char *LinkingOutput) const {
114
157
  const toolchains::NetBSD &ToolChain =
115
157
    static_cast<const toolchains::NetBSD &>(getToolChain());
116
157
  const Driver &D = ToolChain.getDriver();
117
157
  ArgStringList CmdArgs;
118
157
119
157
  if (!D.SysRoot.empty())
120
101
    CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
121
157
122
157
  CmdArgs.push_back("--eh-frame-hdr");
123
157
  if (Args.hasArg(options::OPT_static)) {
124
36
    CmdArgs.push_back("-Bstatic");
125
36
    if (Args.hasArg(options::OPT_pie)) {
126
1
      Args.AddAllArgs(CmdArgs, options::OPT_pie);
127
1
      CmdArgs.push_back("--no-dynamic-linker");
128
1
    }
129
121
  } else {
130
121
    if (Args.hasArg(options::OPT_rdynamic))
131
0
      CmdArgs.push_back("-export-dynamic");
132
121
    if (Args.hasArg(options::OPT_shared)) {
133
1
      CmdArgs.push_back("-Bshareable");
134
120
    } else {
135
120
      Args.AddAllArgs(CmdArgs, options::OPT_pie);
136
120
      CmdArgs.push_back("-dynamic-linker");
137
120
      CmdArgs.push_back("/libexec/ld.elf_so");
138
120
    }
139
121
  }
140
157
141
157
  // Many NetBSD architectures support more than one ABI.
142
157
  // Determine the correct emulation for ld.
143
157
  switch (ToolChain.getArch()) {
144
10
  case llvm::Triple::x86:
145
10
    CmdArgs.push_back("-m");
146
10
    CmdArgs.push_back("elf_i386");
147
10
    break;
148
20
  case llvm::Triple::arm:
149
20
  case llvm::Triple::thumb:
150
20
    CmdArgs.push_back("-m");
151
20
    switch (ToolChain.getTriple().getEnvironment()) {
152
15
    case llvm::Triple::EABI:
153
15
    case llvm::Triple::GNUEABI:
154
15
      CmdArgs.push_back("armelf_nbsd_eabi");
155
15
      break;
156
15
    case llvm::Triple::EABIHF:
157
3
    case llvm::Triple::GNUEABIHF:
158
3
      CmdArgs.push_back("armelf_nbsd_eabihf");
159
3
      break;
160
3
    default:
161
2
      CmdArgs.push_back("armelf_nbsd");
162
2
      break;
163
20
    }
164
20
    break;
165
20
  case llvm::Triple::armeb:
166
6
  case llvm::Triple::thumbeb:
167
6
    arm::appendBE8LinkFlag(Args, CmdArgs, ToolChain.getEffectiveTriple());
168
6
    CmdArgs.push_back("-m");
169
6
    switch (ToolChain.getTriple().getEnvironment()) {
170
6
    case llvm::Triple::EABI:
171
6
    case llvm::Triple::GNUEABI:
172
6
      CmdArgs.push_back("armelfb_nbsd_eabi");
173
6
      break;
174
6
    case llvm::Triple::EABIHF:
175
0
    case llvm::Triple::GNUEABIHF:
176
0
      CmdArgs.push_back("armelfb_nbsd_eabihf");
177
0
      break;
178
0
    default:
179
0
      CmdArgs.push_back("armelfb_nbsd");
180
0
      break;
181
6
    }
182
6
    break;
183
6
  case llvm::Triple::mips64:
184
2
  case llvm::Triple::mips64el:
185
2
    if (mips::hasMipsAbiArg(Args, "32")) {
186
0
      CmdArgs.push_back("-m");
187
0
      if (ToolChain.getArch() == llvm::Triple::mips64)
188
0
        CmdArgs.push_back("elf32btsmip");
189
0
      else
190
0
        CmdArgs.push_back("elf32ltsmip");
191
2
    } else if (mips::hasMipsAbiArg(Args, "64")) {
192
0
      CmdArgs.push_back("-m");
193
0
      if (ToolChain.getArch() == llvm::Triple::mips64)
194
0
        CmdArgs.push_back("elf64btsmip");
195
0
      else
196
0
        CmdArgs.push_back("elf64ltsmip");
197
0
    }
198
2
    break;
199
4
  case llvm::Triple::ppc:
200
4
    CmdArgs.push_back("-m");
201
4
    CmdArgs.push_back("elf32ppc_nbsd");
202
4
    break;
203
2
204
4
  case llvm::Triple::ppc64:
205
4
  case llvm::Triple::ppc64le:
206
4
    CmdArgs.push_back("-m");
207
4
    CmdArgs.push_back("elf64ppc");
208
4
    break;
209
4
210
27
  case llvm::Triple::sparc:
211
27
    CmdArgs.push_back("-m");
212
27
    CmdArgs.push_back("elf32_sparc");
213
27
    break;
214
4
215
20
  case llvm::Triple::sparcv9:
216
20
    CmdArgs.push_back("-m");
217
20
    CmdArgs.push_back("elf64_sparc");
218
20
    break;
219
4
220
64
  default:
221
64
    break;
222
157
  }
223
157
224
157
  if (Output.isFilename()) {
225
157
    CmdArgs.push_back("-o");
226
157
    CmdArgs.push_back(Output.getFilename());
227
157
  } else {
228
0
    assert(Output.isNothing() && "Invalid output.");
229
0
  }
230
157
231
157
  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
232
154
    if (!Args.hasArg(options::OPT_shared)) {
233
153
      CmdArgs.push_back(
234
153
          Args.MakeArgString(ToolChain.GetFilePath("crt0.o")));
235
153
    }
236
154
    CmdArgs.push_back(
237
154
        Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
238
154
    if (Args.hasArg(options::OPT_shared) || 
Args.hasArg(options::OPT_pie)153
) {
239
3
      CmdArgs.push_back(
240
3
          Args.MakeArgString(ToolChain.GetFilePath("crtbeginS.o")));
241
151
    } else {
242
151
      CmdArgs.push_back(
243
151
          Args.MakeArgString(ToolChain.GetFilePath("crtbegin.o")));
244
151
    }
245
154
  }
246
157
247
157
  Args.AddAllArgs(CmdArgs, options::OPT_L);
248
157
  Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
249
157
  Args.AddAllArgs(CmdArgs, options::OPT_e);
250
157
  Args.AddAllArgs(CmdArgs, options::OPT_s);
251
157
  Args.AddAllArgs(CmdArgs, options::OPT_t);
252
157
  Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
253
157
  Args.AddAllArgs(CmdArgs, options::OPT_r);
254
157
255
157
  bool NeedsSanitizerDeps = addSanitizerRuntimes(getToolChain(), Args, CmdArgs);
256
157
  bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
257
157
  AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
258
157
259
157
  const SanitizerArgs &SanArgs = ToolChain.getSanitizerArgs();
260
157
  if (SanArgs.needsSharedRt()) {
261
0
    CmdArgs.push_back("-rpath");
262
0
    CmdArgs.push_back(Args.MakeArgString(
263
0
        ToolChain.getCompilerRTPath().c_str()));
264
0
  }
265
157
266
157
  unsigned Major, Minor, Micro;
267
157
  ToolChain.getTriple().getOSVersion(Major, Minor, Micro);
268
157
  bool useLibgcc = true;
269
157
  if (Major >= 7 || 
Major == 0135
) {
270
143
    switch (ToolChain.getArch()) {
271
138
    case llvm::Triple::aarch64:
272
138
    case llvm::Triple::aarch64_be:
273
138
    case llvm::Triple::arm:
274
138
    case llvm::Triple::armeb:
275
138
    case llvm::Triple::thumb:
276
138
    case llvm::Triple::thumbeb:
277
138
    case llvm::Triple::ppc:
278
138
    case llvm::Triple::ppc64:
279
138
    case llvm::Triple::ppc64le:
280
138
    case llvm::Triple::sparc:
281
138
    case llvm::Triple::sparcv9:
282
138
    case llvm::Triple::x86:
283
138
    case llvm::Triple::x86_64:
284
138
      useLibgcc = false;
285
138
      break;
286
138
    default:
287
5
      break;
288
157
    }
289
157
  }
290
157
291
157
  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
292
154
    // Use the static OpenMP runtime with -static-openmp
293
154
    bool StaticOpenMP = Args.hasArg(options::OPT_static_openmp) &&
294
154
                        
!Args.hasArg(options::OPT_static)4
;
295
154
    addOpenMPRuntime(CmdArgs, getToolChain(), Args, StaticOpenMP);
296
154
297
154
    if (D.CCCIsCXX()) {
298
34
      if (ToolChain.ShouldLinkCXXStdlib(Args))
299
34
        ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
300
34
      CmdArgs.push_back("-lm");
301
34
    }
302
154
    if (NeedsSanitizerDeps)
303
18
      linkSanitizerRuntimeDeps(getToolChain(), CmdArgs);
304
154
    if (NeedsXRayDeps)
305
0
      linkXRayRuntimeDeps(ToolChain, CmdArgs);
306
154
    if (Args.hasArg(options::OPT_pthread))
307
0
      CmdArgs.push_back("-lpthread");
308
154
    CmdArgs.push_back("-lc");
309
154
310
154
    if (useLibgcc) {
311
19
      if (Args.hasArg(options::OPT_static)) {
312
8
        // libgcc_eh depends on libc, so resolve as much as possible,
313
8
        // pull in any new requirements from libc and then get the rest
314
8
        // of libgcc.
315
8
        CmdArgs.push_back("-lgcc_eh");
316
8
        CmdArgs.push_back("-lc");
317
8
        CmdArgs.push_back("-lgcc");
318
11
      } else {
319
11
        CmdArgs.push_back("-lgcc");
320
11
        CmdArgs.push_back("--as-needed");
321
11
        CmdArgs.push_back("-lgcc_s");
322
11
        CmdArgs.push_back("--no-as-needed");
323
11
      }
324
19
    }
325
154
  }
326
157
327
157
  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
328
154
    if (Args.hasArg(options::OPT_shared) || 
Args.hasArg(options::OPT_pie)153
)
329
3
      CmdArgs.push_back(
330
3
          Args.MakeArgString(ToolChain.GetFilePath("crtendS.o")));
331
151
    else
332
151
      CmdArgs.push_back(
333
151
          Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
334
154
    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
335
154
  }
336
157
337
157
  ToolChain.addProfileRTLibs(Args, CmdArgs);
338
157
339
157
  const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
340
157
  C.addCommand(std::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
341
157
}
342
343
/// NetBSD - NetBSD tool chain which can call as(1) and ld(1) directly.
344
345
NetBSD::NetBSD(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
346
192
    : Generic_ELF(D, Triple, Args) {
347
192
  if (!Args.hasArg(options::OPT_nostdlib)) {
348
189
    // When targeting a 32-bit platform, try the special directory used on
349
189
    // 64-bit hosts, and only fall back to the main library directory if that
350
189
    // doesn't work.
351
189
    // FIXME: It'd be nicer to test if this directory exists, but I'm not sure
352
189
    // what all logic is needed to emulate the '=' prefix here.
353
189
    switch (Triple.getArch()) {
354
10
    case llvm::Triple::x86:
355
10
      getFilePaths().push_back("=/usr/lib/i386");
356
10
      break;
357
39
    case llvm::Triple::arm:
358
39
    case llvm::Triple::armeb:
359
39
    case llvm::Triple::thumb:
360
39
    case llvm::Triple::thumbeb:
361
39
      switch (Triple.getEnvironment()) {
362
23
      case llvm::Triple::EABI:
363
23
      case llvm::Triple::GNUEABI:
364
23
        getFilePaths().push_back("=/usr/lib/eabi");
365
23
        break;
366
23
      case llvm::Triple::EABIHF:
367
6
      case llvm::Triple::GNUEABIHF:
368
6
        getFilePaths().push_back("=/usr/lib/eabihf");
369
6
        break;
370
10
      default:
371
10
        getFilePaths().push_back("=/usr/lib/oabi");
372
10
        break;
373
39
      }
374
39
      break;
375
39
    case llvm::Triple::mips64:
376
2
    case llvm::Triple::mips64el:
377
2
      if (tools::mips::hasMipsAbiArg(Args, "o32"))
378
0
        getFilePaths().push_back("=/usr/lib/o32");
379
2
      else if (tools::mips::hasMipsAbiArg(Args, "64"))
380
0
        getFilePaths().push_back("=/usr/lib/64");
381
2
      break;
382
5
    case llvm::Triple::ppc:
383
5
      getFilePaths().push_back("=/usr/lib/powerpc");
384
5
      break;
385
27
    case llvm::Triple::sparc:
386
27
      getFilePaths().push_back("=/usr/lib/sparc");
387
27
      break;
388
106
    default:
389
106
      break;
390
189
    }
391
189
392
189
    getFilePaths().push_back("=/usr/lib");
393
189
  }
394
192
}
395
396
65
Tool *NetBSD::buildAssembler() const {
397
65
  return new tools::netbsd::Assembler(*this);
398
65
}
399
400
157
Tool *NetBSD::buildLinker() const { return new tools::netbsd::Linker(*this); }
401
402
68
ToolChain::CXXStdlibType NetBSD::GetDefaultCXXStdlibType() const {
403
68
  unsigned Major, Minor, Micro;
404
68
  getTriple().getOSVersion(Major, Minor, Micro);
405
68
  if (Major >= 7 || 
Major == 044
) {
406
52
    switch (getArch()) {
407
52
    case llvm::Triple::aarch64:
408
52
    case llvm::Triple::aarch64_be:
409
52
    case llvm::Triple::arm:
410
52
    case llvm::Triple::armeb:
411
52
    case llvm::Triple::thumb:
412
52
    case llvm::Triple::thumbeb:
413
52
    case llvm::Triple::ppc:
414
52
    case llvm::Triple::ppc64:
415
52
    case llvm::Triple::ppc64le:
416
52
    case llvm::Triple::sparc:
417
52
    case llvm::Triple::sparcv9:
418
52
    case llvm::Triple::x86:
419
52
    case llvm::Triple::x86_64:
420
52
      return ToolChain::CST_Libcxx;
421
52
    default:
422
0
      break;
423
16
    }
424
16
  }
425
16
  return ToolChain::CST_Libstdcxx;
426
16
}
427
428
void NetBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
429
26
                                   llvm::opt::ArgStringList &CC1Args) const {
430
26
  const std::string Candidates[] = {
431
26
    // directory relative to build tree
432
26
    getDriver().Dir + "/../include/c++/v1",
433
26
    // system install with full upstream path
434
26
    getDriver().SysRoot + "/usr/include/c++/v1",
435
26
    // system install from src
436
26
    getDriver().SysRoot + "/usr/include/c++",
437
26
  };
438
26
439
26
  for (const auto &IncludePath : Candidates) {
440
26
    if (!getVFS().exists(IncludePath + "/__config"))
441
0
      continue;
442
26
443
26
    // Use the first candidate that looks valid.
444
26
    addSystemInclude(DriverArgs, CC1Args, IncludePath);
445
26
    return;
446
26
  }
447
26
}
448
449
void NetBSD::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
450
8
                                      llvm::opt::ArgStringList &CC1Args) const {
451
8
  addLibStdCXXIncludePaths(getDriver().SysRoot, "/usr/include/g++", "", "", "",
452
8
                           "", DriverArgs, CC1Args);
453
8
}
454
455
192
llvm::ExceptionHandling NetBSD::GetExceptionModel(const ArgList &Args) const {
456
192
  // NetBSD uses Dwarf exceptions on ARM.
457
192
  llvm::Triple::ArchType TArch = getTriple().getArch();
458
192
  if (TArch == llvm::Triple::arm || 
TArch == llvm::Triple::armeb165
||
459
192
      
TArch == llvm::Triple::thumb156
||
TArch == llvm::Triple::thumbeb154
)
460
39
    return llvm::ExceptionHandling::DwarfCFI;
461
153
  return llvm::ExceptionHandling::None;
462
153
}
463
464
192
SanitizerMask NetBSD::getSupportedSanitizers() const {
465
192
  const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
466
192
  const bool IsX86_64 = getTriple().getArch() == llvm::Triple::x86_64;
467
192
  SanitizerMask Res = ToolChain::getSupportedSanitizers();
468
192
  if (IsX86 || 
IsX86_64182
) {
469
62
    Res |= SanitizerKind::Address;
470
62
    Res |= SanitizerKind::PointerCompare;
471
62
    Res |= SanitizerKind::PointerSubtract;
472
62
    Res |= SanitizerKind::Function;
473
62
    Res |= SanitizerKind::Leak;
474
62
    Res |= SanitizerKind::SafeStack;
475
62
    Res |= SanitizerKind::Scudo;
476
62
    Res |= SanitizerKind::Vptr;
477
62
  }
478
192
  if (IsX86_64) {
479
52
    Res |= SanitizerKind::DataFlow;
480
52
    Res |= SanitizerKind::Fuzzer;
481
52
    Res |= SanitizerKind::FuzzerNoLink;
482
52
    Res |= SanitizerKind::HWAddress;
483
52
    Res |= SanitizerKind::KernelAddress;
484
52
    Res |= SanitizerKind::KernelHWAddress;
485
52
    Res |= SanitizerKind::KernelMemory;
486
52
    Res |= SanitizerKind::Memory;
487
52
    Res |= SanitizerKind::Thread;
488
52
  }
489
192
  return Res;
490
192
}
491
492
void NetBSD::addClangTargetOptions(const ArgList &DriverArgs,
493
                                   ArgStringList &CC1Args,
494
192
                                   Action::OffloadKind) const {
495
192
  const SanitizerArgs &SanArgs = getSanitizerArgs();
496
192
  if (SanArgs.hasAnySanitizer())
497
24
    CC1Args.push_back("-D_REENTRANT");
498
192
499
192
  unsigned Major, Minor, Micro;
500
192
  getTriple().getOSVersion(Major, Minor, Micro);
501
192
  bool UseInitArrayDefault =
502
192
    Major >= 9 || Major == 0 ||
503
192
    
getTriple().getArch() == llvm::Triple::aarch6436
||
504
192
    
getTriple().getArch() == llvm::Triple::aarch64_be32
||
505
192
    
getTriple().getArch() == llvm::Triple::arm28
||
506
192
    
getTriple().getArch() == llvm::Triple::armeb20
;
507
192
508
192
  if (!DriverArgs.hasFlag(options::OPT_fuse_init_array,
509
192
                          options::OPT_fno_use_init_array, UseInitArrayDefault))
510
20
    CC1Args.push_back("-fno-use-init-array");
511
192
}