From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9420 Path: news.gmane.org!not-for-mail From: "Rich Felker (dalias@libc.org)" Newsgroups: gmane.linux.lib.musl.general Subject: Re: MUSL MIPS64 N64 port Date: Mon, 29 Feb 2016 21:35:23 -0500 Message-ID: <20160301023523.GG9349@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1456799749 15004 80.91.229.3 (1 Mar 2016 02:35:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2016 02:35:49 +0000 (UTC) Cc: Mahesh Bodapati , "musl@lists.openwall.com" , "nsz@port70.net" To: Jaydeep Patil Original-X-From: musl-return-9433-gllmg-musl=m.gmane.org@lists.openwall.com Tue Mar 01 03:35:49 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aaaA8-0007qO-4l for gllmg-musl@m.gmane.org; Tue, 01 Mar 2016 03:35:48 +0100 Original-Received: (qmail 30497 invoked by uid 550); 1 Mar 2016 02:35:45 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30473 invoked from network); 1 Mar 2016 02:35:44 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:9420 Archived-At: Found functional bugs while building: On Fri, Feb 26, 2016 at 07:13:44AM +0000, Jaydeep Patil wrote: > +#define a_ll_p a_ll_p > +static inline int a_ll_p(volatile long *p) > +{ > + int v; > + __asm__ __volatile__ ( > + "lld %0, %1" > + : "=r"(v) : "m"(*p)); > + return v; > +} This is wrong and not working: ./src/internal/atomic.h:93:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion] a_ll_p must return the loaded value which has pointer type, not int. Also got: src/thread/pthread_create.c:212:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] stack = (void *)(attr._a_stackaddr & -16); This is because your pthread types are wrong; you're using the 32-bit arch ones: > +TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t; > +TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t; > +TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t; > +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t; > +TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t; > +TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t; > +TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t; These should be copied from aarch64 or x86_64 (should be same) instead. Nothing else showed up just from warnings but I'll take a second look at the source and see if anything else related looks wrong. Rich