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):
127
127
_logger .error ('otool failed on %s' , inputFile )
128
128
sys .exit (- 1 )
129
129
130
- lines = otoolOutput .splitlines ()
130
+ lines = otoolOutput .decode ( 'utf8' ). splitlines ()
131
131
_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 :]
132
139
try :
133
140
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 )
136
143
if not m :
137
144
_logger .debug ('otool output:\n \t %s\n DID NOT match expectations.' , line )
138
145
continue
@@ -142,6 +149,7 @@ def extract_section_darwin(inputFile):
142
149
retval = decode_hex ('' .join (octets ))[0 ].splitlines ()
143
150
# these have become bytes in the "evolution" of python
144
151
retval = [ f .decode ('utf8' ) for f in retval ]
152
+ _logger .debug ('decoded:\n %s\n ' , retval )
145
153
if not retval :
146
154
_logger .error ('%s contained no %s segment' , inputFile , darwinSegmentName )
147
155
except Exception as e :
Original file line number Diff line number Diff line change 85
85
Eliminated "....".format(...) in favor of f'...{thingy}....' How many times did python try to get this right?
86
86
e.g. handle -Wl,--start-group ... -Wl,--end-group properly.
87
87
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
+
88
90
"""
89
91
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