diff mbox series

[uclibc-ng-devel] libc/sysdeps/linux/common/utime.c: fix riscv32 build

Message ID 20240519103844.345352-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [uclibc-ng-devel] libc/sysdeps/linux/common/utime.c: fix riscv32 build | expand

Commit Message

Fabrice Fontaine May 19, 2024, 10:38 a.m. UTC
Commit 48591e2a259d84247ae38f050bd58e6f7450bb77 forgot to update utime.c
resulting in the following riscv32 build failure with applications using
utime such as bzip2:

/home/buildroot/autobuild/instance-0/output-1/host/riscv32-buildroot-linux-uclibc/bin/ld.real: bzip2.o: in function `copyFileName':
bzip2.c:(.text+0x1fcc): undefined reference to `utime'

Fixes: 48591e2a259d84247ae38f050bd58e6f7450bb77
 - http://autobuild.buildroot.org/results/2e37d4e0bcef515fe9e643737419bfd26aa2833e

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 libc/sysdeps/linux/common/utime.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Waldemar Brodkorb May 21, 2024, 4:02 a.m. UTC | #1
Hi Fabrice,
Fabrice Fontaine wrote,

> Commit 48591e2a259d84247ae38f050bd58e6f7450bb77 forgot to update utime.c
> resulting in the following riscv32 build failure with applications using
> utime such as bzip2:
> 
> /home/buildroot/autobuild/instance-0/output-1/host/riscv32-buildroot-linux-uclibc/bin/ld.real: bzip2.o: in function `copyFileName':
> bzip2.c:(.text+0x1fcc): undefined reference to `utime'
> 
> Fixes: 48591e2a259d84247ae38f050bd58e6f7450bb77
>  - http://autobuild.buildroot.org/results/2e37d4e0bcef515fe9e643737419bfd26aa2833e
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Thanks, applied and pushed.

best regards
 Waldemar
diff mbox series

Patch

diff --git a/libc/sysdeps/linux/common/utime.c b/libc/sysdeps/linux/common/utime.c
index e4ac0b269..c716388e8 100644
--- a/libc/sysdeps/linux/common/utime.c
+++ b/libc/sysdeps/linux/common/utime.c
@@ -9,7 +9,7 @@ 
 #include <sys/syscall.h>
 #include <utime.h>
 
-#if defined __NR_utimensat && !defined __NR_utime
+#if (defined(__NR_utimensat) || defined(__NR_utimensat_time64)) && !defined __NR_utime
 # include <fcntl.h>
 # include <stddef.h>
 
@@ -51,7 +51,7 @@  int utime(const char *file, const struct utimbuf *times)
 }
 #endif
 
-#if (defined __NR_utimensat && !defined __NR_utime) || \
+#if ((defined(__NR_utimensat) || defined(__NR_utimensat_time64)) && !defined __NR_utime) || \
 	defined __NR_utime || defined __NR_utimes
 libc_hidden_def(utime)
 #endif