Control: retitle -1 cython: Wrong definition of st_dev in posix/stat.pxd on 
mips/mipsel

Hi,

On Mon, 01 Feb 2016 09:36:34 -0800 Nikolaus Rath <nikol...@rath.org> wrote:
> Package: cython
> Version: 0.23.2+git16-ga8fbae1-1+b1
> Severity: normal
> Tags: patch
> 
> On mips and mipsel, the st_dev and st_rdev members of struct stat do not
> have type dev_t. This breaks POSIX compatibility, but is difficult to fix
> (cf. https://sourceware.org/bugzilla/show_bug.cgi?id=17786).
> 
> When using Cython, this leads to conversation warnings in the generated
> C code.
> 
> A workaround is to change the definition of struct stat that is used by Cython
> when we are compiling under mips. The drawback is that this requires the 
> Cython
> compilation to run under mips, and that the resulting C file will be mips
> specific (without the patch, the generated C file is suitable for any
> architecture). However, I think this may be less of an issue for the Debian
> package, because we are building everything from source on the target
> architecture anyway (including regeneration of the C file from Cython code),
> and it only happens to mips/mipsel users.
> 
> Thoughts on including this patch in the Debian package?
> 
> --- a/Includes/posix/stat.pxd
> +++ b/Includes/posix/stat.pxd
> @@ -16,7 +16,25 @@ cdef extern from "sys/stat.h" nogil:
>          S_IFMT
>          S_IFDIR
>  
> -    struct stat:
> +IF UNAME_MACHINE.startswith('mips64'):

This is incorrect. The above dev_t bug you describe only occurs in the
o32 ABI. Your patch would "fix" all mips ABIs including n64 (ie
mips64el). As the ABI is tied to the compiler, the correct way to do
this is either a C preprocessor #if, or invoking the compiler and
asking it what the default ABI is. I don't know how easy it is to do in
cython though.

If it only prints warnings and nothing otherwise breaks, I don't think
this is a big issue though. Maybe the o32 ABI will be fixed one day...

James

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to