File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -127,12 +127,19 @@ def extract_section_darwin(inputFile):
127127 _logger .error ('otool failed on %s' , inputFile )
128128 sys .exit (- 1 )
129129
130- lines = otoolOutput .splitlines ()
130+ lines = otoolOutput .decode ( 'utf8' ). splitlines ()
131131 _logger .debug ('otool extracted:\n %s\n ' , lines )
132+ # iam 03/06/2021: so otool prior to llvm-otool(1): Apple Inc. version cctools-977.1
133+ # would output 'Contents of (__WLLVM,__llvm_bc) section' as the first line
134+ # of the extraction. This seems to have disappeared so we need to be careful
135+ # here:
136+ if lines and lines [0 ] and lines [0 ].startswith ('Contents' ):
137+ _logger .debug ('dropping header: "%s"' , lines [0 ])
138+ lines = lines [1 :]
132139 try :
133140 octets = []
134- for line in lines [ 1 :] :
135- m = otool_hexdata .match (line . decode () )
141+ for line in lines :
142+ m = otool_hexdata .match (line )
136143 if not m :
137144 _logger .debug ('otool output:\n \t %s\n DID NOT match expectations.' , line )
138145 continue
@@ -142,6 +149,7 @@ def extract_section_darwin(inputFile):
142149 retval = decode_hex ('' .join (octets ))[0 ].splitlines ()
143150 # these have become bytes in the "evolution" of python
144151 retval = [ f .decode ('utf8' ) for f in retval ]
152+ _logger .debug ('decoded:\n %s\n ' , retval )
145153 if not retval :
146154 _logger .error ('%s contained no %s segment' , inputFile , darwinSegmentName )
147155 except Exception as e :
Original file line number Diff line number Diff line change 8585 Eliminated "....".format(...) in favor of f'...{thingy}....' How many times did python try to get this right?
8686 e.g. handle -Wl,--start-group ... -Wl,--end-group properly.
8787 e.g. -W and -w don't trip the compile only flag.
88+ 1.3.0 - 3/6/2021 otool seems to have changed its output format, so we need to tread more carefully.
89+
8890"""
8991
90- wllvm_version = '1.2.9 '
91- wllvm_date = 'February 20 2020 '
92+ wllvm_version = '1.3.0 '
93+ wllvm_date = 'March 6 2021 '
You can’t perform that action at this time.
0 commit comments