Home | Networks | Community | Need Help? 

 
 Quick search

 
 
 RegisterRegister   Log inLog in 

Undefined Reference To `_res', Bahamut ircd make file

 
Post new topic   Reply to topic    SearchIRC Forum Index -> IRCD & Network Services
Author Message
iao
Guest





PostPosted: Jan 12, 2004 6:54am    Post subject: Undefined Reference To `_res', Bahamut ircd make file Reply with quote

Hi people, I'm running mdk 9.2 with gcc 3.3.1 but having this problem when I try and 'make' bahamut through konsole. Can anyone help?

In function `init_resolver':
/home/iao/bahamut-release/src/res.c:136: undefined reference to `_res'
res.o(.text+0x76):/home/iao/bahamut-release/src/res.c:138: undefined reference t
o `_res'
res.o(.text+0x8c):/home/iao/bahamut-release/src/res.c:139: undefined reference t
o `_res'
res.o(.text+0x639): In function `send_res_msg':
/home/iao/bahamut-release/src/res.c:433: undefined reference to `_res'
res.o(.text+0x645):/home/iao/bahamut-release/src/res.c:434: undefined reference
to `_res'
res.o(.text+0x691):/home/iao/bahamut-release/src/res.c:441: more undefined refer
ences to `_res' follow
collect2: ld returned 1 exit status
make[1]: *** [ircd] Error 1
Back to top
Guest






PostPosted: Jan 12, 2004 10:14am    Post subject: Reply with quote

There is an unofficial patch to make bahamut compile under redhat9 and
gcc3.x, it is unsupported but it does work.

This patch is intended to fix _res linking failures for bahamut 1.4.35-36
with
newer threaded versions of glibc. Place this file in bahamut-release and
run:

patch -p0 < resfix.patch

Code:

--- include/resolv.h   Sun Jul  8 19:57:17 2001
+++ include/resolv.h   Sat Jan  4 15:56:38 2003
@@ -42,19 +42,6 @@

 #define   RES_TIMEOUT   5   /* min. seconds between retries */

-struct state {
-    int         retrans;      /* retransmition time interval */
-    int         retry;              /* number of times to retransmit */
-    long        options;      /* option flags - see below. */
-    int         nscount;      /* number of name servers */
-    struct sockaddr_in nsaddr_list[MAXNS];   /* address of name server */
-#define   nsaddr   nsaddr_list[0]           /* for backward compatibility */
-    unsigned short id;              /* current packet id */
-    char        defdname[MAXDNAME];   /* default domain */
-    char       *dnsrch[MAXDNSRCH + 1];   /* components of domain to search */
-    unsigned short order[MAXSERVICES + 1];   /* search service order */
-};
-
 #define RES_SERVICE_NONE   0
 #define RES_SERVICE_BIND   1
 #define RES_SERVICE_LOCAL   2
@@ -72,7 +59,53 @@

 #define RES_DEFAULT   (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)

+#if ((__GNU_LIBRARY__ == 6) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 3))
+# define MAXRESOLVSORT      10   /* number of net to sort on */
+
+struct __res_state {
+   int   retrans;       /* retransmition time interval */
+   int   retry;         /* number of times to retransmit */
+   u_long   options;      /* option flags - see below. */
+   int   nscount;      /* number of name servers */
+   struct sockaddr_in
+      nsaddr_list[MAXNS];   /* address of name server */
+# define nsaddr   nsaddr_list[0]      /* for backward compatibility */
+   u_short   id;         /* current message id */
+   char   *dnsrch[MAXDNSRCH+1];   /* components of domain to search */
+   char   defdname[256];      /* default domain (deprecated) */
+   u_long   pfcode;         /* RES_PRF_ flags - see below. */
+   unsigned ndots:4;      /* threshold for initial abs. query */
+   unsigned nsort:4;      /* number of elements in sort_list[] */
+   char   unused[3];
+   struct {
+      struct in_addr   addr;
+      u_int32_t   mask;
+   } sort_list[MAXRESOLVSORT];
+};
+
+typedef struct __res_state *res_state;
+
+extern struct __res_state *__res_state(void) __attribute__ ((__const__));
+#define _res (*__res_state())
+
+#else
+
+struct state {
+    int         retrans;      /* retransmition time interval */
+    int         retry;              /* number of times to retransmit */
+    long        options;      /* option flags - see below. */
+    int         nscount;      /* number of name servers */
+    struct sockaddr_in nsaddr_list[MAXNS];   /* address of name server */
+#define   nsaddr   nsaddr_list[0]           /* for backward compatibility */
+    unsigned short id;              /* current packet id */
+    char        defdname[MAXDNAME];   /* default domain */
+    char       *dnsrch[MAXDNSRCH + 1];   /* components of domain to search */
+    unsigned short order[MAXSERVICES + 1];   /* search service order */
+};
+
 extern struct state _res;
