Compile on OpenBSD with static is not working

Issue #306 new
Daniel Ripoll created an issue

Hi,

Trying to compile monit static in OpenBSD no matter if clang, gcc or whatever I use.

CC=clang CXX=clang++ LDFLAGS="-L/usr/lib -B/usr/lib -all-static -static -Wl,-non_shared -static"  CFLAGS="-static" ./configure libmonit_cv_setjmp_available=yes libmonit_cv_vsnprintf_c99_conformant=yes --enable-static --without-pam --without-ssl
....................
/usr/bin/ld: /tmp/conftest-3d2637.o: relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/tmp/conftest-3d2637.o: could not read symbols: Bad value
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)

Any ideas which flags I must use or It will simply fail? Also tried passing -fPIC or -fPIE to LD/CFLAGS but still not workign at all.

Comments (2)

  1. Log in to comment