From 58668975669a8549c52a8075cf4358203f0e613d Mon Sep 17 00:00:00 2001 From: Vineet Gupta Date: Thu, 14 Mar 2013 17:51:23 +0530 Subject: utimes: Export utimensat based utimes sys/time.h has libc_hidden_proto(utimes) which generates the hidden "__GI_utimes" symbol reference, and common/utimes.c has a libc_hidden_def(utimes) which generates the exported "utimes" alias. As part of no-legacy-syscall kernel ABI, Commit 80dc2ed05 "utimes: Use utimensat if arch does not have the utimes syscall" introduced a new wrapper, but missed the corresponding libc_hidden_def, causing Busybox (1.20.0) link to fail (for ARC). Also don't generate a STUB, in that case. ---------------->8------------------- .... touch.c:(.text.touch_main+0xdc): undefined reference to `utimes' touch.c:(.text.touch_main+0x114): undefined reference to `utimes' libbb/lib.a(copy_file.o): In function `copy_file': copy_file.c:(.text.copy_file+0x446): undefined reference to `utimes' collect2: ld returned 1 exit status ---------------->8------------------- Signed-off-by: Vineet Gupta Cc: Markos Chandras Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/stubs.c | 2 ++ libc/sysdeps/linux/common/utimes.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c index 83bcf47f6..57c4664aa 100644 --- a/libc/sysdeps/linux/common/stubs.c +++ b/libc/sysdeps/linux/common/stubs.c @@ -448,10 +448,12 @@ make_stub(lutimes) # endif #endif +#ifndef __NR_utimensat #if !defined __NR_utime && !defined __NR_utimes /*make_stub(utime) obsoleted */ make_stub(utimes) #endif +#endif #if !defined __NR_umount && !defined __NR_umount2 && defined __UCLIBC_LINUX_SPECIFIC__ make_stub(umount) diff --git a/libc/sysdeps/linux/common/utimes.c b/libc/sysdeps/linux/common/utimes.c index a459d1508..b5e76cc59 100644 --- a/libc/sysdeps/linux/common/utimes.c +++ b/libc/sysdeps/linux/common/utimes.c @@ -51,6 +51,6 @@ int utimes(const char *file, const struct timeval tvp[2]) } #endif -#if defined __NR_utimes || defined __NR_utime +#if defined __NR_utimensat || defined __NR_utimes || defined __NR_utime libc_hidden_def(utimes) #endif -- cgit v1.2.3