Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 736152

Summary: Disabling CONFIG_COMPAT_32BIT_TIME breaks multilib systems
Product: Gentoo Linux Reporter: Michelangelo Scopelliti <kernelpanic>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED CANTFIX    
Severity: normal CC: ionen, janpieter.sollie, jstein, mgorny, multilib+disabled, sam, toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=801313
https://bugs.gentoo.org/show_bug.cgi?id=801418
https://bugs.gentoo.org/show_bug.cgi?id=907778
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log
kernel configs

Description Michelangelo Scopelliti 2020-08-06 16:30:10 UTC
Configure phase shows the following messages:

llvm-config found: NO need '>= 3.9.0'
Run-time dependency LLVM found: NO (tried cmake and config-tool)
Looking for a fallback subproject for the dependency llvm

../mesa-20.1.5/meson.build:1423:2: ERROR: Subproject directory not found and llvm.wrap file not found
-----------
llvm 10.0.1 is installed;

emerge -pv mesa
[ebuild     U ] media-libs/mesa-20.1.5 [20.1.4] USE="X classic dri3 egl gallium gbm gles2 libglvnd llvm vulkan zstd -d3d9 -debug -gles1 -lm-sensors -opencl -osmesa (-selinux) -test -unwind -vaapi -valgrind -vdpau -vulkan-overlay -wayland -xa -xvmc" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="i965 intel iris (-freedreno) -i915 (-lima) -nouveau (-panfrost) -r100 -r200 -r300 -r600 -radeon -radeonsi (-vc4) -virgl (-vivante) -vmware"



Reproducible: Always




emerge --info

Portage 3.0.1 (python 3.7.8-final-0, default/linux/amd64/17.1, gcc-10.2.0, glibc-2.31-r6, 5.8.0 x86_64)
=================================================================
System uname: Linux-5.8.0-x86_64-Intel-R-_Core-TM-_i7-7700_CPU_@_3.60GHz-with-gentoo-2.7
KiB Mem:    32592392 total,    319552 free
KiB Swap:   33554428 total,  33548140 free
Head commit of repository gentoo: f22752d5c89481ddb1eda81cef7632ab4bcb217d

Head commit of repository libressl: 40e2ec24a753a94dbac9b2719ddee998c908563c

Head commit of repository ring-overlay: 4cdf2c9095598e772ed68f58433e7ecade05b6fc

sh bash 5.0_p18
ld GNU gold (Gentoo 2.34 p6 2.34.0) 1.16
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          2.7.18-r1::gentoo, 3.7.8-r2::gentoo, 3.8.5::gentoo, 3.9.0_beta5::gentoo
dev-util/cmake:           3.18.1::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.2::gentoo
sys-devel/binutils:       2.34-r2::gentoo
sys-devel/gcc:            10.2.0::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.8::gentoo (virtual/os-headers)
sys-libs/glibc:           2.31-r6::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo/gentoo.git
    priority: -1000

kernelpanic
    location: /var/db/repos/kernelpanic
    masters: gentoo
    priority: 0

libressl
    location: /var/db/repos/libressl
    sync-type: git
    sync-uri: https://github.com/gentoo/libressl.git
    masters: gentoo

ring-overlay
    location: /var/db/repos/ring-overlay
    sync-type: git
    sync-uri: https://github.com/stefan-langenmaier/ring-overlay.git
    masters: gentoo
    priority: 9999

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE @BINARY-REDISTRIBUTABLE @EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -mtune=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -mtune=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup clean-logs compress-build-logs config-protect-if-modified distlocks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-elog split-log strict unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -mtune=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="it_IT.UTF-8"
LDFLAGS="-Wl,-O2 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 ao berkdb blas bluray branding bzip2 cairo cdda cjk clang cli crypt cups curl dbus djvu dri dvb dvd elogind encode eselect-ldso exif ffmpeg fftw flac fontconfig fortran gdbm gif gimp gmp gnome-keyring gsm harfbuzz heif iconv icu imlib inotify ipv6 jbig jemalloc jit jpeg jpeg2k ladspa lapack latex lcms libass libnotify libressl libtirpc lto lv2 lz4 lzma lzo mms mng mp3 mpeg multilib natspec ncurses nls nptl nss offensive ogg openal opencl opencv openexr opengl openmp opus pam pango pcre pdf plotutils png policykit postproc postscript pulseaudio raw readline scanner seccomp smp sndfile sound sox speex spell spice split-usr ssl startup-notification svg theora threads tiff truetype udev udisks unicode usb vaapi vim-syntax vorbis vpx vulkan wavpack webp wmf x264 xattr xcb xcomposite xml xmp xpm xv xvid zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="libressl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="it en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby27" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="intel i965 iris" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Matt Turner gentoo-dev 2020-08-10 23:15:48 UTC
Please post a build log.
Comment 2 Michelangelo Scopelliti 2020-08-11 11:07:52 UTC
Created attachment 654108 [details]
build log

attached.
Comment 3 Michelangelo Scopelliti 2020-08-15 11:54:06 UTC
OK, I think I found the cause of my problem.
A few days ago I switched to kernel 5.8.0 and unset CONFIG_COMPAT_32BIT_TIME. This caused the issue. Setting it to "y" again fixed the mesa issue.

How  I got it? simple; the problem was llvm? OK, let's rebuild it. Rebuilding fails with a "The futex facility returned an unexpected error"? OK, let's rebuild the whole system.

Again, the futex error shows up (at least) for llvm, wine-vanilla, icu and so on. A little bit of digging and...

So, long story short, maybe a check on CONFIG_COMPAT_32BIT_TIME on multiarch systems could help (at least on icu and llvm).

What do you think?
Comment 4 Matt Turner gentoo-dev 2020-08-15 17:53:33 UTC
(In reply to Michelangelo Scopelliti from comment #3)
> So, long story short, maybe a check on CONFIG_COMPAT_32BIT_TIME on multiarch
> systems could help (at least on icu and llvm).

Something for multilib@ and toolchain@ I think.
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-15 19:45:03 UTC
Also, build.log does not look complete as I don't see actual USE-flags being used when mesa is built. Can you upload full build.log?

Comparing to my system where things seem to work I see a few differences that may or may not matter:

1. I use ld.bfd, failed build.log has ld.gold
2. I use pkg-config, but.log uses pkgconf
3. My log claims to detect llvm-config, build.log's don't:

  good:

"""
llvm-config found: YES (/usr/lib/llvm/10/bin/i686-pc-linux-gnu-llvm-config) 10.0.1
"""

  bad:

"""
WARNING: Ignoring LLVM CMake dependency because dynamic was requested
llvm-config found: NO need '>= 3.9.0'
Run-time dependency LLVM found: NO (tried cmake and config-tool)
"""

But it's probably due to USE flags difference.

Would be nice to find exact command that changes output based on CONFIG_COMPAT_32BIT_TIME to debug why failure happens. Then we can decide there appropriate fix belongs.
Comment 6 Michelangelo Scopelliti 2020-09-07 18:11:55 UTC
(In reply to Sergei Trofimovich from comment #5)

Sorry for my delay, in the last week I had a few issues with my internet connection -- still having, but now I can answer.

> Also, build.log does not look complete as I don't see actual USE-flags being
> used when mesa is built. Can you upload full build.log?

The build log is full -- I mean, it is the build log I find in /var/log/portage/build/media-libs/.

about the USE-flags, emerge -pqv mesa (now, new version, same issue)

[ebuild   R   ] media-libs/mesa-20.2.0_rc4  USE="X classic dri3 egl gallium gbm gles2 (libglvnd) llvm vulkan zstd -d3d9 -debug -gles1 -lm-sensors -opencl -osmesa (-selinux) -test -unwind -vaapi -valgrind -vdpau -vulkan-overlay -wayland -xa -xvmc -zink" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="i965 intel iris (-freedreno) -i915 (-lima) -nouveau (-panfrost) -r100 -r200 -r300 -r600 -radeon -radeonsi (-v3d) (-vc4) -virgl (-vivante) -vmware"

> 
> Comparing to my system where things seem to work I see a few differences
> that may or may not matter:
> 
> 1. I use ld.bfd, failed build.log has ld.gold

I thought that could be an issue too. So I rebuilt my system with bfd as default; the issue remains.

> 2. I use pkg-config, but.log uses pkgconf

In the past I had issue with gold, but pkgconf reads the same files as pkg-config, with the same output, and without glib dependency. I don't thik it' the responsible here

> 3. My log claims to detect llvm-config, build.log's don't:

$ ls -l `which llvm-config`
lrwxrwxrwx 1 root root 31 25 ago 19.32 /usr/lib/llvm/10/bin/llvm-config -> x86_64-pc-linux-gnu-llvm-config

> 
>   good:
> 
> """
> llvm-config found: YES (/usr/lib/llvm/10/bin/i686-pc-linux-gnu-llvm-config)
> 10.0.1
> """
> 
>   bad:
> 
> """
> WARNING: Ignoring LLVM CMake dependency because dynamic was requested
> llvm-config found: NO need '>= 3.9.0'
> Run-time dependency LLVM found: NO (tried cmake and config-tool)
> """
> 
> But it's probably due to USE flags difference.

Well, isn't that the issue?

> 
> Would be nice to find exact command that changes output based on
> CONFIG_COMPAT_32BIT_TIME to debug why failure happens. Then we can decide
> there appropriate fix belongs.

As a counte- proof: I've just compiled a kernel with CONFIG_COMPAT_32BIT_TIME unset, and I had the same error. No issues at all (both with gold and bfd) if CONFIG_COMPAT_32BIT_TIME is set. I will upload both kernel configurations.
Comment 7 Michelangelo Scopelliti 2020-09-07 18:14:10 UTC
Created attachment 659018 [details]
kernel configs

besides the date, the only difference was setting CONFIG_COMPAT_32BIT_TIME (via nconfig)
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2020-09-07 18:58:27 UTC
(In reply to Michelangelo Scopelliti from comment #6)
> (In reply to Sergei Trofimovich from comment #5)
> 
> Sorry for my delay, in the last week I had a few issues with my internet
> connection -- still having, but now I can answer.
> 
> > Also, build.log does not look complete as I don't see actual USE-flags being
> > used when mesa is built. Can you upload full build.log?
> 
> The build log is full -- I mean, it is the build log I find in
> /var/log/portage/build/media-libs/.

Oh, yeah. Build.log looks fine. Don't know where I looked. My apologies.

> > 2. I use pkg-config, but.log uses pkgconf
> 
> In the past I had issue with gold, but pkgconf reads the same files as
> pkg-config, with the same output, and without glib dependency. I don't thik
> it' the responsible here

It might not be it but pkgconf is known to deviate slightly from pkg-config (like i bug #703932). But given you can consistently fil the error on and off with kernel option points at the build system problem.

> > 3. My log claims to detect llvm-config, build.log's don't:
> 
> $ ls -l `which llvm-config`
> lrwxrwxrwx 1 root root 31 25 ago 19.32 /usr/lib/llvm/10/bin/llvm-config ->
> x86_64-pc-linux-gnu-llvm-config
> 
> > 
> >   good:
> > 
> > """
> > llvm-config found: YES (/usr/lib/llvm/10/bin/i686-pc-linux-gnu-llvm-config)
> > 10.0.1
> > """
> > 
> >   bad:
> > 
> > """
> > WARNING: Ignoring LLVM CMake dependency because dynamic was requested
> > llvm-config found: NO need '>= 3.9.0'
> > Run-time dependency LLVM found: NO (tried cmake and config-tool)
> > """
> > 
> > But it's probably due to USE flags difference.
> 
> Well, isn't that the issue?

Maybe. Depends on whether you have or don't have /usr/lib/llvm/10/bin/i686-pc-linux-gnu-llvm-config file. Not clear if the file is missing onr 'stat' on it is somehow broken.

> > Would be nice to find exact command that changes output based on
> > CONFIG_COMPAT_32BIT_TIME to debug why failure happens. Then we can decide
> > there appropriate fix belongs.
> 
> As a counte- proof: I've just compiled a kernel with
> CONFIG_COMPAT_32BIT_TIME unset, and I had the same error. No issues at all
> (both with gold and bfd) if CONFIG_COMPAT_32BIT_TIME is set. I will upload
> both kernel configurations.

Great you have found a trigger! Now we'll need to find what is broken by it.

Given that by default 'time_t' is still 32-bit on i686-glibc I suspect glibc still uses 32-bit syscalls.

Specifically kernel says:

arch/Kconfig:config COMPAT_32BIT_TIME
arch/Kconfig-   bool "Provide system calls for 32-bit time_t"
arch/Kconfig-   default !64BIT || COMPAT
arch/Kconfig-   help
arch/Kconfig-     This enables 32 bit time_t support in addition to 64 bit time_t support.
arch/Kconfig-     This is relevant on all 32-bit architectures, and 64-bit architectures
arch/Kconfig-     as part of compat syscall handling.

and seems to guard the presence of the following syscalls:

- a bunch of v4l2 IOCTLs like VIDIOC_DQEVENT_TIME32
- io_pgetevents_time32, io_getevents_time32, io_pgetevents
- pselect6_time32, ppoll_time32
- timerfd_settime32
- utime32
- semtimedop
- futex
- sched_rr_get_interval_time32, rt_sigtimedwait_time32,
- hrtimer IOCTLs
- clock_settime32, timer_gettime32, clock_nanosleep_time32, time32
- recvmmsg_time32

I suspect things like futex and time32 break a lot of 32-bit programs for you (or 64-bit programs with 32-bit interfaces, unlikely). They just don't get called at build time most of time time.
Comment 9 Janpieter Sollie 2020-09-15 18:27:47 UTC
*** Bug 742257 has been marked as a duplicate of this bug. ***
Comment 10 Matt Turner gentoo-dev 2020-10-14 22:52:06 UTC
(In reply to Michelangelo Scopelliti from comment #7)
> Created attachment 659018 [details]
> kernel configs
> 
> besides the date, the only difference was setting CONFIG_COMPAT_32BIT_TIME
> (via nconfig)

Are you planning to follow up?
Comment 11 Michelangelo Scopelliti 2020-10-16 17:28:10 UTC
(In reply to Matt Turner from comment #10)
> (In reply to Michelangelo Scopelliti from comment #7)
> > Created attachment 659018 [details]
> > kernel configs
> > 
> > besides the date, the only difference was setting CONFIG_COMPAT_32BIT_TIME
> > (via nconfig)
> 
> Are you planning to follow up?

I don't know how. It seems to me that  multiarch system could benefit from something like

inherit linux-info
...
CONFIG_CHECK="COMPAT_32BIT_TIME"

at least for mesa, icu, llvm and wine; what else can I add?
Comment 12 Matt Turner gentoo-dev 2020-10-16 18:04:53 UTC
(In reply to Michelangelo Scopelliti from comment #11)
> (In reply to Matt Turner from comment #10)
> > (In reply to Michelangelo Scopelliti from comment #7)
> > > Created attachment 659018 [details]
> > > kernel configs
> > > 
> > > besides the date, the only difference was setting CONFIG_COMPAT_32BIT_TIME
> > > (via nconfig)
> > 
> > Are you planning to follow up?
> 
> I don't know how. It seems to me that  multiarch system could benefit from
> something like
> 
> inherit linux-info
> ...
> CONFIG_CHECK="COMPAT_32BIT_TIME"
> 
> at least for mesa, icu, llvm and wine; what else can I add?

Sorry, I thought Sergei had requested some information from you. I misread, my fault.
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2021-07-10 08:32:15 UTC
https://bugs.gentoo.org/801313#c11 makes a good case to add the check to glibc itself.
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-07-10 08:55:40 UTC
(In reply to Sergei Trofimovich from comment #13)
> https://bugs.gentoo.org/801313#c11 makes a good case to add the check to
> glibc itself.

However, it probably won't be a good enough solution.  After all, people don't usually rebuild glibc after upgrading the kernel.
Comment 15 Mike Pagano gentoo-dev 2021-08-26 22:32:34 UTC
toolchain,  not sure if you want to resolve this, or resolve as invalid like the reference bug in comment #13
Comment 16 Mike Gilbert gentoo-dev 2023-07-22 01:43:23 UTC
Unfortunately, I think there is really no good place to put a kernel config check for this option.

I updated the AMD64 handbook to indicate that the option is required for multilib systems. I think that's about the best we can do.