Skip to content

Commit a7bb3ee

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 a7bb3ee

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed

deps/zlib/zlib.gyp

+29-28
Original file line numberDiff line numberDiff line change
@@ -107,33 +107,34 @@
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+
# Disabled due to memory corruption. See https://github.com/nodejs/node/issues/45268.
111+
# {
112+
# 'target_name': 'zlib_crc32_simd',
113+
# 'type': 'static_library',
114+
# 'conditions': [
115+
# ['OS!="win" or llvm_version!="0.0"', {
116+
# 'cflags': [
117+
# '-msse4.2',
118+
# '-mpclmul',
119+
# ],
120+
# 'xcode_settings': {
121+
# 'OTHER_CFLAGS': [
122+
# '-msse4.2',
123+
# '-mpclmul',
124+
# ],
125+
# },
126+
# }]
127+
# ],
128+
# 'defines': [ 'CRC32_SIMD_SSE42_PCLMUL' ],
129+
# 'include_dirs': [ '<(ZLIB_ROOT)' ],
130+
# 'direct_dependent_settings': {
131+
# 'defines': [ 'CRC32_SIMD_SSE42_PCLMUL' ],
132+
# 'include_dirs': [ '<(ZLIB_ROOT)' ],
133+
# },
134+
# 'sources': [
135+
# '<!@pymod_do_main(GN-scraper "<(ZLIB_ROOT)/BUILD.gn" "\\"zlib_crc32_simd\\".*?sources = ")',
136+
# ],
137+
# }, # zlib_crc32_simd
137138
{
138139
'target_name': 'zlib_inflate_chunk_simd',
139140
'type': 'static_library',
@@ -208,7 +209,7 @@
208209
['target_arch in "ia32 x64" and OS!="ios"', {
209210
'dependencies': [
210211
'zlib_adler32_simd',
211-
'zlib_crc32_simd',
212+
# 'zlib_crc32_simd',
212213
],
213214
'defines': [ 'DEFLATE_SLIDE_HASH_SSE2' ],
214215
'conditions': [

0 commit comments

Comments
 (0)