diff options
author | ignat <ignat@yandex-team.com> | 2023-11-30 19:48:51 +0300 |
---|---|---|
committer | ignat <ignat@yandex-team.com> | 2023-11-30 22:21:17 +0300 |
commit | c2f81b1b5ffe34c9a9f5abc5405ddb538856cc43 (patch) | |
tree | ec9e6769e32d1e45c5476838fef01dfc6562fae2 /build | |
parent | f5d4e4495f6741d8df199dc9f888417ab0485010 (diff) | |
download | ydb-c2f81b1b5ffe34c9a9f5abc5405ddb538856cc43.tar.gz |
Fix quoting -passes option value (thanks for @spreis for hint)
Diffstat (limited to 'build')
-rw-r--r-- | build/plugins/llvm_bc.py | 4 | ||||
-rw-r--r-- | build/scripts/llvm_opt_wrapper.py | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/build/plugins/llvm_bc.py b/build/plugins/llvm_bc.py index ddb4bbd84d..b41c106fe2 100644 --- a/build/plugins/llvm_bc.py +++ b/build/plugins/llvm_bc.py @@ -29,7 +29,9 @@ def onllvm_bc(unit, *args): passes += ['internalize'] # XXX: '#' used instead of ',' to overcome ymake tendency to split everything by comma opt_opts += ['-internalize-public-api-list=' + '#'.join(symbols)] - opt_opts += ['-passes={}'.format('${__COMMA__}'.join(passes))] + # Add additional quotes for cmake build. + # Generated final option for cmake looks like: -passes="..." + opt_opts += ['\'-passes="{}"\''.format('${__COMMA__}'.join(passes))] unit.onllvm_opt([merged_bc, out_bc] + opt_opts) if 'GENERATE_MACHINE_CODE' in kwds: unit.onllvm_llc([out_bc, '-O2']) diff --git a/build/scripts/llvm_opt_wrapper.py b/build/scripts/llvm_opt_wrapper.py index 38ca3004af..90bd87f97a 100644 --- a/build/scripts/llvm_opt_wrapper.py +++ b/build/scripts/llvm_opt_wrapper.py @@ -4,9 +4,16 @@ import sys def fix(s): # we use '#' instead of ',' because ymake always splits args by comma - if 'internalize' in s: + if s.startswith('-internalize-public-api-list'): return s.replace('#', ',') + # Dirty hack to eliminate double quotes from value of passes option. + # Note that these double quoted are required by cmake. + if s.startswith('-passes'): + name, value = s.split('=', 1) + value = value.strip('"') + return '='.join([name, value]) + return s |