nodejs / nodejs/node

zlib change broke x86 builds

Open
#33,019 10 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build zlib
Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

Description

I know we don't officially support x86 anymore but we do publish unofficial-builds x86 and the Snap package has x86 support too. But I've just noticed they haven't been building, I suppose since zlib was switched out:

  cc -o /build/node/parts/node/build/out/Release/obj.target/zlib/deps/zlib/contrib/optimizations/inflate.o ../deps/zlib/contrib/optimizations/inflate.c '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DHAVE_HIDDEN' '-DADLER32_SIMD_SSSE3' '-DINFLATE_CHUNK_SIMD_SSE2' '-DCRC32_SIMD_SSE42_PCLMUL' -I../deps/zlib  -pthread -Wall -Wextra -Wno-unused-parameter -m32 -O3 -fno-omit-frame-pointer  -MMD -MF /build/node/parts/node/build/out/Release/.deps//build/node/parts/node/build/out/Release/obj.target/zlib/deps/zlib/contrib/optimizations/inflate.o.d.raw   -c
In file included from ../deps/zlib/contrib/optimizations/inffast_chunk.c:10:0:
../deps/zlib/contrib/optimizations/chunkcopy.h: In function ‘loadchunk’:
../deps/zlib/contrib/optimizations/chunkcopy.h:52:5: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
     const unsigned char FAR* s) {
     ^
In file included from ../deps/zlib/contrib/optimizations/inflate.c:87:0:
../deps/zlib/contrib/optimizations/chunkcopy.h: In function ‘loadchunk’:
../deps/zlib/contrib/optimizations/chunkcopy.h:52:5: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
     const unsigned char FAR* s) {
     ^
In file included from ../deps/zlib/contrib/optimizations/chunkcopy.h:32:0,
                 from ../deps/zlib/contrib/optimizations/inffast_chunk.c:10:
../deps/zlib/contrib/optimizations/chunkcopy.h: In function ‘v_load64_dup’:
/usr/lib/gcc/i686-linux-gnu/5/include/emmintrin.h:625:1: error: inlining failed in call to always_inline ‘_mm_set1_epi64x’: target specific option mismatch
 _mm_set1_epi64x (long long __A)
 ^
In file included from ../deps/zlib/contrib/optimizations/inffast_chunk.c:10:0:
../deps/zlib/contrib/optimizations/chunkcopy.h:215:10: error: called from here
   return _mm_set1_epi64x(i64);
          ^
make[1]: *** [/build/node/parts/node/build/out/Release/obj.target/zlib/deps/zlib/contrib/optimizations/inffast_chunk.o] Error 1
make[1]: *** Waiting for unfinished jobs....
deps/zlib/zlib.target.mk:109: recipe for target '/build/node/parts/node/build/out/Release/obj.target/zlib/deps/zlib/contrib/optimizations/inffast_chunk.o' failed
In file included from ../deps/zlib/contrib/optimizations/chunkcopy.h:32:0,
                 from ../deps/zlib/contrib/optimizations/inflate.c:87:
../deps/zlib/contrib/optimizations/chunkcopy.h: In function ‘v_load64_dup’:
/usr/lib/gcc/i686-linux-gnu/5/include/emmintrin.h:625:1: error: inlining failed in call to always_inline ‘_mm_set1_epi64x’: target specific option mismatch
 _mm_set1_epi64x (long long __A)
 ^
In file included from ../deps/zlib/contrib/optimizations/inflate.c:87:0:
../deps/zlib/contrib/optimizations/chunkcopy.h:215:10: error: called from here
   return _mm_set1_epi64x(i64);
          ^
make[1]: *** [/build/node/parts/node/build/out/Release/obj.target/zlib/deps/zlib/contrib/optimizations/inflate.o] Error 1
deps/zlib/zlib.target.mk:109: recipe for target '/build/node/parts/node/build/out/Release/obj.target/zlib/deps/zlib/contrib/optimizations/inflate.o' failed
rm 73eb81ec782978e9e5a9028cb1d0640d4778b4fe.intermediate
make: *** [node] Error 2
Makefile:101: recipe for target 'node' failed

I suspect there might be a not-too-difficult fix to restore support here, maybe bypassing an optimisation that was added? We still have x86 users so I'm sure a fix will be appreciated if we can come up with one.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the x86 build and start with deps/zlib/contrib/optimizations/chunkcopy.h, then inspect how deps/zlib/zlib.target.mk enables the reported SIMD options for inflate.c and inffast_chunk.c. Check the relevant build entry points in Makefile; done means the x86 unofficial or Snap build completes without the target-specific option errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.