@@ -103,11 +103,19 @@ def attachBitcodePathToObject(bcPath, outFileName):
103
103
# that won't work.
104
104
(_ , ext ) = os .path .splitext (outFileName )
105
105
_logger .debug ('attachBitcodePathToObject: %s ===> %s [ext = %s]' , bcPath , outFileName , ext )
106
- #iam: this also looks very dodgey; we need a more reliable way to do this:
107
- if ext not in ('.o' , '.lo' , '.os' , '.So' , '.po' ):
108
- _logger .warning ('Cannot attach bitcode path to "%s of type %s"' , outFileName , FileType .getFileType (outFileName ))
106
+
107
+ #iam: just object files, right?
108
+ fileType = FileType .getFileType (outFileName )
109
+ if fileType not in (FileType .MACH_OBJECT , FileType .ELF_OBJECT ):
110
+ #if fileType not in (FileType.MACH_OBJECT, FileType.MACH_SHARED, FileType.ELF_OBJECT, FileType.ELF_SHARED):
111
+ _logger .warning ('Cannot attach bitcode path to "%s of type %s"' , outFileName , FileType .getReadableFileType (fileType ))
109
112
return
110
113
114
+ #iam: this also looks very dodgey; we need a more reliable way to do this:
115
+ #if ext not in ('.o', '.lo', '.os', '.So', '.po'):
116
+ # _logger.warning('Cannot attach bitcode path to "%s of type %s"', outFileName, FileType.getReadableFileType(outFileName))
117
+ # return
118
+
111
119
# Now just build a temporary text file with the full path to the
112
120
# bitcode file that we'll write into the object file.
113
121
f = tempfile .NamedTemporaryFile (mode = 'w+b' , delete = False )
0 commit comments