# Redux - source build on OpenBSD (5.3) and BIND libs

**URL:** <https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791>\
**Category:** Zeek\
**Created:** [August 25, 2013, 8:01am UTC](https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791 "2013-08-25T08:01:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darren\_S](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@Darren\_S](https://community.zeek.org/u/Darren_S)\
**Post date:** [August 25, 2013, 8:01am UTC](https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791/1 "2013-08-25T08:01:30Z")

</div>

Greetings,

CMake 2.8.10.2  
Perl 5.12.2  
libmagic 5.11  
SWIG 1.3.36  
Bison 2.3  
Flex 2.5.4  
Bash 4.2.42

Got stumped trying to build Bro on OpenBSD 5.3 i386 related to finding  
BIND8 headers/libs.

I see a few past similar issues, notably:  
[http://marc.info/?l=bro&m=132806089033571](http://marc.info/?l=bro&m=132806089033571)

Installing Bro 2.1.

$ ./configure  
Build Directory : build  
Source Directory: /home/dspruell/downloads/bro-2.1  
-- The C compiler identification is GNU 4.2.1  
-- The CXX compiler identification is GNU 4.2.1  
-- Check for working C compiler: /usr/bin/cc  
-- Check for working C compiler: /usr/bin/cc -- works  
-- Detecting C compiler ABI info  
-- Detecting C compiler ABI info - done  
-- Check for working CXX compiler: /usr/bin/c++  
-- Check for working CXX compiler: /usr/bin/c++ -- works  
-- Detecting CXX compiler ABI info  
-- Detecting CXX compiler ABI info - done  
-- Found sed: /usr/bin/sed  
-- Found Perl: /usr/bin/perl (found version "5.12.2")  
-- Found FLEX: /usr/bin/flex version 2.5.4  
-- Found BISON: /usr/local/bin/bison  
-- Found PCAP: /usr/lib/libpcap.so.7.0  
-- Performing Test PCAP\_LINKS\_SOLO  
-- Performing Test PCAP\_LINKS\_SOLO - Success  
-- Looking for pcap\_get\_pfring\_id  
-- Looking for pcap\_get\_pfring\_id - not found  
-- Found OpenSSL: /usr/lib/libssl.so.19.0;/usr/lib/libcrypto.so.22.0  
-- Performing Test ns\_initparse\_works\_none  
-- Performing Test ns\_initparse\_works\_none - Failed  
-- Performing Test res\_mkquery\_works\_none  
-- Performing Test res\_mkquery\_works\_none - Success  
-- Performing Test ns\_initparse\_works\_resolv  
-- Performing Test ns\_initparse\_works\_resolv - Failed  
-- Performing Test res\_mkquery\_works\_resolv  
-- Performing Test res\_mkquery\_works\_resolv - Success  
-- Performing Test ns\_initparse\_works\_bind  
-- Performing Test ns\_initparse\_works\_bind - Failed  
-- Performing Test res\_mkquery\_works\_bind  
-- Performing Test res\_mkquery\_works\_bind - Success  
-- Could NOT find BIND (missing: BIND\_LIBRARY)  
-- Found LibMagic: /usr/local/lib/libmagic.so.3.0  
-- Found ZLIB: /usr/lib/libz.so.4.1 (found version "1.2.3")  
CMake Error at aux/binpac/CMakeLists.txt:17 (message):  
&nbsp;&nbsp;&nbsp;Could not find prerequisite package 'BIND'

CMake Error at aux/binpac/CMakeLists.txt:19 (message):  
&nbsp;&nbsp;Configuration aborted due to missing prerequisites

-- Configuring incomplete, errors occurred!

I'm hung up trying to figure out where the necessary  
routines/libraries would be. OpenBSD ships with BIND 9 by default, and  
has res\_\* functions in libc (there is no libresolv.a, etc.; libresolv  
was removed ~2005). The previously referenced thread mentions libbind  
package; this doesn't seem to exist any more, although there is an an  
upstream ISC BIND 9 package (isc-bind 9.9.2-P2). When this package is  
installed, I can see the following library:

$ ldconfig -r |egrep 'bind'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;398:-lbind9.0.0 =\> /usr/local/lib/libbind9.so.0.0

...but the library does not provide ns\_\* symbols and the error at  
configure is still the same (maybe because of BIND 9 vs. BIND 8?):

-- Performing Test ns\_initparse\_works\_none  
-- Performing Test ns\_initparse\_works\_none - Failed  
-- Performing Test res\_mkquery\_works\_none  
-- Performing Test res\_mkquery\_works\_none - Success  
-- Performing Test ns\_initparse\_works\_resolv  
-- Performing Test ns\_initparse\_works\_resolv - Failed  
-- Performing Test res\_mkquery\_works\_resolv  
-- Performing Test res\_mkquery\_works\_resolv - Success  
-- Performing Test ns\_initparse\_works\_bind  
-- Performing Test ns\_initparse\_works\_bind - Failed  
-- Performing Test res\_mkquery\_works\_bind  
-- Performing Test res\_mkquery\_works\_bind - Success  
-- Could NOT find BIND (missing: BIND\_LIBRARY)

CMake Error at aux/binpac/CMakeLists.txt:17 (message):  
&nbsp;&nbsp;&nbsp;Could not find prerequisite package 'BIND'

It looks to me that OpenBSD doesn't include the ns\_\* routines; this  
discussion might support that:

[http://bugs.bitlbee.org/bitlbee/ticket/421](http://bugs.bitlbee.org/bitlbee/ticket/421)

Wondering if I'm at a dead end on this. Any ideas?

---

<div class="post-metadata">

**Author:** ![Siwek\_Jon](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Siwek\_Jon](https://community.zeek.org/u/Siwek_Jon)\
**Post date:** [August 26, 2013, 2:59pm UTC](https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791/2 "2013-08-26T14:59:52Z")

</div>

> I'm hung up trying to figure out where the necessary  
> routines/libraries would be. OpenBSD ships with BIND 9 by default, and  
> has res\_\* functions in libc (there is no libresolv.a, etc.; libresolv  
> was removed ~2005). The previously referenced thread mentions libbind  
> package; this doesn't seem to exist any more, although there is an an  
> upstream ISC BIND 9 package (isc-bind 9.9.2-P2).

There's a libbind 6.0 package at [1] (third from bottom of list) that might have what's needed. From what I read [2], the resolver library and headers it provides used to be part of BIND 8/9, but later removed as its own separate package. Not sure if OpenBSD has it's own package corresponding to that.

- Jon

[1] [Downloads - ISC](https://www.isc.org/downloads/)  
[2] [ISC libbind 6.0](https://lists.isc.org/pipermail/bind-users/2009-May/076322.html)

---

<div class="post-metadata">

**Author:** ![Lou\_RUPPERT](https://avatars.discourse-cdn.com/v4/letter/l/a587f6/32.png) [@Lou\_RUPPERT](https://community.zeek.org/u/Lou_RUPPERT)\
**Post date:** [August 26, 2013, 3:14pm UTC](https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791/3 "2013-08-26T15:14:49Z")

</div>

5.3 doesn't. I had to grab libbind 6.0 from [isc.org](http://isc.org) in order to get it  
to compile. IIRC that's the only thing I had to do.

- --  
I prefer encrypted email. Get my key here:  
[http://www.louruppert.com/keys/115DCF62.asc](http://www.louruppert.com/keys/115DCF62.asc)  
PGP Fingerprint: 3261 B9F9 9363 D512 56F8 12DD 127F 4D6A 115D CF62

---

<div class="post-metadata">

**Author:** ![Darren\_S](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@Darren\_S](https://community.zeek.org/u/Darren_S)\
**Post date:** [August 27, 2013, 6:00am UTC](https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791/4 "2013-08-27T06:00:22Z")

</div>

Indeed, appears that the libbind port disappeared for 5.2 and 5.3 but  
has since been reinstated.

[http://www.openbsd.org/cgi-bin/cvsweb/ports/net/libbind/](http://www.openbsd.org/cgi-bin/cvsweb/ports/net/libbind/)  
[http://marc.info/?l=openbsd-ports&m=136465613319561&w=2](http://marc.info/?l=openbsd-ports&m=136465613319561&w=2)

I'll give it a go with the source package, thanks for the help.

---

<div class="post-metadata">

**Author:** ![Jean-Philippe\_Luigg3](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@Jean-Philippe\_Luigg3](https://community.zeek.org/u/Jean-Philippe_Luigg3)\
**Post date:** [September 5, 2013, 12:22am UTC](https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791/5 "2013-09-05T00:22:09Z")

</div>

Hi everybody,

As Lou said, getting libbind6 is the solution.

Here is the process I followed today :

1) Packages

I had to install some of them (maybe others are needed but as my VPS was up and running...)

# pkg\_add flex bison libmagic swig ruby python gmake

Note : ruby is ruby 1.9 and python is 2.7

2) Libbind 6.0

- Get libbind 6 from : [http://www.isc.org/downloads/](http://www.isc.org/downloads/)  
- Extract it somewhere then compile/install it. Note that the directory I used (/opt/share/libbind-6.0) could be another one.

# tar zxvf libbind-6.0.tar.gz  
# cd libbind-6.0  
# ./configure --prefix=/opt/share/libbind-6.0; make; make install

3) Bro 2.1

- Extract bro-2.1 then compile it

# tar zxvf bro-2.1.tar.gz  
# cd bro-2.1  
# CFLAGS="-I/usr/include/ -I/usr/local/include/ -I/usr/local/include/ruby-1.9.1/ruby/backward/" ./configure --prefix=/opt/share/bro-2.1 --with-bind=/opt/share/libbind-6.0/  
# gmake; gmake install

Please note I use "/opt/share/bro-2.1" as install directory and I use "gmake".

The whole process should work but if not, just send a mail, I will be happy helping about it 🙂

Cheers.

Jean-Philippe.

PS: I will try to provide a complete document in the next weeks

---

<div class="post-metadata">

**Author:** ![Darren\_S](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@Darren\_S](https://community.zeek.org/u/Darren_S)\
**Post date:** [September 5, 2013, 6:22am UTC](https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791/6 "2013-09-05T06:22:42Z")

</div>

Very nice.

I completed install in very similar manner, although things appeared  
to work without requiring CFLAGS to be set for the configure script;  
my built completed with:

./configure --with-bind=/opt/libbind  
gmake; gmake install

That said, I do notice that when invoking some bro commands I get the  
following output about symbol size mismatches:

$ bro --help  
bro:/usr/lib/libc.so.66.2: bro : WARNING: symbol(\_\_p\_class\_syms) size  
mismatch, relink your program  
bro:/usr/lib/libc.so.66.2: bro : WARNING: symbol(\_res) size mismatch,  
relink your program  
bro:/usr/lib/libc.so.66.2: bro : WARNING: symbol(\_\_p\_type\_syms) size  
mismatch, relink your program  
bro version 2.1  
[...]

I can see this has been encountered several times over the years:

(2003) [http://comments.gmane.org/gmane.comp.security.detection.bro/222](http://comments.gmane.org/gmane.comp.security.detection.bro/222)  
(2006) [http://comments.gmane.org/gmane.comp.security.detection.bro/1382](http://comments.gmane.org/gmane.comp.security.detection.bro/1382)  
(2007) [http://comments.gmane.org/gmane.comp.security.detection.bro/1890](http://comments.gmane.org/gmane.comp.security.detection.bro/1890)  
(2008) [http://comments.gmane.org/gmane.os.openbsd.ports/18520](http://comments.gmane.org/gmane.os.openbsd.ports/18520)  
(2012) [http://comments.gmane.org/gmane.comp.security.detection.bro/4254](http://comments.gmane.org/gmane.comp.security.detection.bro/4254)

Someone suggested it was related to issue between libbind and libc  
resolver routines. Anyone know more?

---

<div class="post-metadata">

**Author:** ![Jean-Philippe\_Luigg3](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@Jean-Philippe\_Luigg3](https://community.zeek.org/u/Jean-Philippe_Luigg3)\
**Post date:** [September 5, 2013, 1:14pm UTC](https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791/7 "2013-09-05T13:14:12Z")

</div>

Hi,

I encountered the same messages but didn't have the time to find the reason and explain it.  
I put this problem on hold and try to get a response as soon as possible.

Speaking of "CFLAGS", I had to use it because of the Ruby binding.  
I think Broccoli wants to use "rubyio.h" which is in "/usr/local/include/ruby-1.9.1/ruby/backward/".  
This is the only reason I need to use this specific flag.

Cheers.

Jean-Philippe.

---

<div class="post-metadata">

**Author:** ![Seth\_Hall3](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Seth\_Hall3](https://community.zeek.org/u/Seth_Hall3)\
**Post date:** [September 5, 2013, 3:06pm UTC](https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791/8 "2013-09-05T15:06:43Z")

</div>

Yeah, that's probably because the ruby bindings are still stuck at 1.8.x support only. I've never had the motivation to update them to a newer version of Ruby. On the other hand, the ruby bindings aren't necessary for anything unless you happen to be using them in scripts you've written locally. BroControl only uses the python bindings.

&nbsp;&nbsp;.Seth

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:41pm UTC](https://community.zeek.org/t/redux-source-build-on-openbsd-5-3-and-bind-libs/2791/9 "2022-05-06T15:41:11Z")

</div>


