Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 609034 - dev-util/cmake-3.7.2: utimensat call leads to ENOSYS on linux kernels older than 2.6.22
Summary: dev-util/cmake-3.7.2: utimensat call leads to ENOSYS on linux kernels older t...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-12 04:40 UTC by tkane1124
Modified: 2018-03-13 11:03 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,21.47 KB, text/plain)
2017-02-12 04:41 UTC, tkane1124
Details
environment (environment,137.10 KB, text/plain)
2017-02-12 04:43 UTC, tkane1124
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tkane1124 2017-02-12 04:40:22 UTC
I want to use dev-lang/R on gentoo/prefix.
But failed to build openjpeg-2.1.2 while emerge running.

Reproducible: Always

Steps to Reproduce:
1.emerge openjpeg
2.
3.
Actual Results:  
I got error messages as follows.
 * ERROR: media-libs/openjpeg-2.1.2::gentoo failed (compile phase):
 *   emake failed


Expected Results:  
No emerge error.

$ emerge --info
Portage 2.3.3 (python 2.7.12-final-0, prefix/linux-standalone/amd64/legacy, gcc-5.4.0, glibc-2.19-r1, 2.6.18-128.7.1.el5 x86_64)
=================================================================
System uname: Linux-2.6.18-128.7.1.el5-x86_64-Intel-R-_Xeon-R-_CPU_E5405_@_2.00GHz-with-redhat-5.3-Tikanga
KiB Mem:     8177256 total,   2076984 free
KiB Swap:   12582904 total,  12582792 free
Timestamp of repository gentoo: Sun, 12 Feb 2017 03:00:01 +0000
sh bash 4.4_p12
ld GNU ld (Gentoo 2.27 p1.0) 2.27
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.1_rc4::gentoo
dev-lang/python:          2.7.12::gentoo
dev-util/cmake:           3.7.2::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.69-r2::gentoo
sys-devel/automake:       1.15-r2::gentoo
sys-devel/binutils:       2.27::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo
sys-devel/gcc-config:     1.8_p20160608::rap
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.19-r1::rap
Repositories:

gentoo
    location: /home/kaneko/gentoo/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    eclass-overrides: rap

rap
    location: /home/kaneko/gentoo/usr/portage-stage
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/proj/android.git
    masters: gentoo
    eclass-overrides: rap

ACCEPT_KEYWORDS="amd64 ~amd64 ~amd64-linux"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -O2 -pipe"
DISTDIR="/home/kaneko/gentoo/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/home/kaneko/gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/home/kaneko/gentoo/"
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="/home/kaneko/gentoo/var/tmp"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 modules ncurses nls nptl openmp pcre prefix readline seccomp session ssl tcpd unicode zlib" ABI_X86="64" 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="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 tkane1124 2017-02-12 04:41:59 UTC
Created attachment 463398 [details]
build.log
Comment 2 tkane1124 2017-02-12 04:43:08 UTC
Created attachment 463400 [details]
environment
Comment 3 Benda Xu gentoo-dev 2017-02-12 08:10:47 UTC
I can reproduce this bug under RHEL-5.10, with linux 2.6.18-371.12.1.el5.

The bug is caused by cmake making utimensat syscall, with did not exist in linux before 2.6.22.

Relevant strace log is,

[pid 26029] access("/disk/usr100/gentoo-legacy/usr/bin/cmake-gui", R_OK) = -1 ENOENT (No such file or directory)
[pid 26029] access("/disk/usr100/gentoo-legacy/usr/bin/ccmake", R_OK) = 0
[pid 26029] access("/disk/usr100/gentoo-legacy/usr/bin/cmcldeps", R_OK) = -1 ENOENT (No such file or directory)
[pid 26029] access("/disk/usr100/gentoo-legacy/usr/share/cmake/Modules/CMake.cmake", R_OK) = 0
[pid 26029] access("bin/libopenjp2.so", R_OK) = 0
[pid 26029] utimensat(AT_FDCWD, "bin/libopenjp2.so", {UTIME_OMIT, UTIME_NOW}, 0) = -1 ENOSYS (Function not implemented)
[pid 26029] exit_group(1)               = ?
[pid 26029] +++ exited with 1 +++

@kde team, do you have experience running cmake on an old kernel like 2.6.18?
Comment 4 Michael Palimaka (kensington) gentoo-dev 2017-02-12 08:16:27 UTC
(In reply to Benda Xu from comment #3)
> @kde team, do you have experience running cmake on an old kernel like 2.6.18?

I doubt any of us have tested that configuration since 2.6 has not been shipped for quite some time.
Comment 5 Michael Palimaka (kensington) gentoo-dev 2017-06-24 13:55:16 UTC
I guess this call is from Source/kwsys/SystemTools.cxx:
#elif KWSYS_CXX_HAS_UTIMENSAT
  struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  if (utimensat(AT_FDCWD, filename.c_str(), times, 0) < 0) {
    return false;
  }
#else

Here's the test:
#ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
#include <fcntl.h>
#include <sys/stat.h>
int main()
{
  struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
}
#endif

So why is KWSYS_CXX_HAS_UTIMENSAT true when that syscall does not exist in <2.6.22?
Comment 6 Michael Palimaka (kensington) gentoo-dev 2017-06-24 13:57:54 UTC
Here's how we call cmake from cmake-utils.eclass:
"${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"

with CMAKE_BINARY set like this:
: ${CMAKE_BINARY:=cmake}

Is it possible that host cmake is being called instead of the prefix one?