Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Mar 2014 08:19:18 GMT
From:      "O. Hartmann" <ohartman@zedat.fu-berlin.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/188041: net-mgmt/nrpe: ./nrpe.c:(.text+0x62d): undefined reference to `get_dh512'
Message-ID:  <201403290819.s2T8JImQ053055@cgiserv.freebsd.org>
Resent-Message-ID: <201403290820.s2T8K15n049783@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         188041
>Category:       ports
>Synopsis:       net-mgmt/nrpe: ./nrpe.c:(.text+0x62d): undefined reference to `get_dh512'
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 29 08:20:01 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     O. Hartmann
>Release:        FreeBSD 11.0-CURRENT
>Organization:
>Environment:
FreeBSD 11.0-CURRENT #0 r263881: Fri Mar 28 20:00:34 CET 2014 amd64
>Description:
Compiling or updating the port  net-mgmt/nrpe fails on all 11.0-CURRENT systems I run. This problem seems weird.

The error while compiling is:

[...]

cc -O2 -pipe -O3 -march=native  -I/usr/include -fstack-protector -fno-strict-aliasing -I/usr/include/include/openssl -I/usr/include/include -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c ./utils.c ./acl.c -Wl,-rpath,/usr/lib:/usr/local/lib -fstack-protector -L/usr/lib  -lssl -lcrypto  -lwrap  
./nrpe.c:271:6: warning: implicit declaration of function 'get_dh512' is invalid in C99 [-Wimplicit-function-declaration]
                dh=get_dh512();
                   ^
./nrpe.c:271:5: warning: incompatible integer to pointer conversion assigning to 'DH *' (aka 'struct dh_st *') from 'int' [-Wint-conversion]
                dh=get_dh512();
                  ^~~~~~~~~~~~
2 warnings generated.
./utils.c:151:10: warning: implicit declaration of function 'my_create_socket' is invalid in C99 [-Wimplicit-function-declaration]
                sock = my_create_socket(ai, bind_address);
                       ^
1 warning generated.
/tmp/nrpe-f335b4.o: In function `main':
./nrpe.c:(.text+0x62d): undefined reference to `get_dh512'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [nrpe] Error code 1



Reason for that seems to be an empty include/dh.h, which is included in src/nrpe.c.
This file is supposed to contain the cleaned output of the command

openssl dhparam -C 512

with footer erased in favor to gain a clean C header file. I have no clue why this header is not generated on 11.0-CURRENT systems of mine. 

I use the following  settings in /etc/src.conf compiling the system:

#
CPUTYPE?=               native
#
CFLAGS+=                -pipe -O3
COPTFLAGS+=             -pipe -O3
#
# jetzt Standard
CXXFLAGS+=              -std=c++11
#
WITH_CLANG_EXTRAS=      YES
WITH_LLDB=              YES
#
WITH_IDEA=              YES
#
#WITH_BSD_GREP=         YES
WITH_BSD_SORT=          YES
#
#WITH_OFED=             YES
WITH_NAND=              YES
#WITH_CTF=              YES
#
WITH_SVN=               YES
#
MALLOC_PRODUCTION=      YES

Even avoiding any special flag an leaving compilation with default optimization flags I see the problem

>How-To-Repeat:

>Fix:
A workaround for me is to generate include.dh.h myself using command openssl 

openssl dhparam -C 512 | sed -e '/-----BEGIN DH PARAMETERS-----/,/-----END DH PARAMETERS-----/d' > work/nrpe-2.15/include/dh.h

After that, the port compiles and installs perfectly.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403290819.s2T8JImQ053055>