LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Make Errors (https://www.linuxquestions.org/questions/linux-software-2/make-errors-555818/)

keysorsoze 05-22-2007 11:04 AM

Make Errors
 
Hi! I am trying to compile some plugins for nagios, however I am getting the following errors. My last suggestion was to remove glibc and reinstall this did not work and broke my system. I have posted this on a nagios forum and no one seems to know the answer. Is this related to the plugins themselves or my system?

Thanks

Here are the compile errors.


/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x4e): In function `dlfcn_load ':
: undefined reference to `dlopen'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0xbb): In function `dlfcn_load ':
: undefined reference to `dlclose'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0xf4): In function `dlfcn_load ':
: undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x16d): In function `dlfcn_unl oad':
: undefined reference to `dlclose'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x22c): In function `dlfcn_bin d_var':
: undefined reference to `dlsym'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x2a8): In function `dlfcn_bin d_var':
: undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x324): In function `dlfcn_bin d_func':
: undefined reference to `dlsym'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x37c): In function `dlfcn_bin d_func':
: undefined reference to `dlerror'
collect2: ld returned 1 exit status
make[1]: *** [check_http] Error 1
make[1]: Leaving directory `/home/admin.dk/nagios_2.9_install/nagios-plugins-1.4 .8/plugins'
make: *** [check-recursive] Error 1

raskin 05-22-2007 11:53 AM

Looks like broken libcrypto version. Try forcing 'make' to include ' -ldl ' into the linking command line. Try 'make LDFLAGS+=-ldl ' or even configuring and rebuilding from scratch after setting 'export CFLAGS=-ldl'.

keysorsoze 05-22-2007 12:15 PM

raskin,

Thanks for the reply. I tried a make LDFLAGS+=-ldl and it did the trick. Can you explain if possible what this does and will effect me in the long run. Can forcing this make become a problem in the future?

raskin 05-22-2007 12:34 PM

It seems your libcrypto references functions for work with dynamic libraries, but either thinks these functions should be found in libc or at all doesn't specify its library dependencies and nagios build system fails to guess them. Forcing make to include -ldl in gcc options while linking tells the linker (program that mainly converts function calls specified by name to offset jumps and also sanitizes library calls made by name) that the program should require libdl.so and can rely on having functions in libdl.so implemented. That prevents linker from failing to understand how are dlopen/dlsym/dlerror/dlclose calls in used libcrypto.a supposed to work.

In future you will probably run into similar issues (you can hopefully resolve them in the same way) with next package you will build that uses libcrypto. I do not think there will be any issues related to this with any binary software, either that you managed to compile or you download (if it is library-compatible with you system). If you upgrade libcrypto, it will either has the issue fixed or not, neither of the options is likely to break your system (though unrelated issues can).

keysorsoze 05-22-2007 03:02 PM

Thanks raskin, your help did the trick and thanks for the answer.

darleys 08-01-2008 12:47 AM

The same bug, in make
 
I have the same bug when I tried to build asterisk 1.4,
Quote:

/usr/src/asterisk/main/editline/readline.c:1294: warning: Using 'setpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/src/asterisk/main/editline/readline.c:1300: warning: Using 'endpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
utils.o: In function `ast_gethostbyname':
/usr/src/asterisk/main/utils.c:223: warning: Using 'gethostbyname_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
manager.o: In function `accept_thread':
/usr/src/asterisk/main/manager.c:2406: warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
(.text+0x2d6): undefined reference to `dlsym'
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
(.text+0x446): undefined reference to `dlsym'
collect2: ld returned 1 exit status
make[1]: *** [asterisk] Error 1
make: *** [main] Error 2
I used make LDFLAGS+=-ldl but its not of any use, Raskin can u please help me out

raskin 08-01-2008 01:01 AM

Try building a static libdl.a or a shared libcrypto.so ...

darleys 08-01-2008 01:11 AM

Can u tell me how to do that
 
Can u tell me how to doa static build on libdl.a or shared libcrypto.so
and can u please explain me what exactly is the issue, I'm bit confused

raskin 08-01-2008 01:37 AM

You get such versions but recompiling the package in question with --enable-shared/--enable-static (or --with-shared/--with-static , depending on package).

Maybe you should just reconfigure asterisk with "LD_FLAGS=-ldl ./configure" instead of passing that to make..

Or manually add it to the command line in Makefile.

darleys 08-01-2008 02:35 AM

I tried but didnt work
 
I tried LD_FLAGS=-ldl ./configure
but it failed again when I did the make

darleys 08-03-2008 10:08 PM

Still no fix
 
Raskin , I tried it , but still no fix... Do I need to compile glibc to resolve that issue?, I presume that glibc is already there in my ubuntu server 8.04, because I did an apt---- update/upgrade. I don't know how to check whether its there...


All times are GMT -5. The time now is 04:38 PM.