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 a7bb3ee
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 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 Expand Up @@ -208,7 +209,7 @@
['target_arch in "ia32 x64" and OS!="ios"', {
'dependencies': [
'zlib_adler32_simd',
'zlib_crc32_simd',
# 'zlib_crc32_simd',
],
'defines': [ 'DEFLATE_SLIDE_HASH_SSE2' ],
'conditions': [
Expand Down

0 comments on commit a7bb3ee

Please sign in to comment.