aboutsummaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/posix_fallocate-fix.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-07-05 07:40:51 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-07-05 07:40:51 +0000
commit049753c09143a597a6b1cf15380d9a4271120fb7 (patch)
treeaaf3b36e81efb073d9409822d4cccfa7926bc079 /main/libc0.9.32/posix_fallocate-fix.patch
parentef170b15f32a55a84dd1bd725e440f918c5080c0 (diff)
downloadaports-049753c09143a597a6b1cf15380d9a4271120fb7.tar.bz2
aports-049753c09143a597a6b1cf15380d9a4271120fb7.tar.xz
main/libc0.9.32: fix/workaround posix_fallocate for x86
Might be a gcc bug, but the generated assembly code was broke. ebp was supposed to be set to zero but it was not. We work around it by allowing use of immedate values as the 6th syscall arg. Then gcc don't need to use a memory reference.
Diffstat (limited to 'main/libc0.9.32/posix_fallocate-fix.patch')
-rw-r--r--main/libc0.9.32/posix_fallocate-fix.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/main/libc0.9.32/posix_fallocate-fix.patch b/main/libc0.9.32/posix_fallocate-fix.patch
new file mode 100644
index 0000000000..3ff28a49e2
--- /dev/null
+++ b/main/libc0.9.32/posix_fallocate-fix.patch
@@ -0,0 +1,29 @@
+--- ./libc/sysdeps/linux/common/posix_fallocate.c.orig
++++ ./libc/sysdeps/linux/common/posix_fallocate.c
+@@ -22,11 +22,10 @@
+ uint32_t off_low = offset;
+ uint32_t len_low = len;
+ /* may assert that these >>31 are 0 */
+- uint32_t zero = 0;
+ INTERNAL_SYSCALL_DECL(err);
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0,
+- __LONG_LONG_PAIR (zero, off_low),
+- __LONG_LONG_PAIR (zero, len_low)));
++ __LONG_LONG_PAIR (0, off_low),
++ __LONG_LONG_PAIR (0, len_low)));
+ # elif __WORDSIZE == 64
+ INTERNAL_SYSCALL_DECL(err);
+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len));
+diff --git a/libc/sysdeps/linux/i386/bits/syscalls.h b/libc/sysdeps/linux/i386/bits/syscalls.h
+index 9fb4f35..566b5ac 100644
+--- a/libc/sysdeps/linux/i386/bits/syscalls.h
++++ b/libc/sysdeps/linux/i386/bits/syscalls.h
+@@ -136,7 +136,7 @@ __asm__ (
+ #define ASMFMT_5(arg1, arg2, arg3, arg4, arg5) \
+ , "a" (arg1), "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5)
+ #define ASMFMT_6(arg1, arg2, arg3, arg4, arg5, arg6) \
+- , "a" (arg1), "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5), "m" (arg6)
++ , "a" (arg1), "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5), "g" (arg6)
+
+ #else /* !PIC */
+