[llvm] f05fbb7 - [gn build] attempt to unbreak linux after fc9696130c8
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Thu May 20 11:56:16 PDT 2021
Author: Nico Weber
Date: 2021-05-20T14:55:40-04:00
New Revision: f05fbb7795a4dcc481c66a41a2c7816921bd7ef4
URL: https://github.com/llvm/llvm-project/commit/f05fbb7795a4dcc481c66a41a2c7816921bd7ef4
DIFF: https://github.com/llvm/llvm-project/commit/f05fbb7795a4dcc481c66a41a2c7816921bd7ef4.diff
LOG: [gn build] attempt to unbreak linux after fc9696130c8
Only emit `global:` if there are any exported symbols.
While here, `chmod +x` the symbol_exports.py script.
Added:
Modified:
llvm/utils/gn/build/symbol_exports.py
Removed:
################################################################################
diff --git a/llvm/utils/gn/build/symbol_exports.py b/llvm/utils/gn/build/symbol_exports.py
old mode 100644
new mode 100755
index 9d9c798db272..442eb818c238
--- a/llvm/utils/gn/build/symbol_exports.py
+++ b/llvm/utils/gn/build/symbol_exports.py
@@ -25,11 +25,12 @@ def main():
symbols = open(args.source).readlines()
if args.format == 'linux':
- output_lines = (['FOO {\n',
- ' global:\n',] +
- [' %s;\n' % s.rstrip() for s in symbols] +
- [' local: *;\n',
- '}\n'])
+ output_lines = ['FOO {\n']
+ if symbols:
+ output_lines += ([' global:\n',] +
+ [' %s;\n' % s.rstrip() for s in symbols])
+ output_lines += [' local: *;\n',
+ '}\n']
elif args.format == 'mac':
output_lines = ['_' + s for s in symbols]
else:
More information about the llvm-commits
mailing list