> From: Alex Kasatkin
> Sent: Tuesday, 9 September 2003 1:40 AM
> There is the problem with gethostbyname detection in 0.9.1:
> dev:~/freeradius-0.9.1# uname -prs
> FreeBSD 4.8-RELEASE-p4 i386
>
> configure says:
>
> checking gethostbyaddr_r() syntax... GNU-style
> checking gethostbyname_r() syntax... configure: warning: ****** BSD Style
> gethostbyname might NOT be thread-safe! ******
> BSD-style
>
> config.log:
>
> configure:7978: checking gethostbyaddr_r() syntax
> configure:7990: gcc -o conftest -g -O2 -pthread -D_THREAD_SAFE -Wall -D_GNU_SOURCE
> -DNDEBUG conftest.c 1>&5
> configure: In function `main':
> configure:7986: warning: implicit declaration of function `gethostbyaddr_r'
> configure:8068: checking gethostbyname_r() syntax
> configure:8080: gcc -o conftest -g -O2 -pthread -D_THREAD_SAFE -Wall -D_GNU_SOURCE
> -DNDEBUG conftest.c 1>&5
> configure: In function `main':
> configure:8076: warning: implicit declaration of function `gethostbyname_r'
> /tmp/ccuKg0wk.o: In function `main':
> /home/snoop/freeradius-0.9.1/configure(.text+0x16): undefined reference to
> `gethostbyname_r'
> configure: failed program was:
> #line 8070 "configure"
> #include "confdefs.h"
>
> #include <stdio.h>
> #include <netdb.h>
>
> int main() {
> gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL)
> ; return 0; }
> configure:8106: gcc -o conftest -g -O2 -pthread -D_THREAD_SAFE -Wall -D_GNU_SOURCE
> -DNDEBUG conftest.c 1>&5
> configure: In function `main':
> configure:8102: warning: implicit declaration of function `gethostbyname_r'
> /tmp/ccoZBWNY.o: In function `main':
> /home/snoop/freeradius-0.9.1/configure(.text+0x14): undefined reference to
> `gethostbyname_r'
> configure: failed program was:
> #line 8096 "configure"
> #include "confdefs.h"
>
> #include <stdio.h>
> #include <netdb.h>
>
> int main() {
> gethostbyname_r(NULL, NULL, NULL, 0, NULL)
> ; return 0; }
> configure:8133: gcc -o conftest -g -O2 -pthread -D_THREAD_SAFE -Wall -D_GNU_SOURCE
> -DNDEBUG conftest.c 1>&5
These outputs are consistent... For some reason, you have the GNU-style
gethostbyaddr_r able
to be linked, but not gethostbyname_r...
> Building fails at this point:
>
> gcc -g -O2 -pthread -D_THREAD_SAFE -Wall -D_GNU_SOURCE -DNDEBUG -I../../include
> -DHAVE_NDBM_H -c rlm_dbm_parser.c -o
> rlm_dbm_parser.o
> rlm_dbm_parser.c: In function `storecontent':
> rlm_dbm_parser.c:160: warning: assignment discards qualifiers from pointer target
> type
> /vol1/home/snoop/freeradius-0.9.1/libtool --mode=link gcc rlm_dbm_parser.o
> ../../lib/libradius.a -o rlm_dbm_parser
> gcc rlm_dbm_parser.o -o rlm_dbm_parser ../../lib/libradius.a
> ../../lib/libradius.a(misc.o): In function `ip_hostname':
> /vol1/home/snoop/freeradius-0.9.1/src/lib/misc.c:63: undefined reference to
> `gethostbyaddr_r'
> When I've add -lc_r, rlm_dbm_parser links normally, but with some warnings.
What's c_r? Is that where the ghostby{addr,name}_r stuff lives? I guess that could be
detected as
a required library for the gethostby{addr,name}_r function-using modules (hopefully
just libradius)
Is this documented somewhere on the 'net I could read?
> There is the bug or feature ?
Looks like a bug due to lack of access to FreeBSD machine by anyone who's able to
replicate this.
Maybe it would have been easier to use gethostby{addr,name} with a couple of mutexes.
--
=========================================================
Paul "TBBle" Hampson
Bubblesworth Pty Ltd (ABN: 51 095 284 361)
[EMAIL PROTECTED]
This is a one line proof...if we start
sufficiently far to the left.
-- Cambridge University Math Department
---------------------------------------------------------
Random signature generator 3.0 by Paul "TBBle" Hampson
=========================================================
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html