* PATCH: m68k-linux: fchownat problem
@ 2010-11-05 15:16 Finn Thain
2010-11-05 20:50 ` Andreas Schwab
0 siblings, 1 reply; 2+ messages in thread
From: Finn Thain @ 2010-11-05 15:16 UTC (permalink / raw)
To: libc-ports; +Cc: Jakub Jelinek, Andreas Schwab
[Re-sent to libc-ports.]
Hi all,
This patch fixes a build failure that occurs with --enable-kernel higher
than 2.6.16:
/home/fthain/build/glibc-m68k-linux-gnu-3/libc_pic.os: In function `fchownat':
(.text+0x911c2): undefined reference to `__atfct_seterrno'
/home/fthain/gcc-4.4.1/lib/gcc/m68k-linux-gnu/4.4.1/../../../../m68k-linux-gnu/bin/ld:
/home/fthain/build/glibc-m68k-linux-gnu-3/libc.so: hidden symbol `__atfct_seterrno' isn't defined
/home/fthain/gcc-4.4.1/lib/gcc/m68k-linux-gnu/4.4.1/../../../../m68k-linux-gnu/bin/ld:
final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[1]: *** [/home/fthain/build/glibc-m68k-linux-gnu-3/libc.so] Error 1
make[1]: Leaving directory `/home/fthain/build/glibc-2.10.1'
make: *** [all] Error 2
The rather belated patch just mimics the changes Jakub made for some other
targets --
http://www.sourceware.org/ml/libc-hacker/2006-08/msg00004.html
I'm assuming it is appropriate for m68k also...
Regards,
Finn
2010-11-05 Finn Thain <fthain@telegraphics.com.au>
* sysdeps/unix/sysv/linux/m68k/fchownat.c (fchownat): Use
fchownat syscall if available.
--- glibc-2.5/ports/sysdeps/unix/sysv/linux/m68k/fchownat.c.orig 2007-09-18 00:25:39.000000000 +1000
+++ glibc-2.5/ports/sysdeps/unix/sysv/linux/m68k/fchownat.c 2007-09-18 00:38:21.000000000 +1000
@@ -40,6 +40,24 @@
int
fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
{
+ int result;
+
+#ifdef __NR_fchownat
+# ifndef __ASSUME_ATFCTS
+ if (__have_atfcts >= 0)
+# endif
+ {
+ result = INLINE_SYSCALL (fchownat, 5, fd, file, owner, group, flag);
+# ifndef __ASSUME_ATFCTS
+ if (result == -1 && errno == ENOSYS)
+ __have_atfcts = -1;
+ else
+# endif
+ return result;
+ }
+#endif
+
+#ifndef __ASSUME_ATFCTS
if (flag & ~AT_SYMLINK_NOFOLLOW)
{
__set_errno (EINVAL);
@@ -66,18 +84,17 @@
file = buf;
}
- int result;
INTERNAL_SYSCALL_DECL (err);
-#if __ASSUME_32BITUIDS > 0
+# if __ASSUME_32BITUIDS > 0
if (flag & AT_SYMLINK_NOFOLLOW)
result = INTERNAL_SYSCALL (lchown32, err, 3, CHECK_STRING (file), owner,
group);
else
result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner,
group);
-#else
-# ifdef __NR_chown32
+# else
+# ifdef __NR_chown32
if (__libc_missing_32bit_uids <= 0)
{
if (flag & AT_SYMLINK_NOFOLLOW)
@@ -94,7 +111,7 @@
__libc_missing_32bit_uids = 1;
}
-# endif /* __NR_chown32 */
+# endif /* __NR_chown32 */
if (((owner + 1) > (gid_t) ((__kernel_uid_t) -1U))
|| ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
@@ -109,7 +126,7 @@
else
result = INTERNAL_SYSCALL (chown, err, 3, CHECK_STRING (file), owner,
group);
-#endif
+# endif
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
{
@@ -117,6 +134,7 @@
__atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
result = -1;
}
+#endif
return result;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: m68k-linux: fchownat problem
2010-11-05 15:16 PATCH: m68k-linux: fchownat problem Finn Thain
@ 2010-11-05 20:50 ` Andreas Schwab
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2010-11-05 20:50 UTC (permalink / raw)
To: Finn Thain; +Cc: libc-ports, Jakub Jelinek
Finn Thain <fthain@telegraphics.com.au> writes:
> /home/fthain/build/glibc-m68k-linux-gnu-3/libc_pic.os: In function `fchownat':
> (.text+0x911c2): undefined reference to `__atfct_seterrno'
Thanks, I've checked in a fix.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-05 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-05 15:16 PATCH: m68k-linux: fchownat problem Finn Thain
2010-11-05 20:50 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).