Mailing List Archive

libspf2.so: undefined reference to `res_ninit'
During the process of fixing many different errors in libspf2-1.2.5

I came up to the following step:
----
Making all in spfquery
source='spfquery.c' object='spfquery.o' libtool=no
depfile='.deps/spfquery.Po' tmpdepfile='.deps/spfquery.TPo' depmode=gcc
/bin/sh ../../config/depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../..
-I../../src/include -I../../src -I/usr/local/include -pthread -lbind
-Wall -c spfquery.c
gcc: -lbind: linker input file unused since linking not done
/bin/sh ../../libtool --mode=link gcc -pthread -lbind -Wall
-L/usr/local/lib -o spfquery spfquery.o ../../src/libspf2/libspf2.la -lintl
mkdir .libs
gcc -Wall -o .libs/spfquery spfquery.o -pthread -L/usr/local/lib
../../src/libspf2/.libs/libspf2.so -lbind -lintl -Wl,--rpath
-Wl,/usr/local/milter/lib
../../src/libspf2/.libs/libspf2.so: undefined reference to `res_ninit'
../../src/libspf2/.libs/libspf2.so: undefined reference to `res_nclose'
*** Error code 1

Stop in /mnt/disk/A/com/libspf2-1.2.5/src/spfquery.
*** Error code 1
----

It seems strange enough for me because:
----
# nm libbind.a | grep res_ninit
U __res_ninit
U __res_ninit
U __res_ninit
U __res_ninit
U __res_ninit
U __res_ninit
U __res_ninit
U __res_ninit
U __res_ninit
U __res_ninit
U __res_ninit
00000000 T __res_ninit
----

But the linker ignores this fact permanently as shown above.
Can anybody prompt - maybe I forgot something?

Oleg Golovanov

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
Re: libspf2.so: undefined reference to `res_ninit' [ In reply to ]
On FreeBSD, installing bind from the isc sources created the needed library
in a subdirectory of the installation directory, but that library was not
installed to the system doing a "make install". (!)
I manually installed it and that fixed the linking errors.

The library (libbind.la) was in the lib/bind subdirectory of the install directory.

[on my system, in /usr/local/bind/bind-9.2.4rc4:]
./lib/bind/.libs/libbind.a
./lib/bind/.libs/libbind.la
./lib/bind/libbind.la

