Skip to contentSkip to conversation

libarchive: fix build error when linking with lzma

PATCH New Sergio Prado 2 participants 2 messages Jul 21, 2016 – Jul 23, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 libarchive: fix build error when linking with lzma

Build fails when linking with liblzma compiled without threads support.

./.libs/libarchive.so: undefined reference to lzma_cputhreads' ./.libs/libarchive.so: undefined reference to lzma_stream_encoder_mt'

So let's enable LZMA only when toolchain has threads support.

Fixes:
http://autobuild.buildroot.org/results/2cb7f8a056982d0b894d0e2531ef357e74c8b796
http://autobuild.buildroot.org/results/d12954fbd460d396f255158fa127f39ff9d2be8d
http://autobuild.buildroot.org/results/abe10c70f38423a212ab27d7d27e22174eaa5aab
Many more...

---
Changes v1 -> v2:
- removing extra comma from evaluation

---
 package/libarchive/libarchive.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/libarchive/libarchive.mk +2 -1
index 6e9c0a1e867b..30a231885a71 100644
@@ -92,7 +92,8 @@ else
 LIBARCHIVE_CONF_OPTS += --without-zlib
 endif
 
-ifeq ($(BR2_PACKAGE_XZ),y)
+# libarchive requires LZMA with thread support in the toolchain
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_PACKAGE_XZ),yy)
 LIBARCHIVE_DEPENDENCIES += xz
 LIBARCHIVE_CONF_OPTS += --with-lzma
 else
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 libarchive: fix build error when linking with lzma

Hello,

Quoted 13 lines · Sergio Prado

Build fails when linking with liblzma compiled without threads support.

./.libs/libarchive.so: undefined reference to lzma_cputhreads' ./.libs/libarchive.so: undefined reference to lzma_stream_encoder_mt'

So let's enable LZMA only when toolchain has threads support.

Fixes:
http://autobuild.buildroot.org/results/2cb7f8a056982d0b894d0e2531ef357e74c8b796
http://autobuild.buildroot.org/results/d12954fbd460d396f255158fa127f39ff9d2be8d
http://autobuild.buildroot.org/results/abe10c70f38423a212ab27d7d27e22174eaa5aab
Many more...

Quoted 8 lines

---
Changes v1 -> v2:
- removing extra comma from evaluation

---
 package/libarchive/libarchive.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com