Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 29 Feb 2016 21:35:23 -0500
From: "Rich Felker (dalias@...c.org)" <dalias@...c.org>
To: Jaydeep Patil <Jaydeep.Patil@...tec.com>
Cc: Mahesh Bodapati <Mahesh.Bodapati@...tec.com>,
	"musl@...ts.openwall.com" <musl@...ts.openwall.com>,
	"nsz@...t70.net" <nsz@...t70.net>
Subject: Re: MUSL MIPS64 N64 port

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.