Skip to content

Commit 550a760

Browse files
committed
zlib: disable CRC32 SIMD optimization
It seems that the optimization causes memory corruption. Disable it until the issue is fixed upstream. Fixes: nodejs#45268
1 parent fdc65d9 commit 550a760

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

deps/zlib/zlib.gyp

+30-28
Original file line numberDiff line numberDiff line change
@@ -107,33 +107,33 @@
107107
}],
108108
],
109109
}, # zlib_arm_crc32
110-
{
111-
'target_name': 'zlib_crc32_simd',
112-
'type': 'static_library',
113-
'conditions': [
114-
['OS!="win" or llvm_version!="0.0"', {
115-
'cflags': [
116-
'-msse4.2',
117-
'-mpclmul',
118-
],
119-
'xcode_settings': {
120-
'OTHER_CFLAGS': [
121-
'-msse4.2',
122-
'-mpclmul',
123-
],
124-
},
125-
}]
126-
],
127-
'defines': [ 'CRC32_SIMD_SSE42_PCLMUL' ],
128-
'include_dirs': [ '<(ZLIB_ROOT)' ],
129-
'direct_dependent_settings': {
130-
'defines': [ 'CRC32_SIMD_SSE42_PCLMUL' ],
131-
'include_dirs': [ '<(ZLIB_ROOT)' ],
132-
},
133-
'sources': [
134-
'<!@pymod_do_main(GN-scraper "<(ZLIB_ROOT)/BUILD.gn" "\\"zlib_crc32_simd\\".*?sources = ")',
135-
],
136-
}, # zlib_crc32_simd
110+
# {
111+
# 'target_name': 'zlib_crc32_simd',
112+
# 'type': 'static_library',
113+
# 'conditions': [
114+
# ['OS!="win" or llvm_version!="0.0"', {
115+
# 'cflags': [
116+
# '-msse4.2',
117+
# '-mpclmul',
118+
# ],
119+
# 'xcode_settings': {
120+
# 'OTHER_CFLAGS': [
121+
# '-msse4.2',
122+
# '-mpclmul',
123+
# ],
124+
# },
125+
# }]
126+
# ],
127+
# 'defines': [ 'CRC32_SIMD_SSE42_PCLMUL' ],
128+
# 'include_dirs': [ '<(ZLIB_ROOT)' ],
129+
# 'direct_dependent_settings': {
130+
# 'defines': [ 'CRC32_SIMD_SSE42_PCLMUL' ],
131+
# 'include_dirs': [ '<(ZLIB_ROOT)' ],
132+
# },
133+
# 'sources': [
134+
# '<!@pymod_do_main(GN-scraper "<(ZLIB_ROOT)/BUILD.gn" "\\"zlib_crc32_simd\\".*?sources = ")',
135+
# ],
136+
# }, # zlib_crc32_simd
137137
{
138138
'target_name': 'zlib_inflate_chunk_simd',
139139
'type': 'static_library',
@@ -208,7 +208,9 @@
208208
['target_arch in "ia32 x64" and OS!="ios"', {
209209
'dependencies': [
210210
'zlib_adler32_simd',
211-
'zlib_crc32_simd',
211+
# Disabled due to memory corruption.
212+
# See https://github.com/nodejs/node/issues/45268.
213+
# 'zlib_crc32_simd',
212214
],
213215
'defines': [ 'DEFLATE_SLIDE_HASH_SSE2' ],
214216
'conditions': [

0 commit comments

Comments
 (0)