patches/uClibc/0.9.30.2/230-getdents-Fix-mips64-build.patch
author Cody P Schafer <dev@codyps.com>
Mon May 12 00:02:13 2014 +0200 (2014-05-12)
changeset 3322 eb13867a034c
permissions -rw-r--r--
arch/powerpc: add powerpc64le support

Technically, I don't forbid powerpcle support either, but I'm not sure that
there is any library/compiler support for that at the moment (though the hw
technically makes it possible).

powerpc64le needs glibc 2.19 and gcc 4.9. I haven't looked into the support
tools, but at least gdb 7.5 is too old (7.7.1 definitely has support).

Also make powerpc64 non-experimental. It's practically old at this point.

Signed-off-by: Cody P Schafer <dev@codyps.com>
[yann.morin.1998@free.fr: use ${target_endian_le} and ${target_bits_64}]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <64bfbbced9dd8f62e0d6.1399801945@gun>
Patchwork-Id: 347775
yann@1819
     1
From 13545bce877b33e30155fc412ad44cc118d83f77 Mon Sep 17 00:00:00 2001
yann@1819
     2
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
yann@1819
     3
Date: Sat, 30 Jan 2010 00:24:37 +0900
yann@1819
     4
Subject: [PATCH 15/15] getdents: Fix mips64 build
yann@1819
     5
yann@1819
     6
On Wed, 27 Jan 2010 07:14:08 +0100, Carmelo AMOROSO <carmelo.amoroso@st.com> wrote:
yann@1819
     7
> I would re-write your patch in a simpler way.
yann@1819
     8
>
yann@1819
     9
> We already have the following
yann@1819
    10
>
yann@1819
    11
> 136 #if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
yann@1819
    12
> 137 attribute_hidden strong_alias(__getdents,__getdents64)
yann@1819
    13
> 138 #endif
yann@1819
    14
>
yann@1819
    15
> I think that it's simpler to move in the proper place this statement.
yann@1819
    16
yann@1819
    17
Thanks, indeed.  If we came into "#elif WORDSIZE == 32" block, above
yann@1819
    18
condition never be true.  So we can just move this statement out of
yann@1819
    19
"#if...#elif...#elif...#endif" block.  Here is a revised patch.
yann@1819
    20
yann@1819
    21
------------------------------------------------------
yann@1819
    22
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
yann@1819
    23
Subject: [PATCH] getdents: Fix mips64 build
yann@1819
    24
yann@1819
    25
Some archs (such as mips64) do not have getdents64 syscall but have
yann@1819
    26
getdents syscall.  Define alias for it.
yann@1819
    27
yann@1819
    28
This fixes regression from 0.9.30.1.
yann@1819
    29
yann@1819
    30
Backgrounds:
yann@1819
    31
This is once done by commit e8b1c674.  But after the commit 33bcf733
yann@1819
    32
("Use getdents syscall if kernel provide supports for this instead of
yann@1819
    33
relying upon getdents64."), if __ASSUME_GETDENTS32_D_TYPE was defined
yann@1819
    34
the alias for getdents64 is not defined.  The macro
yann@1819
    35
__ASSUME_GETDENTS32_D_TYPE had been effectively ignored until 0.9.30.1
yann@1819
    36
but the commit 0f0f20ab ("Move kernel-features.h header from the
yann@1819
    37
linuxthread directory to a common one...") really enables it.
yann@1819
    38
yann@1819
    39
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
yann@1819
    40
Signed-off-by: Khem Raj <raj.khem@gmail.com>
yann@1819
    41
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
yann@1819
    42
---
yann@1819
    43
 libc/sysdeps/linux/common/getdents.c |    8 ++++----
yann@1819
    44
 1 files changed, 4 insertions(+), 4 deletions(-)
yann@1819
    45
yann@1819
    46
diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c
yann@1819
    47
index b518cc0..66a03b3 100644
yann@1819
    48
--- a/libc/sysdeps/linux/common/getdents.c
yann@1819
    49
+++ b/libc/sysdeps/linux/common/getdents.c
yann@1819
    50
@@ -136,10 +136,6 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes)
yann@1819
    51
     return (char *) dp - buf;
yann@1819
    52
 }
yann@1819
    53
 
yann@1819
    54
-#if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
yann@1819
    55
-attribute_hidden strong_alias(__getdents,__getdents64)
yann@1819
    56
-#endif
yann@1819
    57
-
yann@1819
    58
 #elif __WORDSIZE == 32
yann@1819
    59
 
yann@1819
    60
 /* Experimentally off - libc_hidden_proto(memmove) */
yann@1819
    61
@@ -171,4 +167,8 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes)
yann@1819
    62
 }
yann@1819
    63
 #endif
yann@1819
    64
 
yann@1819
    65
+#if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
yann@1819
    66
+attribute_hidden strong_alias(__getdents,__getdents64)
yann@1819
    67
+#endif
yann@1819
    68
+
yann@1819
    69
 #endif
yann@1819
    70
-- 
yann@1819
    71
1.6.6.1
yann@1819
    72