/ xcconfig / libtool-wrap.py
libtool-wrap.py
 1  #!/usr/bin/env python
 2  
 3  '''
 4  xcodebuild seems to pass OTHER_LDFLAGS to both ld and libtool, but libtool
 5  understands a small subset. This strips out arguments that libtool will choke
 6  on.
 7  '''
 8  
 9  import sys, os
10  
11  def strip(args, flag):
12    try:
13      args.remove(flag)
14    except ValueError:
15      pass
16  
17  args = [ 'xcrun', 'libtool' ] + sys.argv[1:]
18  
19  strip(args, '-fsanitize=address')
20  strip(args, '-Wl,-exported_symbol,___asan_mapping_offset')
21  strip(args, '-Wl,-exported_symbol,___asan_mapping_scale')
22  
23  os.execv('/usr/bin/xcrun', args)