Oleg M. Golovanov wrote:
> During the process of fixing many different errors in libspf2-1.2.5
>
> I came up to the following step:
> ----
> Making all in spfquery
> source='spfquery.c' object='spfquery.o' libtool=no
> depfile='.deps/spfquery.Po' tmpdepfile='.deps/spfquery.TPo' depmode=gcc
> /bin/sh ../../config/depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../..
> -I../../src/include -I../../src -I/usr/local/include -pthread -lbind
> -Wall -c spfquery.c
> gcc: -lbind: linker input file unused since linking not done
> /bin/sh ../../libtool --mode=link gcc -pthread -lbind -Wall
> -L/usr/local/lib -o spfquery spfquery.o ../../src/libspf2/libspf2.la
> -lintl
> mkdir .libs
> gcc -Wall -o .libs/spfquery spfquery.o -pthread -L/usr/local/lib
> ../../src/libspf2/.libs/libspf2.so -lbind -lintl -Wl,--rpath
> -Wl,/usr/local/milter/lib
> ../../src/libspf2/.libs/libspf2.so: undefined reference to `res_ninit'
> ../../src/libspf2/.libs/libspf2.so: undefined reference to `res_nclose'
> *** Error code 1
>
> Stop in /mnt/disk/A/com/libspf2-1.2.5/src/spfquery.
> *** Error code 1
> ----
>
> It seems strange enough for me because:
> ----
> # nm libbind.a | grep res_ninit
> U __res_ninit
> U __res_ninit
> U __res_ninit
> U __res_ninit
> U __res_ninit
> U __res_ninit
> U __res_ninit
> U __res_ninit
> U __res_ninit
> U __res_ninit
> U __res_ninit
> 00000000 T __res_ninit
> ----
>
> But the linker ignores this fact permanently as shown above.
> Can anybody prompt - maybe I forgot something?
>
> Oleg Golovanov
>
> -------
> To unsubscribe, change your address, or temporarily deactivate your
> subscription, please go to
> http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
Re: libspf2.so: undefined reference to `res_ninit' [ In reply to ]
It's not exact so - I installed /usr/local/lib/libbind.a (libbind.la was
not created)
and after that I got the result as signed in previous message.

ecsd wrote:

> On FreeBSD, installing bind from the isc sources created the needed
> library
> in a subdirectory of the installation directory, but that library was not
> installed to the system doing a "make install". (!)
> I manually installed it and that fixed the linking errors.
>
> The library (libbind.la) was in the lib/bind subdirectory of the
> install directory.
>
> [on my system, in /usr/local/bind/bind-9.2.4rc4:]
> ./lib/bind/.libs/libbind.a
> ./lib/bind/.libs/libbind.la
> ./lib/bind/libbind.la


-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
Re: libspf2.so: undefined reference to `res_ninit' [ In reply to ]
On Thu, 2005-03-17 at 15:34 +0700, Oleg M. Golovanov wrote:
> During the process of fixing many different errors in libspf2-1.2.5
>
> I came up to the following step:
> ----
> Making all in spfquery
> source='spfquery.c' object='spfquery.o' libtool=no
> depfile='.deps/spfquery.Po' tmpdepfile='.deps/spfquery.TPo' depmode=gcc
> /bin/sh ../../config/depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../..
> -I../../src/include -I../../src -I/usr/local/include -pthread -lbind
> -Wall -c spfquery.c
> gcc: -lbind: linker input file unused since linking not done
> /bin/sh ../../libtool --mode=link gcc -pthread -lbind -Wall
> -L/usr/local/lib -o spfquery spfquery.o ../../src/libspf2/libspf2.la -lintl
> mkdir .libs
> gcc -Wall -o .libs/spfquery spfquery.o -pthread -L/usr/local/lib
> ../../src/libspf2/.libs/libspf2.so -lbind -lintl -Wl,--rpath
> -Wl,/usr/local/milter/lib
> ../../src/libspf2/.libs/libspf2.so: undefined reference to `res_ninit'
> ../../src/libspf2/.libs/libspf2.so: undefined reference to `res_nclose'
> *** Error code 1
>
> Stop in /mnt/disk/A/com/libspf2-1.2.5/src/spfquery.
> *** Error code 1

Unfortunately I don't have a BSD box to test this kind of thing on.
However, one of our sub-projects is to write an internal DNS packet
generator/library, since the majority of the compilation/linkage errors
we see are due to the inability to link against thread-safe DNS
libraries. Since DNS is almost a non-moving standard, it will make sense
just to write a packet generator.

Expect this around 1.2.10.

S.

--
Shevek <shevek@anarres.org>

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
Re: libspf2.so: undefined reference to `res_ninit' [ In reply to ]
Oleg M. Golovanov wrote:
> During the process of fixing many different errors in libspf2-1.2.5
> gcc -Wall -o .libs/spfquery spfquery.o -pthread -L/usr/local/lib
> ../../src/libspf2/.libs/libspf2.so -lbind -lintl -Wl,--rpath
> -Wl,/usr/local/milter/lib
> ../../src/libspf2/.libs/libspf2.so: undefined reference to `res_ninit'
> ../../src/libspf2/.libs/libspf2.so: undefined reference to `res_nclose'

While looking at this, I noticed that libspf2 has checks for
#if HAVE_DECL_RES_NINIT
on several places in the code, and reverts to using res_init() and
res_close() instead here (which will work on a stock FreeBSD system
without libbind installed).

However these #if's don't appear everywhere, and I wonder why:
Is libspf2 supposed to work with plain res_init()?
If so, please include a few more #if HAVE_DECL_RES_NINIT checks.


Ciao,
Johan

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
Re: libspf2.so: undefined reference to `res_ninit' [ In reply to ]
Johan van Selst wrote:
> Is libspf2 supposed to work with plain res_init()?
> If so, please include a few more #if HAVE_DECL_RES_NINIT checks.

The attached patch makes it compile on my FreeBSD (current) machine.


Ciao,
Johan

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com