utimes problem uclibc update time is zero

Thank you for opening a new issue. To help solve it faster and more easily, please review this check-list, and fill in the sections below. Adapt as needed.

Do not open an issue to request a new feature; instead, post a message to the mailing list.

Note: issues missing any information may get closed without further ado.


Check-list

  • I did not find the issue in the existing issues
  • I can reproduce the issue with unmodified Buildroot from this repository, not from a fork somewhere else
  • I can reproduce the issue on the latest commit of the branch I'm using:
    • master
    • stable (i.e. 20NN.MM.x - please specify)
    • LTS (i.e. 20NN.02.x - please specify)
  • I can reproduce the issue after running make clean; make
  • I attached the full build log file (e.g. make 2>&1 |tee build.log)
  • I attached a minimal defconfig file that can reproduce the issue (make BR2_DEFCONFIG=$(pwd)/issue_defconfig savedefconfig)
  • I also attached the configuration for kconfig-based packages that are enabled (and necessary to reproduce the issue), most notably:
    • busybox
    • linux
    • uclibc
    • uboot

I think this is a problem with uclibc-ng or busybox. buildoot 2025.02.4 1750696300 ARM 32bit
linux-5.15.186 (kernel.org) sorry I couldn't trace it to the kernel API. When I tried to maintain mdate with “cp -p”, 0 was set. Does not occur in glibc or musl. In the case of uclibc-ng, utimes is called, but the modification time is set to 0. Similarly, if utimes is called directly, the update time will be overwritten to 0. In musl, utimensat is called and the update time is maintained normally.

strace cp -p ./aaa ./bbb

open("./aaa", O_RDONLY|O_LARGEFILE) = 3 open("./bbb", O_WRONLY|O_CREAT|O_EXCL|O_LARGEFILE, 0100644) = -1 EEXIST (File exists) unlink("./bbb") = 0 open("./bbb", O_WRONLY|O_CREAT|O_EXCL|O_LARGEFILE, 0100644) = 4 sendfile64(4, 3, NULL, 16777216) = 0 close(4) = 0 close(3) = 0 utimes("./bbb", [{tv_sec=1751791488, tv_usec=0} /* 2025-07-06T08:44:48+0000 */, {tv_sec=0, tv_usec=0}]) = 0 chown32("./bbb", 0, 0) = 0 chmod("./bbb", 0100644) = 0 exit_group(0) = ? +++ exited with 0 +++

ls -la

total 52 drwxrwxrwt 2 root root 160 Jul 6 09:06 . drwxr-xr-x 20 root root 0 Jan 1 1970 .. -rw-r--r-- 1 root root 0 Jul 6 08:44 aaa -rw-r--r-- 1 root root 0 Jan 1 1970 bbb

.config