+#endif
+
 extern char *p_cdname(), *p_rr(), *p_type(), *p_class(), *p_time();

 #if ((__GNU_LIBRARY__ == 6) && (__GLIBC__ >=2) && (__GLIBC_MINOR__ >= 2))
Back to top
Guest
Guest





PostPosted: Jan 15, 2004 2:29pm    Post subject: Re: Undefined Reference To `_res', Bahamut ircd make file Reply with quote

Bahamut 1.4.36 resolves the issue along with some others... http://bahamut.dal.net/changes.php
Back to top
AshenWuff
Guest





PostPosted: Jan 17, 2004 12:20pm    Post subject: Reply with quote

I've got the most recent version of bahamut, 1.4.36,
and I *still* get this error. In addition, your patch doesn't work, it gives me:

patch: **** malformed patch at line 5: #define RES_TIMEOUT 5 /* min. seconds between retries */

when I try to apply it......... what am I doing wrong?

-Ashen
Back to top
Guest
Guest





PostPosted: Jan 18, 2004 1:14am    Post subject: Reply with quote

AshenWuff wrote:
I've got the most recent version of bahamut, 1.4.36,
and I *still* get this error.


Strange... you're running gcc 3+ along with it's libraries correct?

Quote:
In addition, your patch doesn't work, it gives me:

patch: **** malformed patch at line 5: #define RES_TIMEOUT 5 /* min. seconds between retries */

when I try to apply it......... what am I doing wrong?

-Ashen


Try the patch found here: https://secure.alastria.net/resfix.patch on Bahamut 1.4.35... of course, typing "patch < resfix.patch" from within the include directory.
Back to top
al5001
Lurker
Lurker


Joined: 17 Jul 2003
Posts: 181
Location: Canada

PostPosted: Jan 18, 2004 9:42pm    Post subject: Reply with quote

Remember that to change the network name in version 1.4.36, you have to go in s_user.c, to change the "Welcome to the DALnet IRC Network" its located in s_err.c... the rest is in config.h...

if operserv and helpserv is on services you also need to change it in config.h from STATS_NAME to SERVICES_NAME for those two to work with /os and /hs.
Back to top
al5001
Lurker
Lurker


Joined: 17 Jul 2003
Posts: 181
Location: Canada

PostPosted: Jan 18, 2004 9:45pm    Post subject: Reply with quote

also I dont believe bahamut will run on redhat 9... it works best on freebsd... actually... freebsd is the best for IRCds in the first place

anope's threading support shows as 1 process on freebsd and as multiple processes on linux...

*BSD is the way to go..
Back to top
guest
Guest





PostPosted: Apr 29, 2004 5:44am    Post subject: Hi Reply with quote

Hello guys. Im runnig bahamut-1.4(35) everytime when i connect in server in status is Dalnet <<. So you said that i must change the config.h , s_err.c and s_user.c i have all changed but again is not working ... What can be a problem can anyone tell me please ?
thanks
Back to top
Thrall
none
none


Joined: 01 Mar 2004
Posts: 34

PostPosted: Apr 29, 2004 11:35pm    Post subject: . Reply with quote

Recompile your IRCd.

type: make clean ; make ; make install

that should do it, if you changed the files correctly.
Back to top
uchat
Idler
Idler


Joined: 17 Mar 2004
Posts: 335

PostPosted: Apr 30, 2004 3:58am    Post subject: Reply with quote

Quote:

it works best on freebsd...


Because all DALnet servers are on FreeBSD, the IRCd was written specificlly for FreeBSD.
Back to top
Avenger
Guest





PostPosted: Nov 03, 2005 6:36pm    Post subject: Fixed patch for 1.4.35 bahamut Reply with quote

_res patch reviewed by me (applied manually tha patch posted above, so it cleanly applies):

While into source directory, make sure to use
patch -p1 < bahamut-1.4.35-_res-fix.diff to apply the patch.

- bahamut-1.3.35-_res-fix.diff
Code:
--- bahamut-release-1.4.35-pre2/include/resolv.h        2002-02-01 17:06:10.000000000 -0200
+++ bahamut-release-1.4.35-pre2-avenger/include/resolv.h        2005-11-03 22:20:50.000000000 -0200
@@ -42,18 +42,6 @@

 #define        RES_TIMEOUT     5       /* min. seconds between retries */

-struct state {
-    int         retrans;               /* retransmition time interval */
-    int         retry;                 /* number of times to retransmit */
-    long        options;               /* option flags - see below. */
-    int         nscount;               /* number of name servers */
-    struct sockaddr_in nsaddr_list[MAXNS];     /* address of name server */
-#define        nsaddr  nsaddr_list[0]          /* for backward compatibility */
-    unsigned short id;                 /* current packet id */
-    char        defdname[MAXDNAME];    /* default domain */
-    char       *dnsrch[MAXDNSRCH + 1]; /* components of domain to search */
-    unsigned short order[MAXSERVICES + 1];     /* search service order */
-};

 #define RES_SERVICE_NONE       0
 #define RES_SERVICE_BIND       1
@@ -72,7 +60,53 @@

 #define RES_DEFAULT    (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)

-extern struct state _res;
+#if ((__GNU_LIBRARY__ == 6) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 3))
+# define MAXRESOLVSORT      10   /* number of net to sort on */
+
+struct __res_state {
+   int   retrans;       /* retransmition time interval */
+   int   retry;         /* number of times to retransmit */
+   u_long   options;      /* option flags - see below. */
+   int   nscount;      /* number of name servers */
+   struct sockaddr_in
+      nsaddr_list[MAXNS];   /* address of name server */
+# define nsaddr   nsaddr_list[0]      /* for backward compatibility */
+   u_short   id;         /* current message id */
+   char   *dnsrch[MAXDNSRCH+1];   /* components of domain to search */
+   char   defdname[256];      /* default domain (deprecated) */
+   u_long   pfcode;         /* RES_PRF_ flags - see below. */
+   unsigned ndots:4;      /* threshold for initial abs. query */
+   unsigned nsort:4;      /* number of elements in sort_list[] */
+   char   unused[3];
+   struct {
+      struct in_addr   addr;
+      u_int32_t   mask;
+   } sort_list[MAXRESOLVSORT];
+};
+
+typedef struct __res_state *res_state;
+
+extern struct __res_state *__res_state(void) __attribute__ ((__const__));
+#define _res (*__res_state())
+
+#else
+
+struct state {
+    int         retrans;      /* retransmition time interval */
+    int         retry;              /* number of times to retransmit */
+    long        options;      /* option flags - see below. */
+    int         nscount;      /* number of name servers */
+    struct sockaddr_in nsaddr_list[MAXNS];   /* address of name server */
+#define   nsaddr   nsaddr_list[0]           /* for backward compatibility */
+    unsigned short id;              /* current packet id */
+    char        defdname[MAXDNAME];   /* default domain */
+    char       *dnsrch[MAXDNSRCH + 1];   /* components of domain to search */
+    unsigned short order[MAXSERVICES + 1];   /* search service order */
+};
+
+ extern struct state _res;
+#endif
+
 extern char *p_cdname(), *p_rr(), *p_type(), *p_class(), *p_time();

 #if ((__GNU_LIBRARY__ == 6) && (__GLIBC__ >=2) && (__GLIBC_MINOR__ >= 2))


Hope it helps!..
Back to top
Avenger
Guest





PostPosted: Nov 03, 2005 6:37pm    Post subject: Addendum Reply with quote

At least it compiles cleanly after applying too!.. Not tested actually running the server itself. But it's worth a try!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    SearchIRC Forum Index -> IRCD & Network Services All times are GMT - 6 Hours
Page 1 of 1

 
 
Forum powered by phpBB
 
 © 2000 - 2008 EverythingIRC, Inc. All rights reserved. Please read our disclaimer