Skip to content

Commit da7b0cc

Browse files
committed
Added support for some Darwin-specific flags.
1 parent 811d2e5 commit da7b0cc

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

driver/utils.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,20 @@ def __init__(self, inputList, exactMatches={}, patternMatches={}):
189189
'-nodefaultlibs' : (0, ArgumentListFilter.linkUnaryCallback),
190190
# darwin flags
191191
'-dynamiclib' : (0, ArgumentListFilter.linkUnaryCallback),
192-
# need to warn the darwin user that these flags will rain on their parade
193-
# (otool is a bit single minded)
194-
'-fvisibility=hidden' : (0, ArgumentListFilter.darwinWarningCompilerUnaryCallback),
192+
'-current_version' : (1, ArgumentListFilter.linkBinaryCallback),
193+
'-compatibility_version' : (1, ArgumentListFilter.linkBinaryCallback),
194+
195+
# bd: need to warn the darwin user that these flags will rain on their parade
196+
# (the Darwin ld is a bit single minded)
197+
#
198+
# 1) compilation with -fvisibility=hidden causes trouble when we try to
199+
# attach bitcode filenames to an object file. The global symbols in object
200+
# files get turned into local symbols when we invoke 'ld -r'
201+
#
202+
# 2) all stripping commands (e.g., -dead_strip) remove the __LLVM segment after
203+
# linking
204+
#
205+
'-fvisibility=hidden' : (0, ArgumentListFilter.darwinWarningCompileUnaryCallback),
195206
'-Wl,-dead_strip' : (0, ArgumentListFilter.darwinWarningLinkUnaryCallback),
196207

197208
}

0 commit comments

Comments
 (0)