kobolabs / liblzma

Other
45 stars 21 forks source link

Building liblzma on Ubuntu 16.04.7 fails #4

Open elcombs opened 7 months ago

elcombs commented 7 months ago

Operating system: 64-bit Ubuntu 16.04.7 LTS

Compiler: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609

Steps to reproduce the behavior: Download xz-5.6.0.tar.gz or xz-5.6.1.tar.gz and build it using these commands,

./configure --disable-shared make

I get these errors,

/bin/bash ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/liblzma/api -I../../src/liblzma/common -I../../src/liblzma/check -I../../src/liblzma/lz -I../../src/liblzma/rangecoder -I../../src/liblzma/lzma -I../../src/liblzma/delta -I../../src/liblzma/simple -I../../src/common -DTUKLIB_SYMBOL_PREFIX=lzma_ -pthread -fvisibility=hidden -Wall -Wextra -Wvla -Wformat=2 -Winit-self -Wmissing-include-dirs -Wstrict-overflow=3 -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wdate-time -Wsign-conversion -Wfloat-conversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -g -O2 -MT liblzma_la-lzma_decoder.lo -MD -MP -MF .deps/liblzma_la-lzma_decoder.Tpo -c -o liblzma_la-lzma_decoder.lotest -f 'lzma/lzma_decoder.c' || echo './'lzma/lzma_decoder.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/liblzma/api -I../../src/liblzma/common -I../../src/liblzma/check -I../../src/liblzma/lz -I../../src/liblzma/rangecoder -I../../src/liblzma/lzma -I../../src/liblzma/delta -I../../src/liblzma/simple -I../../src/common -DTUKLIB_SYMBOL_PREFIX=lzma_ -pthread -fvisibility=hidden -Wall -Wextra -Wvla -Wformat=2 -Winit-self -Wmissing-include-dirs -Wstrict-overflow=3 -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wdate-time -Wsign-conversion -Wfloat-conversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -g -O2 -MT liblzma_la-lzma_decoder.lo -MD -MP -MF .deps/liblzma_la-lzma_decoder.Tpo -c lzma/lzma_decoder.c -o liblzma_la-lzma_decoder.o lzma/lzma_decoder.c: Assembler messages: lzma/lzma_decoder.c:371: Error: no such instruction:movzw 2(%r15),%esi' lzma/lzma_decoder.c:373: Error: no such instruction: movzw 4(%r15),%edi' lzma/lzma_decoder.c:388: Error: no such instruction:movzw 6(%r15),%edx' lzma/lzma_decoder.c:398: Error: no such instruction: movzw (%r15,%r14,4),%esi' lzma/lzma_decoder.c:413: Error: no such instruction:movzw 2(%r15,%r14,4),%edx' lzma/lzma_decoder.c:424: Error: no such instruction: movzw (%r15,%r14,4),%edi' lzma/lzma_decoder.c:439: Error: no such instruction:movzw 2(%r15,%r14,4),%edx' lzma/lzma_decoder.c:450: Error: no such instruction: movzw (%r15,%r14,4),%esi' lzma/lzma_decoder.c:465: Error: no such instruction:movzw 2(%r15,%r14,4),%edx' lzma/lzma_decoder.c:476: Error: no such instruction: movzw (%r15,%r14,4),%edi'

There were many more no such instruction messages. I just felt it was not necessary to add this all to this issue report.

I also tried to configure using this command,

./configure --disable-shared --disable-assembler

but make produced the same errors.

Thanks.

cbeuw commented 7 months ago

The error was due to the backdoor in the lzma version you tried to build: https://www.openwall.com/lists/oss-security/2024/03/29/4 😬

biergaizi commented 2 months ago

No, I don't think it's related to the backdoor, since the problem still exists on xz 5.6.2. It's likely "just" a compatibility problem with very old binutils and GCC versions.

biergaizi commented 2 months ago

I have root-caused the problem and confirmed that it's an upstream bug due to incompatibility with old binutils assembler on legacy systems. It has nothing to do with the backdoor. For more information (including a workaround real patch), see: https://github.com/tukaani-project/xz/issues/121 CC @cbeuw