You are not logged in.

#1 2017-12-01 14:57:17

stuartnelson3
Member
Registered: 2017-12-01
Posts: 2

statically compiling librdkafka fails to find lz4

I'm attempting to statically compile librdkafka. Sometime within the last 2 months this worked successfully, but at some point (I'm sorry I didn't notice when exactly), the compilation now fails:

./configure --disable-sasl --disable-ssl --enable-static
make
// output elided
gcc  -shared -Wl,-soname,librdkafka.so.1 -Wl,--version-script=librdkafka.lds rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_conf.o rdkafka_timer.o rdkafka_offset.o rdkafka_transport.o rdkafka_buf.o rdkafka_queue.o rdkafka_op.o rdkafka_request.o rdkafka_cgrp.o rdkafka_pattern.o rdkafka_partition.o rdkafka_subscription.o rdkafka_assignor.o rdkafka_range_assignor.o rdkafka_roundrobin_assignor.o rdkafka_feature.o rdcrc32.o crc32c.o rdaddr.o rdrand.o rdlist.o tinycthread.o rdlog.o rdstring.o rdkafka_event.o rdkafka_metadata.o rdregex.o rdports.o rdkafka_metadata_cache.o rdavl.o rdkafka_sasl.o rdkafka_sasl_plain.o rdkafka_interceptor.o rdkafka_msgset_writer.o rdkafka_msgset_reader.o rdvarint.o rdbuf.o rdunittest.o snappy.o rdgz.o rdkafka_lz4.o xxhash.o rddl.o rdkafka_plugin.o -o librdkafka.so.1 -Wl,-Bstatic -llz4 -Wl,-Bdynamic -lpthread -lz -lcrypto -lrt -ldl
/usr/bin/ld: cannot find -llz4
collect2: error: ld returned 1 exit status
make[1]: *** [../mklove/Makefile.base:89: librdkafka.so.1] Error 1
make[1]: Leaving directory '/home/stuartnelson/workspace/librdkafka/src'
make: *** [Makefile:20: libs] Error 2

When executing ld on my own it succeeds however:

# ld -llz4; and echo $status
ld: warning: cannot find entry symbol _start; not setting start address
0

Unfortunately, this is as far as my knowledge goes. Since building ceased to work on my machine, I've been using a debian docker container.

Note: compilation is successful without `--enable-static`, which removes `-Bstatic -llz4 -Wl` from the libs

Any ideas?

Offline

#2 2017-12-01 14:59:04

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,559

Re: statically compiling librdkafka fails to find lz4

Where are you expecting to get the lz4 static lib to build with?

Online

#3 2017-12-01 15:31:50

stuartnelson3
Member
Registered: 2017-12-01
Posts: 2

Re: statically compiling librdkafka fails to find lz4

I (perhaps wrongly) assumed that since it previously compiled correctly, it would still be available on my system as a static lib, in the location provided by `ld`.

Offline

Board footer

Powered by FluxBB