Page 1 of 1

Build error on OpenBSD

Posted: Fri Nov 04, 2016 4:02 am
by mksmr
Nagios 4.2.2
OpenBSD 6.0
amd64 (vm on vSphere)
preinstalled Naios 4.0.8 from packages, to be superseded by 4.2.2

Good morning all, I am getting the following error message when building 4.2.2.

Configuring works out right:

Code: Select all

# ./configure --with-command-group=_nagios --with-command-user=_nagios --with-nagios-user=_nagios --with-nagios-group=_nagios

*** Configuration summary for nagios 4.2.2 10-24-2016 ***:

 General Options:
 -------------------------
        Nagios executable:  nagios
        Nagios user/group:  _nagios,_nagios
       Command user/group:  _nagios,_nagios
             Event Broker:  yes
        Install ${prefix}:  /usr/local/nagios
    Install ${includedir}:  /usr/local/nagios/include/nagios
                Lock file:  ${prefix}/var/nagios.lock
   Check result directory:  ${prefix}/var/spool/checkresults
           Init directory:  /etc/rc.d
  Apache conf.d directory:  /etc/httpd/conf.d
             Mail program:  /usr/bin/mail
                  Host OS:  openbsd6.0
          IOBroker Method:  poll

 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/nagios/
                  CGI URL:  http://localhost/nagios/cgi-bin/
 Traceroute (used by WAP):  /usr/sbin/traceroute


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the main program and CGIs.

Code: Select all

# make all
cd ./base && make
make -C ../lib
Using $< in a non-suffix rule context is a GNUmake idiom (Makefile:157)
*** Error 2 in /root/nagios-4.2.2 (Makefile:73 'all')
Can anybody help here?

TIA
Matthias

Re: Build error on OpenBSD

Posted: Fri Nov 04, 2016 9:35 am
by jfrickson
Try using gmake instead of make and see if that helps.

Re: Build error on OpenBSD

Posted: Mon Nov 07, 2016 3:16 am
by mksmr
jfrickson wrote:Try using gmake instead of make and see if that helps.
gmake all ended with

Code: Select all

gmake[1]: Entering directory '/root/nagios-4.2.2/module'
gcc -I..  -g -O2 -DHAVE_CONFIG_H -o helloworld.o helloworld.c -shared
/usr/bin/ld: /tmp//ccZ4SCsv.o: relocation R_X86_64_PC32 against `helloworld_h      le_data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
gmake[1]: *** [Makefile:30: helloworld.o] Error 1
gmake[1]: Leaving directory '/root/nagios-4.2.2/module'
gmake: *** [Makefile:76: all] Error 2

Re: Build error on OpenBSD

Posted: Mon Nov 07, 2016 9:59 am
by jfrickson
mksmr wrote:gmake all ended with

Code: Select all

gmake[1]: Entering directory '/root/nagios-4.2.2/module'
gcc -I..  -g -O2 -DHAVE_CONFIG_H -o helloworld.o helloworld.c -shared
/usr/bin/ld: /tmp//ccZ4SCsv.o: relocation R_X86_64_PC32 against `helloworld_h      le_data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
gmake[1]: *** [Makefile:30: helloworld.o] Error 1
gmake[1]: Leaving directory '/root/nagios-4.2.2/module'
gmake: *** [Makefile:76: all] Error 2
That's the same problem I just fixed for Solaris.

You can either comment out these lines at line 166 in Makefile:

Code: Select all

#modules:
#    cd $(SRC_MODULE) && $(MAKE)
or download the maint branch (https://github.com/NagiosEnterprises/na ... int.tar.gz) which I just now updated.

Re: Build error on OpenBSD

Posted: Tue Nov 08, 2016 5:06 am
by mksmr
jfrickson wrote: You can either comment out these lines at line 166 in Makefile:
gmake ended with the above error
jfrickson wrote: or download the maint branch (https://github.com/NagiosEnterprises/na ... int.tar.gz) which I just now updated.
This one was able to build.

Edit: 4.2.2 is running.

Re: Build error on OpenBSD

Posted: Tue Nov 08, 2016 11:06 am
by avandemore
It sounds like you issue is resolved. Can we lock this thread?

Re: Build error on OpenBSD

Posted: Wed Nov 09, 2016 5:33 am
by mksmr
I think we can. I hope that OpenBSD 6.1 will come with a non-buggy version of Nagios. Thank you very much for your assistance.
Matthias

Re: Build error on OpenBSD

Posted: Wed Nov 09, 2016 10:10 am
by avandemore
FYI, it's not really OpenBSD you should be waiting on, it's the Nagios port maintainer. I don't know how to find that on OpenBSD but the information is there somewhere. If the Nagios port isn't corrected, it will be buggy on every version of OpenBSD.