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: #45268
  • Loading branch information
lpinca committed Sep 6, 2023
1 parent fdc65d9 commit 550a760
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions deps/zlib/zlib.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -107,33 +107,33 @@
}],
],
}, # 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
# {
# '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 +208,9 @@
['target_arch in "ia32 x64" and OS!="ios"', {
'dependencies': [
'zlib_adler32_simd',
'zlib_crc32_simd',
# Disabled due to memory corruption.
# See https://github.com/nodejs/node/issues/45268.
# 'zlib_crc32_simd',
],
'defines': [ 'DEFLATE_SLIDE_HASH_SSE2' ],
'conditions': [
Expand Down

0 comments on commit 550a760

Please sign in to comment.