From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2240 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: A few issues on MIPS Date: Mon, 5 Nov 2012 12:31:27 -0500 Message-ID: <20121105173127.GQ20323@brightrain.aerifal.cx> References: <20121105152832.GV24157@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ew6BAiZeqk4r7MaW" X-Trace: ger.gmane.org 1352136698 16529 80.91.229.3 (5 Nov 2012 17:31:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2012 17:31:38 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2241-gllmg-musl=m.gmane.org@lists.openwall.com Mon Nov 05 18:31:48 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TVQWa-0000cX-54 for gllmg-musl@plane.gmane.org; Mon, 05 Nov 2012 18:31:48 +0100 Original-Received: (qmail 18278 invoked by uid 550); 5 Nov 2012 17:31:39 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 18268 invoked from network); 5 Nov 2012 17:31:38 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2240 Archived-At: --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 05, 2012 at 07:27:44PM +0200, Paul Schutte wrote: > Thanks for the reply. > > I suspected something like you mention and therefore I made sure that I > installed the correct kernel headers before I compiled musl or any of the > other software. Kernel headers are completely irrelevant; they're not used anywhere. nsz's analysis is right. I have a patch I'm about to commit. In case you'd like to try it directly without using git, I'm attaching it here. There may be more fixes still needed. MIPS has A LOT of gratuitous differences in constant definitions and I thought I'd caught all of them before, but apparently some slipped through. The fcntl part of the patch has been tested and seems correct. The socket parts should be right, but they're untested; I'm working on a test for them now. Rich --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mips.diff" diff --git a/arch/mips/bits/fcntl.h b/arch/mips/bits/fcntl.h index ad847f0..116852e 100644 --- a/arch/mips/bits/fcntl.h +++ b/arch/mips/bits/fcntl.h @@ -26,14 +26,14 @@ #define F_GETFL 3 #define F_SETFL 4 -#define F_SETOWN 8 -#define F_GETOWN 9 +#define F_SETOWN 24 +#define F_GETOWN 23 #define F_SETSIG 10 #define F_GETSIG 11 -#define F_GETLK 12 -#define F_SETLK 13 -#define F_SETLKW 14 +#define F_GETLK 33 +#define F_SETLK 34 +#define F_SETLKW 35 #define F_SETOWN_EX 15 #define F_GETOWN_EX 16 diff --git a/arch/mips/bits/socket.h b/arch/mips/bits/socket.h index 3715ddd..ba79045 100644 --- a/arch/mips/bits/socket.h +++ b/arch/mips/bits/socket.h @@ -18,3 +18,31 @@ struct cmsghdr #define SOCK_STREAM 2 #define SOCK_DGRAM 1 + +#define SOL_SOCKET 65535 + +#define SO_DEBUG 1 +#define SO_REUSEADDR 4 +#define SO_TYPE 0x1008 +#define SO_ERROR 0x1007 +#define SO_DONTROUTE 16 +#define SO_BROADCAST 32 +#define SO_SNDBUF 0x1001 +#define SO_RCVBUF 0x1002 +#define SO_KEEPALIVE 8 +#define SO_OOBINLINE 256 + +#define SO_NO_CHECK 11 +#define SO_PRIORITY 12 +#define SO_LINGER 128 +#define SO_BSDCOMPAT 14 +#define SO_REUSEPORT 512 +#define SO_PASSCRED 17 +#define SO_PEERCRED 18 +#define SO_RCVLOWAT 0x1004 +#define SO_SNDLOWAT 0x1003 +#define SO_RCVTIMEO 0x1006 +#define SO_SNDTIMEO 0x1005 + +#define SOCK_NONBLOCK 0200 +#define SOCK_CLOEXEC 02000000 diff --git a/include/sys/socket.h b/include/sys/socket.h index b138653..0a2f11d 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -47,8 +47,10 @@ struct linger #define SOCK_DCCP 6 #define SOCK_PACKET 10 +#ifndef SOCK_CLOEXEC #define SOCK_CLOEXEC 02000000 #define SOCK_NONBLOCK 04000 +#endif #define PF_UNSPEC 0 #define PF_LOCAL 1 @@ -126,6 +128,7 @@ struct linger #define AF_ALG PF_ALG #define AF_MAX PF_MAX +#ifndef SO_DEBUG #define SO_DEBUG 1 #define SO_REUSEADDR 2 #define SO_TYPE 3 @@ -147,6 +150,8 @@ struct linger #define SO_SNDLOWAT 19 #define SO_RCVTIMEO 20 #define SO_SNDTIMEO 21 +#endif + #define SO_SECURITY_AUTHENTICATION 22 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 @@ -163,7 +168,9 @@ struct linger #define SO_ACCEPTCONN 30 +#ifndef SOL_SOCKET #define SOL_SOCKET 1 +#endif #define SOL_RAW 255 #define SOL_DECNET 261 --ew6BAiZeqk4r7MaW--