Bugs item #1043070, was opened at 2004-10-08 09:06
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1043070&group_id=8032

Category: libraries/network
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: John Goerzen (jgoerzen)
Assigned to: Nobody/Anonymous (nobody)
Summary: ancilData breaks link on AIX

Initial Comment:
Hello, 
 
When I built a program on AIX using network code, I 
got the following errors during the link stage: 
 
/usr/local/lib/ghc-6.2.1/libHSnetwork.a(ancilData.o)
(.pr+0x31c):cbits/ancilData.c: undefined reference to 
`.CMSG_LEN' 
/usr/local/lib/ghc-6.2.1/libHSnetwork.a(ancilData.o)
(.pr+0x3fc):cbits/ancilData.c: undefined reference to 
`.CMSG_SPACE' 
/usr/local/lib/ghc-6.2.1/libHSnetwork.a(ancilData.o)
(.pr+0x420):cbits/ancilData.c: undefined reference to 
`.CMSG_LEN' 
 
(repeated over and over) 
 
I traced the problem down to ancilData.c.  The 
attached trivial patch is a workaround. 
 
AIX does not define CMSG_LEN or CMSG_SPACE 
anywhere -- unless you 
 
#define _LINUX_SOURCE_COMPAT 
 
before #including sys/socket.h.  (sounds ugly.) 
 
Here's how AIX defines msghdr, BTW: 
 
#if defined(COMPAT_43) && !defined(_KERNEL) 
struct msghdr { 
        caddr_t msg_name;               /* optional address 
*/ 
        int     msg_namelen;            /* size of address */ 
        struct  iovec *msg_iov;         /* scatter/gather 
array */ 
        int     msg_iovlen;             /* # elements in 
msg_iov */ 
        caddr_t msg_accrights;          /* access rights 
sent/received */ 
        int     msg_accrightslen; 
}; 
#else 
struct msghdr { 
        void    *msg_name;              /* optional address 
*/ 
        socklen_t  msg_namelen;         /* size of address 
*/ 
        struct  iovec   *msg_iov;       /* scatter/gather 
array */ 
        int     msg_iovlen;             /* # elements in 
msg_iov */ 
        void    *msg_control;           /* ancillary data, 
see below */ 
        socklen_t  msg_controllen;      /* ancillary data 
buffer len */ 
        int     msg_flags;              /* flags on received 
message */ 
}; 
 
#endif 
 
My little hack tells it to use COMPAT_43.  I suppose you 
could also go the _LINUX_SOURCE_COMPAT route. 
 
In either case, I am not proficient at all with the 
autotools stuff and lack the expertise to craft the 
correct build stuff there, but I'm happy to give you 
whatever information you may need to do that. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1043070&group_id=8032
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to