Skip to content

Commit 714c3fd

Browse files
committed
---
yaml --- r: 50529 b: refs/heads/auto c: 77eadc0 h: refs/heads/master i: 50527: 1b7b9af v: v3
1 parent afa0d86 commit 714c3fd

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
@@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: d09835d2e3c0cb3227baec0ba6f1b23d7c95f474
17+
refs/heads/auto: 77eadc0653dac6314ee425ab2502433348c82418
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167

branches/auto/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)