Skip to content

Commit 2434539

Browse files
committed
---
yaml --- r: 56708 b: refs/heads/try c: 77eadc0 h: refs/heads/master v: v3
1 parent c247cf5 commit 2434539

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5-
refs/heads/try: d09835d2e3c0cb3227baec0ba6f1b23d7c95f474
5+
refs/heads/try: 77eadc0653dac6314ee425ab2502433348c82418
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/rustllvm/RustWrapper.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ using namespace llvm::sys;
6262

6363
static const char *LLVMRustError;
6464

65+
extern cl::opt<bool> EnableARMEHABI;
66+
6567
extern "C" LLVMMemoryBufferRef
6668
LLVMRustCreateMemoryBufferWithContentsOfFile(const char *Path) {
6769
LLVMMemoryBufferRef MemBuf = NULL;
@@ -429,10 +431,16 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
429431

430432
LLVMRustInitializeTargets();
431433

432-
int argc = 3;
433-
const char* argv[] = {"rustc", "-arm-enable-ehabi",
434-
"-arm-enable-ehabi-descriptors"};
435-
cl::ParseCommandLineOptions(argc, argv);
434+
// Initializing the command-line options more than once is not
435+
// allowed. So, check if they've already been initialized.
436+
// (This could happen if we're being called from rustpkg, for
437+
// example.)
438+
if (!EnableARMEHABI) {
439+
int argc = 3;
440+
const char* argv[] = {"rustc", "-arm-enable-ehabi",
441+
"-arm-enable-ehabi-descriptors"};
442+
cl::ParseCommandLineOptions(argc, argv);
443+
}
436444

437445
TargetOptions Options;
438446
Options.NoFramePointerElim = true;

0 commit comments

Comments
 (0)