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

Failure on static build with Makefile (and Makefile-XC failure on any build) #13

Closed
Daryes opened this Issue Apr 14, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@Daryes
Copy link

Daryes commented Apr 14, 2018

Hello,

Env : Ubuntu 16.04.4 x86_64 with additional i386 standard libraries.

I'm trying to build a x86 static build, but the configure command fail on the static part.

I can compile correctly with one of those commands followed by a make

x64 : ./configure
x86 : ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32"

But if I try a static link :
./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static"
(also tried with LDFLAGS="-m32 -ldl -static", same thing)

I'm getting this error :
(warning, it's really the 2.1.0 version used despite confdefs stating it's the 2.0.0 )

configure:3308: checking for style of include used by make
configure:3336: result: GNU
configure:3362: checking dependency style of gcc
configure:3473: result: gcc3
configure:3492: checking for EVP_EncryptInit in -lcrypto
configure:3517: gcc -o conftest -m32  -m32 -ldl -static conftest.c -lcrypto   >&5
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0xa): undefined reference to `dlopen'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x20): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x2a): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
(.text+0x32d): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
(.text+0x3ad): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
(.text+0x42d): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
(.text+0x4ad): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x518): undefined reference to `dlopen'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x575): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x5ae): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
(.text+0x641): undefined reference to `dladdr'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
(.text+0x6a1): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
(.text+0x70b): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
configure:3517: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "pixelserv-tls"
| #define PACKAGE_TARNAME "pixelserv-tls"
| #define PACKAGE_VERSION "2.0.0"
| #define PACKAGE_STRING "pixelserv-tls 2.0.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "pixelserv-tls"
| #define VERSION "2.0.0"
| /* end confdefs.h.  */

When cleaning everything and using the XC makefile, the first binary also fail (dynamic + debug on), be it on x86 or amd64 flavor :

 make -f Makefile-XC x86
 make -f Makefile-XC amd64

Same error than with the static build.
The 2.0.1 version was building fine using the Makefile-XC. I've just tried it again and it worked fine.

For the record :

$ ll openssl/amd64/
total 12
./
../
.gitignore
libcrypto.a -> /usr/lib/x86_64-linux-gnu/libcrypto.a
libssl.a -> /usr/lib/x86_64-linux-gnu/libssl.a

$ ll openssl/i386/
total 12
./
../
.gitignore
libcrypto.a -> /usr/lib/i386-linux-gnu/libcrypto.a
libssl.a -> /usr/lib/i386-linux-gnu/libssl.a

Tried to add a libdl.a symlink into both, same.

@kvic-z

This comment has been minimized.

Copy link
Owner

kvic-z commented Jun 20, 2018

Support for building static binary with Autotools is added in v2.1.2.
Please try ./configure --enable-static=yes

Thanks for reporting, and sorry for my belated response. The issue turned out not as complicated as the errors had led me to believe (and hence my delayed action).

@kvic-z kvic-z closed this Jun 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment