I'm trying to build on Mac OS X 10.9.5 with gcc 4.8.5 and get the following failure:
$ make
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o common/debug.o common/debug.c
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o common/entropy_common.o common/entropy_common.c
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o common/error_private.o common/error_private.c
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o common/fse_decompress.o common/fse_decompress.c
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o common/pool.o common/pool.c
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o common/threading.o common/threading.c
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o common/xxhash.o common/xxhash.c
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o common/zstd_common.o common/zstd_common.c
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o compress/fse_compress.o compress/fse_compress.c
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o compress/hist.o compress/hist.c
cc -O3 -I. -I./common -DXXH_NAMESPACE=ZSTD_ -I./legacy -DZSTD_LEGACY_SUPPORT=4 -c -o compress/huf_compress.o compress/huf_compress.c
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:410:no such instruction: `shlx %r10, %r9,%r10'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:418:no such instruction: `shlx %r9, %rax,%rax'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:431:no such instruction: `shrx %r9, %rax,%r9'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:454:no such instruction: `shlx %rcx, %r14,%rcx'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:455:no such instruction: `shlx %rax, %r15,%rax'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:459:no such instruction: `shlx %rbx, %rcx,%rbx'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:462:no such instruction: `shlx %r10, %rcx,%rcx'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:478:no such instruction: `shrx %r9, %rax,%r9'
/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T//cctJVuMJ.s:484:no such instruction: `shlx %rax, %rdx,%rax'
make[1]: *** [compress/huf_compress.o] Error 1
make: *** [lib-release] Error 2
The file compress/huf_compress.o is not produced. Any ideas what is causing this problem?
I have an older gcc-4.2 on my system, and using that as my compiler, make completed successfully, so this isn't a blocker, but I wanted to raise the problem in case it's easy to fix.
I suspect your compiler doesn't completely support BMI2 instruction set,
which is strange because gcc 4.8 is supposed to support it.
gcc 4.8.x works well on Linux.
According to traces, the compilation stage itself generates the instruction correctly, but it seems the later assembly stage doesn't know this instruction.
gcc 4.2 does not support BMI2, so it's disabled for this target, hence no shlx instruction is generated.
You could try to do the same with gcc 4.8 by disabling BMI2, through build macro DYNAMIC_BMI2 (-DDYNAMIC_BMI2=0).
Alternatively, you will likely generate more efficient binaries by updating your version of gcc, typically through homebrew. brew install gcc currently delivers gcc 8.2.
Most helpful comment
I suspect your compiler doesn't completely support
BMI2instruction set,which is strange because
gcc4.8 is supposed to support it.gcc4.8.x works well on Linux.According to traces, the compilation stage itself generates the instruction correctly, but it seems the later assembly stage doesn't know this instruction.
gcc4.2 does not support BMI2, so it's disabled for this target, hence noshlxinstruction is generated.You could try to do the same with
gcc4.8 by disablingBMI2, through build macroDYNAMIC_BMI2(-DDYNAMIC_BMI2=0).Alternatively, you will likely generate more efficient binaries by updating your version of
gcc, typically through homebrew.brew install gcccurrently deliversgcc8.2.