Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: export zlib symbols on Windows #7983

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,14 @@
'-Wl,--no-whole-archive',
],
}],
# openssl.def is based on zlib.def, zlib symbols
# are always exported.
['use_openssl_def==1', {
'sources': ['<(SHARED_INTERMEDIATE_DIR)/openssl.def'],
}],
['OS=="win" and use_openssl_def==0', {
'sources': ['deps/zlib/win32/zlib.def'],
}],
],
}],
],
Expand Down Expand Up @@ -568,6 +573,8 @@
'-X^DSO',
'-X^_',
'-X^private_',
# Base generated DEF on zlib.def
'-Bdeps/zlib/win32/zlib.def'
],
},
'conditions': [
Expand Down
9 changes: 9 additions & 0 deletions tools/mkssldef.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
categories = []
defines = []
excludes = []
bases = []

if __name__ == '__main__':
out = sys.stdout
Expand All @@ -18,6 +19,7 @@
elif option.startswith('-C'): categories += option[2:].split(',')
elif option.startswith('-D'): defines += option[2:].split(',')
elif option.startswith('-X'): excludes += option[2:].split(',')
elif option.startswith('-B'): bases += option[2:].split(',')

excludes = map(re.compile, excludes)
exported = []
Expand All @@ -40,5 +42,12 @@ def test(expr):
if not satisfy(meta[3], categories): continue
exported.append(name)

for filename in bases:
for line in open(filename).readlines():
line = line.strip()
if line == 'EXPORTS': continue
if line[0] == ';': continue
exported.append(line)

print('EXPORTS', file=out)
for name in sorted(exported): print(' ', name, file=out)