summaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-05-23 11:53:46 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-05-23 11:53:46 -0700
commitdf4afcdf000553b76574594465fa4013deff7aad (patch)
tree4e04fb52db3f50efabc9740ccf5e6e196fc0e519 /emcc
parentba02f957f79391d205348695c932e4f99e5adc32 (diff)
parentca5246e4131edb367f204538835801ee0eab79dc (diff)
Merge pull request #2381 from rsturgell/whitelist_link_flags
Whitelist supported link flags
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc8
1 files changed, 7 insertions, 1 deletions
diff --git a/emcc b/emcc
index 1a645965..a4bba2dd 100755
--- a/emcc
+++ b/emcc
@@ -64,6 +64,7 @@ DYNAMICLIB_ENDINGS = ('.dylib', '.so', '.dll')
STATICLIB_ENDINGS = ('.a',)
ASSEMBLY_ENDINGS = ('.ll',)
HEADER_ENDINGS = ('.h', '.hxx', '.hpp', '.hh', '.H', '.HXX', '.HPP', '.HH')
+SUPPORTED_LINKER_FLAGS = ('--start-group', '-(', '--end-group', '-)')
LIB_PREFIXES = ('', 'lib')
@@ -1177,7 +1178,12 @@ try:
# (4, a), (4.25, b), (4.5, c), (4.75, d)
link_flags_to_add = arg.split(',')[1:]
for flag_index, flag in enumerate(link_flags_to_add):
- link_flags.append((i + float(flag_index) / len(link_flags_to_add), flag))
+ # Only keep flags that shared.Building.link knows how to deal with.
+ # We currently can't handle flags with options (like
+ # -Wl,-rpath,/bin:/lib, where /bin:/lib is an option for the -rpath
+ # flag).
+ if flag in SUPPORTED_LINKER_FLAGS:
+ link_flags.append((i + float(flag_index) / len(link_flags_to_add), flag))
newargs[i] = ''
original_input_files = input_files[:]