Skip to content

Commit

Permalink
zlib: disable CRC32 SIMD optimization
Browse files Browse the repository at this point in the history
It seems that the optimization causes memory corruption. Disable it until the
issue is fixed upstream.

Fixes: nodejs#45268
  • Loading branch information
lpinca committed Sep 6, 2023
1 parent fdc65d9 commit 9b92376
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions deps/zlib/zlib.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -107,33 +107,34 @@
}],
],
}, # zlib_arm_crc32
{
'target_name': 'zlib_crc32_simd',
'type': 'static_library',
'conditions': [
['OS!="win" or llvm_version!="0.0"', {
'cflags': [
'-msse4.2',
'-mpclmul',
],
'xcode_settings': {
'OTHER_CFLAGS': [
'-msse4.2',
'-mpclmul',
],
},
}]
],
'defines': [ 'CRC32_SIMD_SSE42_PCLMUL' ],
'include_dirs': [ '<(ZLIB_ROOT)' ],
'direct_dependent_settings': {
'defines': [ 'CRC32_SIMD_SSE42_PCLMUL' ],
'include_dirs': [ '<(ZLIB_ROOT)' ],
},
'sources': [
'<!@pymod_do_main(GN-scraper "<(ZLIB_ROOT)/BUILD.gn" "\\"zlib_crc32_simd\\".*?sources = ")',
],
}, # zlib_crc32_simd
# Disabled due to memory corruption. See https://github.com/nodejs/node/issues/45268.
# {
# 'target_name': 'zlib_crc32_simd',
# 'type': 'static_library',
# 'conditions': [
# ['OS!="win" or llvm_version!="0.0"', {
# 'cflags': [
# '-msse4.2',
# '-mpclmul',
# ],
# 'xcode_settings': {
# 'OTHER_CFLAGS': [
# '-msse4.2',
# '-mpclmul',
# ],
# },
# }]
# ],
# 'defines': [ 'CRC32_SIMD_SSE42_PCLMUL' ],
# 'include_dirs': [ '<(ZLIB_ROOT)' ],
# 'direct_dependent_settings': {
# 'defines': [ 'CRC32_SIMD_SSE42_PCLMUL' ],
# 'include_dirs': [ '<(ZLIB_ROOT)' ],
# },
# 'sources': [
# '<!@pymod_do_main(GN-scraper "<(ZLIB_ROOT)/BUILD.gn" "\\"zlib_crc32_simd\\".*?sources = ")',
# ],
# }, # zlib_crc32_simd
{
'target_name': 'zlib_inflate_chunk_simd',
'type': 'static_library',
Expand Down

0 comments on commit 9b92376

Please sign in to comment.