Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 649746 - x11-libs/libdrm-2.4.91 - In file included from /usr/include/sys/sysctl.h:63:0, from ../libdrm-2.4.91/xf86drmMode.c:50: /usr/include/bits/sysctl.h:19:3: error: #error "sysctl system call is unsupported in x32 kernel"
Summary: x11-libs/libdrm-2.4.91 - In file included from /usr/include/sys/sysctl.h:63:0...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-06 14:12 UTC by EoD
Modified: 2018-07-17 17:12 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
libdrm-2.4.91:20180306-140037.log (libdrm-2.4.91:20180306-140037.log,75.17 KB, text/plain)
2018-03-06 14:12 UTC, EoD
Details
workaround patch... (libdrm-x32.patch,386 bytes, patch)
2018-03-06 21:54 UTC, iGentoo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description EoD 2018-03-06 14:12:53 UTC
Created attachment 522512 [details]
libdrm-2.4.91:20180306-140037.log

Apparently the build system changed at 2.4.91 to meson and this causes the following build error:

> [4/31] Compiling C object 'drm@sha/xf86drmMode.c.o'.
> FAILED: drm@sha/xf86drmMode.c.o 
> x86_64-pc-linux-gnu-gcc -mx32  -Idrm@sha -I. -I../libdrm-2.4.91 -I../libdrm-2.4.91/include/drm -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -DHAVE_CONFIG_H -ggdb -O2 -march=skylake -fPIC -Wall -Wextra -Wsign-compare -Werror=undef -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wstrict-aliasing=2 -Winit-self -Winline > -Wshadow -Wdeclaration-after-statement -Wold-style-definition -Wno-unused-parameter -Wno-attributes -Wno-long-long -Wno-missing-field-initializers -MMD -MQ 'drm@sha/xf86drmMode.c.o' -MF 'drm@sha/xf86drmMode.c.o.d' -o 'drm@sha/xf86drmMode.c.o' -c ../libdrm-2.4.91/xf86drmMode.c
> In file included from /usr/include/sys/sysctl.h:63:0,
>                  from ../libdrm-2.4.91/xf86drmMode.c:50:
> /usr/include/bits/sysctl.h:19:3: error: #error "sysctl system call is unsupported in x32 kernel"
>  # error "sysctl system call is unsupported in x32 kernel"
>    ^~~~~
> [13/31] Compiling C object 'tests/modetest/modetest@exe/modetest.c.o'.
> ninja: build stopped: subcommand failed.

As this seems to be related to the build system and maybe its config, I will report it here instead of upstream.
Comment 1 Matt Turner gentoo-dev 2018-03-06 19:00:40 UTC
Cc'ing Dylan, the author of the Meson build system in libdrm.

Dylan, I switched to using Meson for 2.4.91 in Gentoo. Presumably the reporter did not see this bug with 2.4.90, using autotools.

The contents of /usr/include/bits/sysctl.h are just

#if defined __x86_64__ && defined __ILP32__
# error "sysctl system call is unsupported in x32 kernel"
#endif

so it will not compile on x32.

configure.ac has

AC_CHECK_HEADERS([sys/sysctl.h sys/select.h])

meson.build has

if cc.has_header('sys/sysctl.h')
  config.set10('HAVE_SYS_SYSCTL_H', true)
endif

The docs for AC_CHECK_HEADER [1] indicate that the files are tested to see whether they are "compilable" rather than just for existence. That looks to be the difference causing this bug -- autotools tries to compile sys/sysctl.h and fails while Meson just checks that the file exists.

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.62/html_node/Generic-Headers.html
Comment 2 Dylan 2018-03-06 19:59:12 UTC
Interesting, meson's compiler.has_header does do a compilation on the header in question, but I think it's not getting the -mx32 flag passed for some reason

How is the -m32 and -mx32 being passed, is that part of the compiler alias, it doesn't look like it's being passed as C{XX,PP}FLAGS. if -m32 is passed either in a cross file or as a C{XX,PP}FLAG then it should work.
Comment 3 iGentoo 2018-03-06 21:54:00 UTC
Created attachment 522628 [details, diff]
workaround patch...
Comment 4 Dylan 2018-03-06 21:58:50 UTC
Is that tested? if it is this is a meson bug.
Comment 5 Dylan 2018-03-06 22:00:09 UTC
Also, I don't have x32 in my kernel so this is hard for me to test, could someone attach the meson log in <builddir>/meson-logs/meson-log.txt?
Comment 6 Dylan 2018-03-06 22:22:22 UTC
Okay, this is a meson bug, although I don't think they see at as one.

https://github.com/mesonbuild/meson/issues/2246

I'll update libdrm and mesa to stop using cc.has_header.
Comment 7 EoD 2018-03-07 18:14:57 UTC
(In reply to Dylan from comment #6)
> Okay, this is a meson bug, although I don't think they see at as one.
> 
> https://github.com/mesonbuild/meson/issues/2246
> 
> I'll update libdrm and mesa to stop using cc.has_header.

Can we use autotools in Gentoo until a new version without cc.has_header has been released?
Comment 8 Larry the Git Cow gentoo-dev 2018-05-09 22:42:29 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24ff291d7990d3bf7c8706f37fd8eb92b919e641

commit 24ff291d7990d3bf7c8706f37fd8eb92b919e641
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2018-05-09 22:39:57 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2018-05-09 22:42:04 +0000

    x11-libs/libdrm: Version bump to 2.4.92
    
    Closes: https://bugs.gentoo.org/649746

 x11-libs/libdrm/Manifest             |  1 +
 x11-libs/libdrm/libdrm-2.4.92.ebuild | 77 ++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+)
Comment 9 Nick Bowler 2018-07-17 17:12:58 UTC
This isn't really fixed yet because 2.4.91 is still the latest stable on amd64, right?