Subject: install/9418: instbin fails to link on the atari (and probaly others)
To: None <gnats-bugs@gnats.netbsd.org>
From: Leo Weppelman <leo@wau.mis.ah.nl>
List: netbsd-bugs
Date: 02/14/2000 06:33:49
>Number: 9418
>Category: install
>Synopsis: instbin fails to link on the atari (and probaly others)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: install-manager (NetBSD system installation bug manager)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 14 06:33:01 2000
>Last-Modified:
>Originator: Leo Weppelman
>Organization:
>Release: NetBSD-current 20000205
>Environment:
NetBSD lwp_hades 1.4S NetBSD 1.4S (HADES++) #103: Fri Feb 11 20:35:44 MET 2000 root@lwp_hades:/mnt/HADES++ atari
>Description:
When typing 'make instbin' in /usr/src/distrib/miniroot, you will
eventually see something like:
247: libhack.o: Definition of symbol `__endhtent' (multiply defined)
248: libhack.o: Definition of symbol `__gethtent' (multiply defined)
249: libhack.o: Definition of symbol `__gethtbyname' (multiply defined)
250: libhack.o: Definition of symbol `_gethostbyname' (multiply defined)
251: libhack.o: Definition of symbol `__gethtbyaddr' (multiply defined)
252: libhack.o: Definition of symbol `_gethostbyaddr' (multiply defined)
253: libhack.o: Definition of symbol `__sethtent' (multiply defined)
>How-To-Repeat:
>Fix:
Since it looks to be caused by a reference to gethostbyname2() somewhere
(probably from within libc), a solution is to add this functionality to
/usr/src/distrib/utils/libhack/gethost.c. The patch below does this.
--- gethost.c Sat Jan 15 13:05:20 2000
+++ gethost.c.new Mon Feb 14 14:32:59 2000
@@ -68,7 +68,7 @@
__weak_alias(gethostbyaddr,_gethostbyaddr);
__weak_alias(gethostbyname,_gethostbyname);
-__weak_alias(gethostbyname2,gethostbyname);
+__weak_alias(gethostbyname2,_gethostbyname2);
#endif
#include <sys/param.h>
@@ -109,6 +109,18 @@
#endif
extern int h_errno;
+
+struct hostent *
+gethostbyname2(name, af)
+ const char *name;
+ int af;
+{
+ if (af != AF_INET) {
+ errno = EAFNOSUPPORT;
+ return (NULL);
+ }
+ return(gethostbyname(name));
+}
struct hostent *
gethostbyname(name)
>Audit-Trail:
>Unformatted: