Bug 311 - Compile fails on MIPS Linux (Cobalt Raq2) - SCM_RIGHTS undeclared
Summary: Compile fails on MIPS Linux (Cobalt Raq2) - SCM_RIGHTS undeclared
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: -current
Hardware: MIPS Linux
: P2 major
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-28 08:29 AEST by Matt Perry
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments
Patch for Linux 2.0.x on Cobalt/MIPS platforms with missing SCM_RIGHTS in glibc includes (661 bytes, patch)
2002-06-28 16:09 AEST, Jim Knoble
no flags Details | Diff
Second-round patch for working around missing SCM_RIGHTS in Cobalt/glibc-2.0.7 headers (710 bytes, patch)
2002-06-29 08:48 AEST, Jim Knoble
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Perry 2002-06-28 08:29:37 AEST
I'm using Linux kernel 2.0.34C52_SK on a Cobalt Raq2 (a MIPS based machine).  
I'm attempting to compile OpenSSH 3.4p1.  When I run make, it compiles quite a 
bit but fails here:

gcc -g -O2 -Wall -Wpointer-arith -Wno-uninitialized -I. -I. -
I/usr/local/ssl/include  -DSSHDIR=\"/usr/local/etc\" -
D_PATH_SSH_PROGRAM=\"/usr/local/bin/ssh\" -
D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/local/libexec/ssh-askpass\" -
D_PATH_SFTP_SERVER=\"/usr/local/libexec/sftp-server\" -
D_PATH_SSH_KEY_SIGN=\"/usr/local/libexec/ssh-keysign\" -
D_PATH_SSH_PIDDIR=\"/var/run\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -
DSSH_RAND_HELPER=\"/usr/local/libexec/ssh-rand-helper\" -DHAVE_CONFIG_H -c 
monitor_fdpass.c
monitor_fdpass.c: In function `mm_send_fd':
monitor_fdpass.c:57: `SCM_RIGHTS' undeclared (first use this function)
monitor_fdpass.c:57: (Each undeclared identifier is reported only once
monitor_fdpass.c:57: for each function it appears in.)
monitor_fdpass.c: In function `mm_receive_fd':
monitor_fdpass.c:115: `SCM_RIGHTS' undeclared (first use this function)
make: *** [monitor_fdpass.o] Error 1
Comment 1 Jim Knoble 2002-06-28 09:00:44 AEST
What version of glibc?

What's the output of the following?

  find /usr/include -name \*.h -follow -exec grep -l SCM_RIGHTS \{\} \;

Comment 2 Matt Perry 2002-06-28 10:54:51 AEST
As best as I can tell, I appear to be using glibc 2.0.7.  The output of the 
find command returned one line which was:

/usr/include/linux/socket.h
Comment 3 Jim Knoble 2002-06-28 16:09:12 AEST
Created attachment 119 [details]
Patch for Linux 2.0.x on Cobalt/MIPS platforms with missing SCM_RIGHTS in glibc includes
Comment 4 Jim Knoble 2002-06-28 16:09:51 AEST
Your glibc package (or glibc-devel package, depending on your distribution) is
probably broken; /usr/include/socketbits.h should also be listed in the output
from the 'find' command.  Has Cobalt/Sun not provided any update or errata
packages for glibc?  The equivalent Red Hat package is glibc-devel-2.0.7-29.4.

Try compiling with the attached patch.
Comment 5 Matt Perry 2002-06-29 07:44:28 AEST
I applied the patch and recompiled.  When it got to monitor_fdpass.c it output 
the following:

gcc -g -O2 -Wall -Wpointer-arith -Wno-uninitialized -I. -I. -
I/usr/local/ssl/include  -DSSHDIR=\"/usr/local/etc\" -
D_PATH_SSH_PROGRAM=\"/usr/local/bin/ssh\" -
D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/local/libexec/ssh-askpass\" -
D_PATH_SFTP_SERVER=\"/usr/local/libexec/sftp-server\" -
D_PATH_SSH_KEY_SIGN=\"/usr/local/libexec/ssh-keysign\" -
D_PATH_SSH_PIDDIR=\"/var/run\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -
DSSH_RAND_HELPER=\"/usr/local/libexec/ssh-rand-helper\" -DHAVE_CONFIG_H -c 
monitor_fdpass.c
In file included from monitor_fdpass.c:27:
/usr/include/linux/socket.h:41: warning: `AF_UNSPEC' redefined
/usr/include/socketbits.h:55: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:42: warning: `AF_UNIX' redefined
/usr/include/socketbits.h:56: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:43: warning: `AF_INET' redefined
/usr/include/socketbits.h:59: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:44: warning: `AF_AX25' redefined
/usr/include/socketbits.h:60: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:45: warning: `AF_IPX' redefined
/usr/include/socketbits.h:61: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:46: warning: `AF_APPLETALK' redefined
/usr/include/socketbits.h:62: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:47: warning: `AF_NETROM' redefined
/usr/include/socketbits.h:63: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:48: warning: `AF_BRIDGE' redefined
/usr/include/socketbits.h:64: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:49: warning: `AF_AAL5' redefined
/usr/include/socketbits.h:65: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:50: warning: `AF_X25' redefined
/usr/include/socketbits.h:66: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:54: warning: `AF_MAX' redefined
/usr/include/socketbits.h:72: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:57: warning: `PF_UNSPEC' redefined
/usr/include/socketbits.h:36: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:58: warning: `PF_UNIX' redefined
/usr/include/socketbits.h:37: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:59: warning: `PF_INET' redefined
/usr/include/socketbits.h:40: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:60: warning: `PF_AX25' redefined
/usr/include/socketbits.h:41: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:61: warning: `PF_IPX' redefined
/usr/include/socketbits.h:42: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:62: warning: `PF_APPLETALK' redefined
/usr/include/socketbits.h:43: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:63: warning: `PF_NETROM' redefined
/usr/include/socketbits.h:44: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:64: warning: `PF_BRIDGE' redefined
/usr/include/socketbits.h:45: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:65: warning: `PF_AAL5' redefined
/usr/include/socketbits.h:46: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:66: warning: `PF_X25' redefined
/usr/include/socketbits.h:47: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:70: warning: `PF_MAX' redefined
/usr/include/socketbits.h:52: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:96: warning: `IPTOS_MINCOST' redefined
/usr/include/netinet/ip.h:191: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:116: warning: `TCP_NODELAY' redefined
/usr/include/netinet/tcp.h:158: warning: this is the location of the previous 
definition
/usr/include/linux/socket.h:117: warning: `TCP_MAXSEG' redefined
/usr/include/netinet/tcp.h:159: warning: this is the location of the previous 
definition
In file included from /usr/include/sys/uio.h:29,
                 from monitor_fdpass.c:30:
/usr/include/iovec.h:37: warning: `UIO_MAXIOV' redefined
/usr/include/linux/uio.h:24: warning: this is the location of the previous 
definition
In file included from monitor_fdpass.c:27:
/usr/include/linux/socket.h:9: redefinition of `struct sockaddr'
/usr/include/linux/socket.h:14: redefinition of `struct linger'
/usr/include/linux/socket.h:26: redefinition of `struct msghdr'
In file included from /usr/include/sys/uio.h:29,
                 from monitor_fdpass.c:30:
/usr/include/iovec.h:42: redefinition of `struct iovec'
make: *** [monitor_fdpass.o] Error 1
Comment 6 Matt Perry 2002-06-29 07:49:55 AEST
I believe that this Cobalt system is based on Red Hat.  I'm using the following 
Cobalt RPMs for glibc:

glibc-2.0.7-29.4C2
glibc-debug-2.0.7-29.4C2
glibc-devel-2.0.7-29.4C2
glibc-profile-2.0.7-29.4C2

Cobalt has been supplying updates.  In fact, I just installed a glibc update 
from them only a few weeks ago.  I'll double check my glibc packages against 
the Red Hat one that you mentioned and see if there are any other discrepancies.
Comment 7 Jim Knoble 2002-06-29 08:46:34 AEST
Yuck.  (Sigh.  Who would have thought that including something in
/usr/include/linux/ would totally conflict with stuff in glibc's header files?)

It's my opinion your vendor's glibc-devel package is broken; SCM_RIGHTS really
ought to be defined in one of the glibc headers.  I'd recommend filing a bug
report with Cobalt (especially since SCM_RIGHTS is defined in the headers in
glibc-devel-2.0.7-29.4 on my Red Hat Linux 5.2/x86 system.

Please try the newly attached patch (against a clean source tree).  Note that
it's a workaround and probably ought not to go into the main OpenSSH source....
Comment 8 Jim Knoble 2002-06-29 08:48:06 AEST
Created attachment 122 [details]
Second-round patch for working around missing SCM_RIGHTS in Cobalt/glibc-2.0.7 headers
Comment 9 Matt Perry 2002-06-29 09:34:44 AEST
I applied the latest patch and can now compile without problems.  Thanks for 
the help.  I'll contact Cobalt about the issue with glibc headers.
Comment 10 Damien Miller 2003-01-07 18:20:28 AEDT
(closing, as this is a busted glibc problem)

Please note that the workaround patch cannot be applied to openssh - you really
need to bug your vendor about getting fixed headers.
Comment 11 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED