Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 675654 - sys-libs/compiler-rt-sanitizers-5.0.2 - lib/sanitizer_common/sanitizer_platform_limits_posix.cc:162:10: fatal error: 'sys/ustat.h' file not found
Summary: sys-libs/compiler-rt-sanitizers-5.0.2 - lib/sanitizer_common/sanitizer_platfo...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-16 22:49 UTC by Martin Mokrejš
Modified: 2019-01-18 22:04 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,63.58 KB, text/plain)
2019-01-16 22:49 UTC, Martin Mokrejš
Details
0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch (0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch,2.28 KB, patch)
2019-01-17 18:44 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2019-01-16 22:49:16 UTC
Hi,
  I get the following error:

# MAKEOPTS=-j1 emerge -uN1 clang
...
[53/528] /usr/lib/llvm/7/bin/x86_64-pc-linux-gnu-clang++ -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I/scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/work/compiler-rt-5.0.2.src/lib/sanitizer_common/..  -O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize -Wall -std=c++11 -Wno-unused-parameter    -O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize -Wall -std=c++11 -Wno-unused-parameter -m64 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fvisibility-inlines-hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o -c /scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/work/compiler-rt-5.0.2.src/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o 
/usr/lib/llvm/7/bin/x86_64-pc-linux-gnu-clang++ -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I/scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/work/compiler-rt-5.0.2.src/lib/sanitizer_common/..  -O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize -Wall -std=c++11 -Wno-unused-parameter    -O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize -Wall -std=c++11 -Wno-unused-parameter -m64 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fvisibility-inlines-hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o -c /scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/work/compiler-rt-5.0.2.src/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
/scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/work/compiler-rt-5.0.2.src/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:162:10: fatal error: 'sys/ustat.h' file not found
#include <sys/ustat.h>
         ^~~~~~~~~~~~~
1 error generated.
[54/528] /usr/lib/llvm/7/bin/x86_64-pc-linux-gnu-clang++ -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I/scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/work/compiler-rt-5.0.2.src/lib/sanitizer_common/..  -O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize -Wall -std=c++11 -Wno-unused-parameter    -O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize -Wall -std=c++11 -Wno-unused-parameter -m64 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fvisibility-inlines-hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_printf.cc.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_printf.cc.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_printf.cc.o -c /scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/work/compiler-rt-5.0.2.src/lib/sanitizer_common/sanitizer_printf.cc
ninja: build stopped: subcommand failed.
 * ERROR: sys-libs/compiler-rt-sanitizers-5.0.2::gentoo failed (compile phase):
 *   ninja -v -j2 -l0 failed
 * 
 * Call stack:
 *     ebuild.sh, line  124:  Called src_compile
 *   environment, line 3995:  Called cmake-utils_src_compile
 *   environment, line 1103:  Called cmake-utils_src_make
 *   environment, line 1284:  Called _cmake_ninja_src_make
 *   environment, line  410:  Called eninja
 *   environment, line 1614:  Called die
 * The specific snippet of code:
 *       "$@" || die "${nonfatal_args[@]}" "${*} failed"
 * 
 * If you need support, post the output of `emerge --info '=sys-libs/compiler-rt-sanitizers-5.0.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/compiler-rt-sanitizers-5.0.2::gentoo'`.
 * The complete build log is located at '/scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/temp/build.log'.
 * The ebuild environment file is located at '/scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/temp/environment'.
 * Working directory: '/scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/work/compiler-rt-sanitizers-5.0.2_build'
 * S: '/scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/work/compiler-rt-5.0.2.src'

>>> Failed to emerge sys-libs/compiler-rt-sanitizers-5.0.2, Log file:

>>>  '/scratch/var/tmp/portage/sys-libs/compiler-rt-sanitizers-5.0.2/temp/build.log'

# emerge --info
Portage 2.3.55 (python 2.7.15-final-0, default/linux/amd64/17.0, gcc-8.2.0, glibc-2.28-r5, 4.18.20-default-pciehp x86_64)
=================================================================
System uname: Linux-4.18.20-default-pciehp-x86_64-Intel-R-_Core-TM-_i7-2640M_CPU_@_2.80GHz-with-gentoo-2.6
KiB Mem:    16365804 total,   1506104 free
KiB Swap:   26853460 total,  26853460 free
Timestamp of repository gentoo: Wed, 16 Jan 2019 22:30:01 +0000
Head commit of repository gentoo: bce92b01d0a19e2fa4369625a2bbf73693cee136
sh bash 4.4_p23
ld GNU ld (Gentoo 2.30 p3) 2.30.0
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.9999::gentoo
dev-lang/python:          2.7.15::gentoo, 3.5.5-r1::gentoo, 3.6.6::gentoo, 3.7.0::gentoo
dev-util/cmake:           3.13.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.40.3::gentoo
sys-apps/sandbox:         2.15::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15.1-r1::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r3::gentoo, 2.31.1-r3::gentoo
sys-devel/gcc:            7.3.0-r6::gentoo, 8.2.0-r6::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.20::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r5::gentoo
Repositories:

gentoo
    location: /scratch/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24

science
    location: /scratch/mmokrejs/proj/sci
    masters: gentoo
    priority: 0

layman
    location: /var/lib/layman
    masters: gentoo
    priority: 1

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 2

haskell
    location: /var/lib/layman/haskell
    masters: gentoo
    priority: 50

vmware
    location: /var/lib/layman/vmware
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-bcla-java-vm Oracle-BCLA-JavaSE IBM-J1.6 skype-eula Nero-EULA-US AdobeFlash-10.3 skype-4.0.0.7-copyright AdobeFlash-11.x OPERA-2014 RAR Intel-SDP intel-ucode-20180807"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.2/conf /usr/share/maven-bin-3.3/conf /var/bind /var/lib/hsqldb /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.1/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize"
DISTDIR="/scratch/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news nostrip parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.mirror.web4u.cz/ rsync://gentoo.mirror.dkm.cz/gentoo/ ftp://gentoo.mirror.web4u.cz/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_US en_GB en cs"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
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="/scratch/var/tmp"
USE="R X acpi alsa amd64 amr apache apache2 asm avx berkdb bluetooth boost bzip2 cairo cgi cli coin consolekit cracklib crypt cryptlib cryptsetup cups cxx dbus device-mapper dhcp directfb dri drm dvd emboss encode fax fbcon ffmpeg flac fontconfig fortran fuse gbm gcrypt gd gdbm geoip geolocation gimp glpk gmp gnutls gpm gps gtk hal hpijs hwdb iconv id3tag imaging innodb inotify java javafx javascript jce jpeg jpg js jscript keymap ladspa lame lapack laptop lcms libnotify libtirpc lm_sensors mad matroska mmx modemmanager mp3 multicore multilib multimedia mysql ncurses networkmanager nfs nls nptl nptlonly nscd ntfs ntfsdecrypt ntfsprogs objc ocr ogg opengl openmp pam parport pcre pcre16 pdf pdfimport pdl perl php pkcs11 plplot png policykit polkit postproc postscript ppds ppp pppd pptx python qt3support qt4 qt5 readline rendering resolvconf samba scanner sctp seccomp server session sha512 slideshow smartcard sna sndfile sparsehash sqlite sse sse2 sse3 sse4_1 sse4_2 ssh ssh-agent ssl sslv2 sslv3 ssse3 startup-notification suexec svg syslog tcl tcpd threads tiff tk truetype twolame udev unicode upower usb v4l v4l2 vim-syntax vnc wavpack wifi x11 xattr xcb xml xorg xrandr xv xvid xvmc zlib" ABI_X86="64 32" 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="alias authz_host auth_basic auth_digest cgi cgid deflate dir env filter include info mem_cache mime mime_magic negotiation remoteip setenvif status userdir vhost_alias rewrite usertrack cache file_cache disk_cache charset_lite log_config log_forensic" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="aivdm ashtech earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 navcom ntrip oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tnt tripmate tsip ublox fury geostar nmea0183 nmea2000 passthrough" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="en-US en en-GB cs" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby20 ruby21 ruby23 ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="vesa vmware fbdev intel i915 i965" 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, LANG, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Martin Mokrejš 2019-01-16 22:49:34 UTC
Created attachment 561678 [details]
build.log
Comment 2 Martin Mokrejš 2019-01-16 22:52:36 UTC
Seems I have too new glibc.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-01-17 18:44:09 UTC
Created attachment 561862 [details, diff]
0001-sanitizer-Use-pre-computed-size-of-struct-ustat-for-.patch

I'm going to guess the following commit fixes it:

commit 521935db9de17ad08748fd050137ac83b7734835
Author: Craig Topper <craig.topper@intel.com>
Date:   Thu May 24 19:59:47 2018

    sanitizer: Use pre-computed size of struct ustat for Linux
    
    <sys/ustat.h> has been removed from glibc 2.28 by:
    
    commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7
    Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
    Date: Sun Mar 18 11:28:59 2018 +0800
    
    Deprecate ustat syscall interface
    This patch uses pre-computed size of struct ustat for Linux to fix
    
    https://bugs.llvm.org/show_bug.cgi?id=37418
    
    Patch by H.J. Lu.
    
    Differential Revision: https://reviews.llvm.org/D47281
    
    git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333213 91177308-0d34-0410-b5e6-96231b3b80d8


I've verified that it applies cleanly but I don't have the resources to build this old version right now.  Could you test the attached patch and let me know if it fixes the issue?
Comment 4 Martin Mokrejš 2019-01-18 21:51:42 UTC
Thank you for the patch, indeed, it applied and compiled now smoothly with 5.0.2, also 4.0.1. It was not needed for 6.0.1 to compile.

Seems I should drop the old versions accumulating on my system and keep just 7.0.1:

# emerge --unmerge compiler-rt-sanitizers
 * This action can remove important packages! In order to be safer, use
 * `emerge -pv --depclean <atom>` to check for reverse dependencies before
 * removing packages.

 sys-libs/compiler-rt-sanitizers
    selected: 4.0.0 4.0.1 5.0.0 5.0.1 5.0.2 6.0.0 6.0.1 7.0.0 7.0.1 
   protected: none 
     omitted: none 

All selected packages: =sys-libs/compiler-rt-sanitizers-5.0.0 =sys-libs/compiler-rt-sanitizers-7.0.0 =sys-libs/compiler-rt-sanitizers-7.0.1 =sys-libs/compiler-rt-sanitizers-6.0.1 =sys-libs/compiler-rt-sanitizers-6.0.0 =sys-libs/compiler-rt-sanitizers-5.0.2 =sys-libs/compiler-rt-sanitizers-4.0.0 =sys-libs/compiler-rt-sanitizers-4.0.1 =sys-libs/compiler-rt-sanitizers-5.0.1

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5^C
Comment 5 Larry the Git Cow gentoo-dev 2019-01-18 22:04:51 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=591e569f5896eefcfe2094b4f6e444d73dea6359

commit 591e569f5896eefcfe2094b4f6e444d73dea6359
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2019-01-17 18:44:36 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2019-01-18 22:04:43 +0000

    sys-libs/compiler-rt-sanitizers: Backport fix for sys/ustat.h
    
    Closes: https://bugs.gentoo.org/675654
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 .../compiler-rt-sanitizers-4.0.1.ebuild            |  4 ++
 .../compiler-rt-sanitizers-5.0.2.ebuild            |  4 ++
 ...se-pre-computed-size-of-struct-ustat-for-.patch | 61 ++++++++++++++++++++++
 3 files changed, 69 insertions(+)