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
PR-URL: #49511
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
  • Loading branch information
lpinca authored and ruyadorno committed Sep 28, 2023
1 parent ced25a9 commit c23c60f
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 c23c60f

Please sign in to comment.