On 5/14/07, Dominique Dhumieres <[EMAIL PROTECTED]> wrote:
> I have sent the following mail to [EMAIL PROTECTED],
> but it bounced back.
>
> Dominique
>
> On PPC/OSX 10.4.9 updating to klamav-0.41-1002 failed with:
>
> ...
> gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/sw/include -I/sw/lib/qt3/include
> -I/usr/X11R6/include -I/sw/include -DQT_THREAD_SUPPORT -I/sw/inclu
> de -Os -c dazukoio.c
> /bin/sh ../../libtool --silent --tag=CC --mode=link gcc -Os -lintl
> -lresolv -L/sw/lib -o klamd output.o cfgparser.o getopt.o memory.o m
> isc.o network.o options.o klamd.o tcpserver.o localserver.o session.o
> thrmgr.o server-th.o scanner.o others.o clamuko.o dazukoio_compat12.o
> dazukoio.o -L/sw/lib -lclamav
> /usr/bin/ld: Undefined symbols:
> _gethostbyname_r
> collect2: ld returned 1 exit status
> make[3]: *** [klamd] Error 1
> make[2]: *** [all-recursive] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> ### execution of make failed, exit code 2
>
> TIA
>
> Dominique
>
The problem still holds.
I ran "nm -g" on the object files, and found the following:
./klamav-0.41/src/klamd/network.o:
U _gethostbyname_r
00000000 T _r_gethostbyname
U dyld_stub_binding_helper
and klamav-0.41-source/klamav-0.41/src/klamd/network.c does have
gethostbyname-related stuff:
$ less
/sw/src/fink.build/klamav-0.41-1002/klamav-0.41-source/klamav-0.41/src/klamd/network.c
==> append : to filename to switch off syntax highlighting
/*
* Copyright (C) 2005 Nigel Horne <[EMAIL PROTECTED]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*/
#ifdef _MSC_VER
#include <windows.h>
#include <winsock.h>
#endif
#if HAVE_CONFIG_H
#include "clamav-config.h"
#endif
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef C_WINDOWS
#include <netdb.h>
#endif
#ifdef CL_THREAD_SAFE
#include <pthread.h>
#endif
/*
* TODO: gethostbyname_r is non-standard so different operating
* systems do it in different ways. Need more examples
* Perhaps we could use res_search()?
*
* Returns 0 for success
*/
int r_gethostbyname(const char *hostname, struct hostent *hp, char
*buf, size_t len)
{
#if defined(HAVE_GETHOSTBYNAME_R_6)
/* e.g. Linux */
struct hostent *hp2;
int ret = -1;
if((hostname == NULL) || (hp == NULL))
return -1;
if(gethostbyname_r(hostname, hp, buf, len, &hp2, &ret) < 0)
return ret;
#elif defined(HAVE_GETHOSTBYNAME_R_5)
/* e.g. BSD, Solaris, Cygwin */
int ret = -1;
if((hostname == NULL) || (hp == NULL))
return -1;
if(gethostbyname_r(hostname, hp, buf, len, &ret) == NULL)
return ret;
#elif defined(HAVE_GETHOSTBYNAME_R_3)
/* e.g. HP/UX, AIX */
if((hostname == NULL) || (hp == NULL))
return -1;
if(gethostbyname_r(hostname, &hp, (struct hostent_data *)buf) < 0)
return h_errno;
#else
/* Single thread the code e.g. VS2005 */
struct hostent *hp2;
#ifdef CL_THREAD_SAFE
static pthread_mutex_t hostent_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
if((hostname == NULL) || (hp == NULL))
return -1;
#ifdef CL_THREAD_SAFE
pthread_mutex_lock(&hostent_mutex);
#endif
if((hp2 = gethostbyname(hostname)) == NULL) {
#ifdef CL_THREAD_SAFE
pthread_mutex_unlock(&hostent_mutex);
#endif
return h_errno;
}
memcpy(hp, hp2, sizeof(struct hostent));
#ifdef CL_THREAD_SAFE
pthread_mutex_unlock(&hostent_mutex);
#endif
#endif
return 0;
}
--
Alexander K. Hansen
akh AT finkproject DOT org
Fink User Liaison and Documenter
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Fink-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-users