-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
configure script fails when doing a static build - libraries passed in wrong place #97
Comments
What ./configure arguments are you using to build libsrtp statically? When setting CFLAGS=-static, I see a link error due to -ldl, not -lz. Maybe you've compiled OpenSSL differently. |
Hello jfigus, I don't know if that rellevant. Anyway, could you please have a look to this patch? One of the Buildroot developers wrote it. http://lists.busybox.net/pipermail/buildroot/2015-February/120140.html It uses PKG_CHECK_MODULES instead of AC_CHECK_LIB in order to fix the problem. Is that patch upstreamable? |
PKG_CHECK_MODULES is from pkg-config, not autoconf. We could classify this issue as a feature request to include support for pkg-config. I don't see this as a bug fix. Also, the patch doesn't ensure the appropriate revision level of OpenSSL is on the system. It only checks for the presence of any revision of OpenSSL. If OpenSSL 0.9.8 was on the system, then the libsrtp compiliation would fail. |
Well, that patch was for Buildroot and our openssl version is 1.0.2. Ok, I see your point. Then, here you have the information you requested: ./configure --target=powerpc-buildroot-linux-uclibc --host=powerpc-buildroot-linux-uclibc --build=x86_64-unknown-linux-gnu --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --localstatedir=/var --program-prefix="" --disable-dependency-tracking --enable-static --disable-shared --with-tools=no If you want to see the full build log, is here: http://autobuild.buildroot.net/results/a71/a71d85a5bb9af2ee82a8e61054025bceb03dbdeb/build-end.log |
b5fad5f adds checks for libz and libdl to allow static linking of libcrypto.a. I wasn't able to duplicate the libz issue on my system, but added this anyway since it appears your OpenSSL is likely configured different. By the way, libsrtp doesn't recognize the --enable-static and --disable-shared options. Your build log includes "CFLAGS=-static", which is how you're enabling the static link. |
Hello jfigus, I have tested your patch and I can confirm it fixes the problem. Thank you very much. |
Glad to help. I've used buildroot several times in the past. It's a very useful project. +1 for buildroot. |
Hi jfigus, Thank you for your help. It's the same for libdl. It's not the same toolchain used in this case, this is a Blackfin toolchain which doesn't support shared libraries. I suggest to remove AC_MSG_FAILURE if libdl or zlib is not detected. Thanks. |
OK, I've changed the libz and libdl checks to warnings when not found. |
But keeps complaining that libdl not found. |
When building libsrtp statically it fails at the configure phase when is testing for EVP_EncryptInit in -lcrypto:
checking whether to leverage OpenSSL crypto... yes
checking for EVP_EncryptInit in -lcrypto... no
configure: error: in '/br/output/build/libsrtp-v1.5.0':
configure: error: can't find openssl >1.0.1 crypto lib
See 'config.log' for more details
The real problem can be found in the config.log:
configure:4831: checking whether to leverage OpenSSL crypto
configure:4840: result: yes
configure:4846: checking for EVP_EncryptInit in -lcrypto
configure:4871: /br/output/host/usr/bin/mipsel-ctng-linux-uclibc-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static -I/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -lssl -L/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr//lib -lcrypto -lz conftest.c -lcrypto >&5
/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr//lib/libcrypto.a(c_zlib.o): In function 'zlib_stateful_expand_block':
c_zlib.c:(.text+0x78): undefined reference to 'inflate'
/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr//lib/libcrypto.a(c_zlib.o): In function 'zlib_stateful_compress_block':
c_zlib.c:(.text+0x13c): undefined reference to 'deflate'
[...]
collect2: error: ld returned 1 exit status
There is a missing
-lz
afterconftest.c
. Also, the-lcrypto -lz
beforeconftest.c
are useless. So, a command like this one would fix the problem:/br/output/host/usr/bin/mipsel-ctng-linux-uclibc-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static -I/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -lssl -L/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr//lib conftest.c -lcrypto -lz
The text was updated successfully, but these errors were encountered: