| Summary: | dev-util/cmake-3.7.2: utimensat call leads to ENOSYS on linux kernels older than 2.6.22 | ||
|---|---|---|---|
| Product: | Gentoo/Alt | Reporter: | tkane1124 |
| Component: | Prefix Support | Assignee: | Gentoo Prefix <prefix> |
| Status: | RESOLVED NEEDINFO | ||
| Severity: | normal | CC: | kde |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | AMD64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
build.log
environment |
||
|
Description
tkane1124
2017-02-12 04:40:22 UTC
Created attachment 463398 [details]
build.log
Created attachment 463400 [details]
environment
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?
(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. 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?
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?
|