Porting cmake for Irixports

Unxmaal

Administrator
Feb 8, 2019
98
60
18
I'm getting this error:

C:
/usr/people/edodd/projects/github/unxmaal/irixports/ports/cmake/CMake-3.15.3/Utilities/cmlibuv/src/unix/core.c: In function 'uv__recvmsg':
/usr/people/edodd/projects/github/unxmaal/irixports/ports/cmake/CMake-3.15.3/Utilities/cmlibuv/src/unix/core.c:672:28: error: 'SCM_RIGHTS' undeclared (first use in this function); did you mean 'RB_RIGHT'?
     if (cmsg->cmsg_type == SCM_RIGHTS)
                            ^~~~~~~~~~
                            RB_RIGHT
But I've patched CMake-3.15.3/Utilities/cmlibuv/src/unix/core.c with #include <socket.h> . I don't really see the point of this because it's already there as sys/socket.h , but ok.

Here's the snippit of code:

C:
#endif
  if (rc == -1)
    return UV__ERR(errno);
  if (msg->msg_controllen == 0)
    return rc;
  for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg))
    if (cmsg->cmsg_type == SCM_RIGHTS)
      for (pfd = (int*) CMSG_DATA(cmsg),
           end = (int*) ((char*) cmsg + cmsg->cmsg_len);
           pfd < end;
           pfd += 1)
        uv__cloexec(*pfd, 1);
  return rc;
}
Any ideas what else I should look for?
 

foetz

Member
Feb 19, 2019
93
47
18
I don't really see the point of this because it's already there as sys/socket.h
irix' socket.h is old school. a more recent cmake is likely expecting the structs as they are on more recent systems. have a look inside at the stuff that's prefixed with xpg4 and xpg5. these should match cmake's checks better.
 
Last edited:

hammy

Active member
Jun 1, 2019
108
68
28
UK
What foetz said :)

Also, FYI - the SCM_RIGHTS that your compiler isn't picking up - it exists in /usr/include/sys/socket.h - so it might be guarded by the various things that SGI did to control versions:

Code:
#if defined(_KERNEL) || defined(_XOPEN_SOURCE)
/* "Socket"-level control message types: */
#define SCM_RIGHTS      0x01            /* access rights (array of int) */
#endif /* (_KERNEL || _XOPEN_SOURCE) */
As a first step, I'd try adding the xopen bits to your CFLAGS, re-configure from fresh and see if that gets you any further.

Otherwise if it's still unhappy about socket stuff, it'll maybe need the xpg# stuff.
 

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu