File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
branches/try/src/rustllvm Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5
- refs/heads/try: d09835d2e3c0cb3227baec0ba6f1b23d7c95f474
5
+ refs/heads/try: 77eadc0653dac6314ee425ab2502433348c82418
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ using namespace llvm::sys;
62
62
63
63
static const char *LLVMRustError;
64
64
65
+ extern cl::opt<bool > EnableARMEHABI;
66
+
65
67
extern " C" LLVMMemoryBufferRef
66
68
LLVMRustCreateMemoryBufferWithContentsOfFile (const char *Path) {
67
69
LLVMMemoryBufferRef MemBuf = NULL ;
@@ -429,10 +431,16 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
429
431
430
432
LLVMRustInitializeTargets ();
431
433
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
+ }
436
444
437
445
TargetOptions Options;
438
446
Options.NoFramePointerElim = true ;
You can’t perform that action at this time.
0 commit comments