Bug#878705: opencv: FTBFS on x32: sysctl(.h) unsupported

Mattia Rizzolo mattia at debian.org
Mon Oct 16 07:39:17 UTC 2017


Hi Aaron,

On Sun, Oct 15, 2017 at 08:10:09PM -0400, Aaron M. Ucko wrote:
> Builds of opencv for x32 (admittedly not a release architecture) have
> been failing lately:
> 
>   In file included from /usr/include/x86_64-linux-gnux32/sys/sysctl.h:63:0,
>                    from /<<BUILDDIR>>/opencv-3.2.0+dfsg/modules/core/src/parallel.cpp:60:
>   /usr/include/x86_64-linux-gnux32/bits/sysctl.h:19:3: error: #error "sysctl system call is unsupported in x32 kernel"
> 
> Per sysctl(2), this interface is generally deprecated, so my
> recommendation would be to steer clear of it on any Linux
> architecture.  Could you please take a look?

I'm confused on why sysctl.h is included at all, actually:
#if defined __linux__ || defined __APPLE__
    #include <unistd.h>
    #include <stdio.h>
    #include <sys/types.h>
    #if defined __ANDROID__
        #include <sys/sysconf.h>
    #elif defined __APPLE__
        #include <sys/sysctl.h>
    #endif
#endif

why is it picked up?
Furthermore, we already have a patch to make it build with x32 (that
used to work), that modifies that code further:

#if defined __linux__ || defined __APPLE__ ||  defined __GLIBC__
    #include <unistd.h>
    #include <stdio.h>
    #include <sys/types.h>
    #if defined __ANDROID__
        #include <sys/sysconf.h>
    #elif defined __APPLE__ || !defined __GNU__
        #include <sys/sysctl.h>
    #elif !defined __GNU__
      #ifdef HAVE_SYS_SYSCTL_H
         #include <sys/sysctl.h>
      #endif
    #endif
#endif


HAVE_SYS_SYSCTL_H is false:
    -- Looking for sys/sysctl.h
    -- Looking for sys/sysctl.h - not found


Could you please have a look, and update that support_x32 patch?

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-science-maintainers/attachments/20171016/0fe0229e/attachment-0001.sig>


More information about the debian-science-maintainers mailing list