@@ -184,6 +184,9 @@ def __init__(self, inputList, exactMatches={}, patternMatches={}):
184
184
'-current_version' : (1 , ArgumentListFilter .linkBinaryCallback ),
185
185
'-compatibility_version' : (1 , ArgumentListFilter .linkBinaryCallback ),
186
186
187
+ # dragonegg mystery argument
188
+ '--64' : (0 , ArgumentListFilter .compileUnaryCallback ),
189
+
187
190
#
188
191
# BD: need to warn the darwin user that these flags will rain on their parade
189
192
# (the Darwin ld is a bit single minded)
@@ -455,6 +458,8 @@ def attachBitcodePathToObject(bcPath, outFileName):
455
458
# Don't try to attach a bitcode path to a binary. Unfortunately
456
459
# that won't work.
457
460
(root , ext ) = os .path .splitext (outFileName )
461
+ if DEBUG :
462
+ print ('attachBitcodePathToObject: {0} ===> {1} [ext = {2}]\n ' .format (bcPath , outFileName , ext ))
458
463
#iam: this also looks very dodgey; we need a more reliable way to do this:
459
464
if ext not in ('.o' , '.lo' , '.os' , '.So' , '.po' ):
460
465
_logger .warning ('Cannot attach bitcode path to "{0} of type {1}"' .format (outFileName , FileType .getFileType (outFileName )))
@@ -520,6 +525,12 @@ def __init__(self, cmd, isCxx, prefixPath=None):
520
525
else :
521
526
self .prefixPath = ''
522
527
528
+ #clang and drogonegg share the same taste in bitcode filenames.
529
+ def getBitcodeFileName (self , argFilter ):
530
+ (dirs , baseFile ) = os .path .split (argFilter .getOutputFilename ())
531
+ bcfilename = os .path .join (dirs , '.{0}.bc' .format (baseFile ))
532
+ return bcfilename
533
+
523
534
class ClangBuilder (BuilderBase ):
524
535
def __init__ (self , cmd , isCxx , prefixPath = None ):
525
536
super (ClangBuilder , self ).__init__ (cmd , isCxx , prefixPath )
@@ -537,11 +548,6 @@ def getCompiler(self):
537
548
def getBitcodeArglistFilter (self ):
538
549
return ClangBitcodeArgumentListFilter (self .cmd )
539
550
540
- def getBitcodeFileName (self , argFilter ):
541
- (dirs , baseFile ) = os .path .split (argFilter .getOutputFilename ())
542
- bcfilename = os .path .join (dirs , '.{0}.bc' .format (baseFile ))
543
- return bcfilename
544
-
545
551
def extraBitcodeArgs (self , argFilter ):
546
552
bcPath = self .getBitcodeFileName (argFilter )
547
553
return ['-o' , bcPath ]
@@ -562,8 +568,10 @@ def getBitcodeCompiler(self):
562
568
# We use '-B' to tell gcc where to look for an assembler.
563
569
# When we build LLVM bitcode we do not want to use the GNU assembler,
564
570
# instead we want gcc to use our own assembler (see driver/as).
565
- return cc + ['-B' , driverDir , '-fplugin={0}' .format (pth ),
566
- '-fplugin-arg-dragonegg-emit-ir' ]
571
+ cmd = cc + ['-B' , driverDir , '-fplugin={0}' .format (pth ), '-fplugin-arg-dragonegg-emit-ir' ]
572
+ if DEBUG :
573
+ print (cmd )
574
+ return cmd
567
575
568
576
def getCompiler (self ):
569
577
pfx = ''
@@ -575,6 +583,7 @@ def getCompiler(self):
575
583
else :
576
584
return ['{0}{1}gcc' .format (self .prefixPath , pfx )]
577
585
586
+
578
587
def getBitcodeArglistFilter (self ):
579
588
return ArgumentListFilter (self .cmd )
580
589
@@ -687,6 +696,8 @@ def buildBitcodeFile(builder, srcFile, bcFile):
687
696
bcc .extend (af .compileArgs )
688
697
bcc .extend (['-c' , srcFile ])
689
698
bcc .extend (['-o' , bcFile ])
699
+ if DEBUG :
700
+ print ('buildBitcodeFile: {0}\n ' .format (bcc ))
690
701
proc = Popen (bcc )
691
702
rc = proc .wait ()
692
703
if rc != 0 :
@@ -699,6 +710,8 @@ def buildObjectFile(builder, srcFile, objFile):
699
710
cc .extend (af .compileArgs )
700
711
cc .append (srcFile )
701
712
cc .extend (['-c' , '-o' , objFile ])
713
+ if DEBUG :
714
+ print ('buildObjectFile: {0}\n ' .format (cc ))
702
715
proc = Popen (cc )
703
716
rc = proc .wait ()
704
717
if rc != 0 :
0 commit comments