devel
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- 1 participants
- 1176 discussions
uClibc-ng - small C library for embedded systems branch master updated. v1.0.15-6-gc0f118c
by wbx@helium.openadk.org 03 Jun '16
by wbx@helium.openadk.org 03 Jun '16
03 Jun '16
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via c0f118c8869b9095612dfcc4a279e957b67a8efa (commit)
from 493d0cc28b0d0fa1dc571ffc876b554376ccdd47 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c0f118c8869b9095612dfcc4a279e957b67a8efa
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Fri Jun 3 17:24:03 2016 +0200
ppc: cleanup unsupported ppc64 code
Remove ppc64 bits and bytes, as we don't support ppc64 and
it makes the code more readable without the dead code.
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/powerpc/README.bits | 14 --
libc/sysdeps/linux/powerpc/bits/atomic.h | 252 --------------------------
libc/sysdeps/linux/powerpc/bits/mathinline.h | 76 --------
libc/sysdeps/linux/powerpc/bits/setjmp.h | 7 +-
libc/sysdeps/linux/powerpc/bits/stat.h | 108 +----------
libc/sysdeps/linux/powerpc/bits/wordsize.h | 7 +-
libc/sysdeps/linux/powerpc/jmpbuf-offsets.h | 25 +--
libc/sysdeps/linux/powerpc/powerpc32/sysdep.h | 151 ---------------
libc/sysdeps/linux/powerpc/powerpc64/sysdep.h | 243 -------------------------
libc/sysdeps/linux/powerpc/sys/ucontext.h | 78 --------
libc/sysdeps/linux/powerpc/sysdep.h | 104 +++++++++--
11 files changed, 102 insertions(+), 963 deletions(-)
delete mode 100644 libc/sysdeps/linux/powerpc/README.bits
delete mode 100644 libc/sysdeps/linux/powerpc/powerpc32/sysdep.h
delete mode 100644 libc/sysdeps/linux/powerpc/powerpc64/sysdep.h
diff --git a/libc/sysdeps/linux/powerpc/README.bits b/libc/sysdeps/linux/powerpc/README.bits
deleted file mode 100644
index c0542e5..0000000
--- a/libc/sysdeps/linux/powerpc/README.bits
+++ /dev/null
@@ -1,14 +0,0 @@
-
-include/bits is mostly the same as glibc-2.2.4. The glibc-2.2.4
-versions can be accessed with the tag glibc224.
-
-Major differences:
-
- - termios.h is from the Linux kernel, not glibc, because glibc has
- a very strange legacy conversion layer, which we ignore.
-
- - syscall.h is deleted; instead, sysnum.h is autogenerated in uClibc
-
- - syscalls.h is added.
-
-
diff --git a/libc/sysdeps/linux/powerpc/bits/atomic.h b/libc/sysdeps/linux/powerpc/bits/atomic.h
index a401206..4294fb2 100644
--- a/libc/sysdeps/linux/powerpc/bits/atomic.h
+++ b/libc/sysdeps/linux/powerpc/bits/atomic.h
@@ -1,247 +1,3 @@
-/* Atomic operations. PowerPC Common version.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Paul Mackerras <paulus(a)au.ibm.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-/* Atomic operations. PowerPC64 version.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Paul Mackerras <paulus(a)au.ibm.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* The 32-bit exchange_bool is different on powerpc64 because the subf
- does signed 64-bit arthmatic while the lwarx is 32-bit unsigned
- (a load word and zero (high 32) form) load.
- In powerpc64 register values are 64-bit by default, including oldval.
- The value in old val unknown sign extension, lwarx loads the 32-bit
- value as unsigned. So we explicitly clear the high 32 bits in oldval. */
-# define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
-({ \
- unsigned int __tmp, __tmp2; \
- __asm__ __volatile__ (" clrldi %1,%1,32\n" \
- "1: lwarx %0,0,%2\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
- " stwcx. %4,0,%2\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
- : "=&r" (__tmp), "=r" (__tmp2) \
- : "b" (mem), "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
-})
-
-# define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval) \
-({ \
- unsigned int __tmp, __tmp2; \
- __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \
- " clrldi %1,%1,32\n" \
- "1: lwarx %0,0,%2\n" \
- " subf. %0,%1,%0\n" \
- " bne 2f\n" \
- " stwcx. %4,0,%2\n" \
- " bne- 1b\n" \
- "2: " \
- : "=&r" (__tmp), "=r" (__tmp2) \
- : "b" (mem), "1" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
-})
-
-/*
- * Only powerpc64 processors support Load doubleword and reserve index (ldarx)
- * and Store doubleword conditional indexed (stdcx) instructions. So here
- * we define the 64-bit forms.
- */
-# define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
-({ \
- unsigned long __tmp; \
- __asm__ __volatile__ ( \
- "1: ldarx %0,0,%1\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
- " stdcx. %3,0,%1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
- : "=&r" (__tmp) \
- : "b" (mem), "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
-})
-
-# define __arch_compare_and_exchange_bool_64_rel(mem, newval, oldval) \
-({ \
- unsigned long __tmp; \
- __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \
- "1: ldarx %0,0,%1\n" \
- " subf. %0,%2,%0\n" \
- " bne 2f\n" \
- " stdcx. %3,0,%1\n" \
- " bne- 1b\n" \
- "2: " \
- : "=&r" (__tmp) \
- : "b" (mem), "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp != 0; \
-})
-
-#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
- ({ \
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm__ __volatile__ ( \
- "1: ldarx %0,0,%1\n" \
- " cmpd %0,%2\n" \
- " bne 2f\n" \
- " stdcx. %3,0,%1\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
- : "=&r" (__tmp) \
- : "b" (__memp), "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-
-#define __arch_compare_and_exchange_val_64_rel(mem, newval, oldval) \
- ({ \
- __typeof (*(mem)) __tmp; \
- __typeof (mem) __memp = (mem); \
- __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \
- "1: ldarx %0,0,%1\n" \
- " cmpd %0,%2\n" \
- " bne 2f\n" \
- " stdcx. %3,0,%1\n" \
- " bne- 1b\n" \
- "2: " \
- : "=&r" (__tmp) \
- : "b" (__memp), "r" (oldval), "r" (newval) \
- : "cr0", "memory"); \
- __tmp; \
- })
-
-# define __arch_atomic_exchange_64_acq(mem, value) \
- ({ \
- __typeof (*mem) __val; \
- __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \
- "1: ldarx %0,0,%2\n" \
- " stdcx. %3,0,%2\n" \
- " bne- 1b\n" \
- " " __ARCH_ACQ_INSTR \
- : "=&r" (__val), "=m" (*mem) \
- : "b" (mem), "r" (value), "m" (*mem) \
- : "cr0", "memory"); \
- __val; \
- })
-
-# define __arch_atomic_exchange_64_rel(mem, value) \
- ({ \
- __typeof (*mem) __val; \
- __asm__ __volatile__ (__ARCH_REL_INSTR "\n" \
- "1: ldarx %0,0,%2\n" \
- " stdcx. %3,0,%2\n" \
- " bne- 1b" \
- : "=&r" (__val), "=m" (*mem) \
- : "b" (mem), "r" (value), "m" (*mem) \
- : "cr0", "memory"); \
- __val; \
- })
-
-# define __arch_atomic_exchange_and_add_64(mem, value) \
- ({ \
- __typeof (*mem) __val, __tmp; \
- __asm__ __volatile__ ("1: ldarx %0,0,%3\n" \
- " add %1,%0,%4\n" \
- " stdcx. %1,0,%3\n" \
- " bne- 1b" \
- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
- : "b" (mem), "r" (value), "m" (*mem) \
- : "cr0", "memory"); \
- __val; \
- })
-
-# define __arch_atomic_increment_val_64(mem) \
- ({ \
- __typeof (*(mem)) __val; \
- __asm__ __volatile__ ("1: ldarx %0,0,%2\n" \
- " addi %0,%0,1\n" \
- " stdcx. %0,0,%2\n" \
- " bne- 1b" \
- : "=&b" (__val), "=m" (*mem) \
- : "b" (mem), "m" (*mem) \
- : "cr0", "memory"); \
- __val; \
- })
-
-# define __arch_atomic_decrement_val_64(mem) \
- ({ \
- __typeof (*(mem)) __val; \
- __asm__ __volatile__ ("1: ldarx %0,0,%2\n" \
- " subi %0,%0,1\n" \
- " stdcx. %0,0,%2\n" \
- " bne- 1b" \
- : "=&b" (__val), "=m" (*mem) \
- : "b" (mem), "m" (*mem) \
- : "cr0", "memory"); \
- __val; \
- })
-
-# define __arch_atomic_decrement_if_positive_64(mem) \
- ({ int __val, __tmp; \
- __asm__ __volatile__ ("1: ldarx %0,0,%3\n" \
- " cmpdi 0,%0,0\n" \
- " addi %1,%0,-1\n" \
- " ble 2f\n" \
- " stdcx. %1,0,%3\n" \
- " bne- 1b\n" \
- "2: " __ARCH_ACQ_INSTR \
- : "=&b" (__val), "=&r" (__tmp), "=m" (*mem) \
- : "b" (mem), "m" (*mem) \
- : "cr0", "memory"); \
- __val; \
- })
-
-/*
- * All powerpc64 processors support the new "light weight" sync (lwsync).
- */
-# define atomic_read_barrier() __asm__ ("lwsync" ::: "memory")
-/*
- * "light weight" sync can also be used for the release barrier.
- */
-# ifndef UP
-# define __ARCH_REL_INSTR "lwsync"
-# endif
-
-#else
/* Atomic operations. PowerPC32 version.
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -261,12 +17,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/*
- * The 32-bit exchange_bool is different on powerpc64 because the subf
- * does signed 64-bit arthmatic while the lwarx is 32-bit unsigned
- * (a load word and zero (high 32) form). So powerpc64 has a slightly
- * different version in sysdeps/powerpc/powerpc64/bits/atomic.h.
- */
# define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
({ \
unsigned int __tmp; \
@@ -355,8 +105,6 @@
# define atomic_read_barrier() __asm__ ("sync" ::: "memory")
#endif
-#endif
-
#include <stdint.h>
typedef int32_t atomic32_t;
diff --git a/libc/sysdeps/linux/powerpc/bits/mathinline.h b/libc/sysdeps/linux/powerpc/bits/mathinline.h
index 206ca97..f98d4d6 100644
--- a/libc/sysdeps/linux/powerpc/bits/mathinline.h
+++ b/libc/sysdeps/linux/powerpc/bits/mathinline.h
@@ -57,30 +57,12 @@
# endif /* __GNUC_PREREQ (2,97) */
-/* The gcc, version 2.7 or below, has problems with all this inlining
- code. So disable it for this version of the compiler. */
-# if __GNUC_PREREQ (2, 8)
-/* Test for negative number. Used in the signbit() macro. */
-__MATH_INLINE int
-__NTH (__signbitf (float __x))
-{
- __extension__ union { float __f; int __i; } __u = { __f: __x };
- return __u.__i < 0;
-}
-__MATH_INLINE int
-__NTH (__signbit (double __x))
-{
- __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
- return __u.__i[0] < 0;
-}
-# endif
#endif /* __USE_ISOC99 */
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
#ifdef __USE_ISOC99
-# ifndef __powerpc64__
__MATH_INLINE long int lrint (double __x) __THROW;
__MATH_INLINE long int
__NTH (lrint (double __x))
@@ -104,7 +86,6 @@ __NTH (lrintf (float __x))
__asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x));
return __u.__ll[1];
}
-# endif
__MATH_INLINE double fdim (double __x, double __y) __THROW;
__MATH_INLINE double
@@ -123,62 +104,5 @@ __NTH (fdimf (float __x, float __y))
#endif /* __USE_ISOC99 */
#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
-/* This code is used internally in the GNU libc. */
-#if 0 /*def __LIBC_INTERNAL_MATH_INLINES*/
-
-#include <sysdep.h>
-#include <ldsodefs.h>
-#include <dl-procinfo.h>
-
-# if __WORDSIZE == 64 || defined _ARCH_PWR4
-# define __CPU_HAS_FSQRT 1
-# else
-# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
-# endif
-
-extern double __slow_ieee754_sqrt (double);
-__MATH_INLINE double
-__NTH (__ieee754_sqrt (double __x))
-{
- double __z;
-
- /* If the CPU is 64-bit we can use the optional FP instructions. */
- if (__CPU_HAS_FSQRT)
- {
- /* Volatile is required to prevent the compiler from moving the
- fsqrt instruction above the branch. */
- __asm__ __volatile__ (
- " fsqrt %0,%1\n"
- : "=f" (__z)
- : "f" (__x));
- }
- else
- __z = __slow_ieee754_sqrt(__x);
-
- return __z;
-}
-
-extern float __slow_ieee754_sqrtf (float);
-__MATH_INLINE float
-__NTH (__ieee754_sqrtf (float __x))
-{
- float __z;
-
- /* If the CPU is 64-bit we can use the optional FP instructions. */
- if (__CPU_HAS_FSQRT)
- {
- /* Volatile is required to prevent the compiler from moving the
- fsqrts instruction above the branch. */
- __asm__ __volatile__ (
- " fsqrts %0,%1\n"
- : "=f" (__z)
- : "f" (__x));
- }
- else
- __z = __slow_ieee754_sqrtf(__x);
-
- return __z;
-}
-#endif /* __LIBC_INTERNAL_MATH_INLINES */
#endif /* __GNUC__ && !_SOFT_FLOAT */
diff --git a/libc/sysdeps/linux/powerpc/bits/setjmp.h b/libc/sysdeps/linux/powerpc/bits/setjmp.h
index 46e8bf7..1cc1d83 100644
--- a/libc/sysdeps/linux/powerpc/bits/setjmp.h
+++ b/libc/sysdeps/linux/powerpc/bits/setjmp.h
@@ -29,8 +29,6 @@
assembler easier. Naturally, user code should not depend on
either representation. */
-#include <bits/wordsize.h>
-
/* The current powerpc 32-bit Altivec ABI specifies for SVR4 ABI and EABI
the vrsave must be at byte 248 & v20 at byte 256. So we must pad this
correctly on 32 bit. It also insists that vecregs are only gauranteed
@@ -38,12 +36,9 @@
We have to version the code because members like int __mask_was_saved
in the jmp_buf will move as jmp_buf is now larger than 248 bytes. We
cannot keep the altivec jmp_buf backward compatible with the jmp_buf. */
-#if __WORDSIZE == 64
-typedef long int __jmp_buf[64] __attribute__ ((__aligned__ (16)));
-#else
+
/* The alignment is not essential, i.e.the buffer can be copied to a 4 byte
aligned buffer as per the ABI it is just added for performance reasons. */
typedef long int __jmp_buf[64 + (12 * 4)] __attribute__ ((__aligned__ (16)));
-#endif
#endif /* bits/setjmp.h */
diff --git a/libc/sysdeps/linux/powerpc/bits/stat.h b/libc/sysdeps/linux/powerpc/bits/stat.h
index 10fa2cb..a90043f 100644
--- a/libc/sysdeps/linux/powerpc/bits/stat.h
+++ b/libc/sysdeps/linux/powerpc/bits/stat.h
@@ -20,27 +20,18 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
-#include <bits/wordsize.h>
-
/* Versions of the `struct stat' data structure. */
#define _STAT_VER_LINUX_OLD 1
#define _STAT_VER_KERNEL 1
#define _STAT_VER_SVR4 2
#define _STAT_VER_LINUX 3
-#if __WORDSIZE == 32
-# define _STAT_VER _STAT_VER_LINUX
-#else
-# define _STAT_VER _STAT_VER_KERNEL
-#endif
+#define _STAT_VER _STAT_VER_LINUX
/* Versions of the `xmknod' interface. */
#define _MKNOD_VER_LINUX 1
#define _MKNOD_VER_SVR4 2
#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
-
-#if __WORDSIZE == 32
-
struct stat
{
__dev_t st_dev; /* Device. */
@@ -134,103 +125,6 @@ struct stat64
};
# endif /* __USE_LARGEFILE64 */
-#else /* __WORDSIZE == 32 */
-
-struct stat
- {
- __dev_t st_dev; /* Device. */
-# ifndef __USE_FILE_OFFSET64
- __ino_t st_ino; /* File serial number. */
-# else
- __ino64_t st_ino; /* File serial number. */
-# endif
- __nlink_t st_nlink; /* Link count. */
- __mode_t st_mode; /* File mode. */
- __uid_t st_uid; /* User ID of the file's owner. */
- __gid_t st_gid; /* Group ID of the file's group.*/
- int __pad2;
- __dev_t st_rdev; /* Device number, if device. */
-# ifndef __USE_FILE_OFFSET64
- __off_t st_size; /* Size of file, in bytes. */
-# else
- __off64_t st_size; /* Size of file, in bytes. */
-# endif
- __blksize_t st_blksize; /* Optimal block size for I/O. */
-
-# ifndef __USE_FILE_OFFSET64
- __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
-# else
- __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-# endif
-#ifdef __USE_MISC
- /* Nanosecond resolution timestamps are stored in a format
- equivalent to 'struct timespec'. This is the type used
- whenever possible but the Unix namespace rules do not allow the
- identifier 'timespec' to appear in the <sys/stat.h> header.
- Therefore we have to handle the use of this header in strictly
- standard-compliant sources special. */
- struct timespec st_atim; /* Time of last access. */
- struct timespec st_mtim; /* Time of last modification. */
- struct timespec st_ctim; /* Time of last status change. */
-# define st_atime st_atim.tv_sec /* Backward compatibility. */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
- __time_t st_atime; /* Time of last access. */
- unsigned long int st_atimensec; /* Nscecs of last access. */
- __time_t st_mtime; /* Time of last modification. */
- unsigned long int st_mtimensec; /* Nsecs of last modification. */
- __time_t st_ctime; /* Time of last status change. */
- unsigned long int st_ctimensec; /* Nsecs of last status change. */
-#endif
- unsigned long int __unused4;
- unsigned long int __unused5;
- unsigned long int __unused6;
- };
-
-# ifdef __USE_LARGEFILE64
-struct stat64
- {
- __dev_t st_dev; /* Device. */
- __ino64_t st_ino; /* File serial number. */
- __nlink_t st_nlink; /* Link count. */
- __mode_t st_mode; /* File mode. */
- __uid_t st_uid; /* User ID of the file's owner. */
- __gid_t st_gid; /* Group ID of the file's group.*/
- int __pad2;
- __dev_t st_rdev; /* Device number, if device. */
- __off64_t st_size; /* Size of file, in bytes. */
- __blksize_t st_blksize; /* Optimal block size for I/O. */
- __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#ifdef __USE_MISC
- /* Nanosecond resolution timestamps are stored in a format
- equivalent to 'struct timespec'. This is the type used
- whenever possible but the Unix namespace rules do not allow the
- identifier 'timespec' to appear in the <sys/stat.h> header.
- Therefore we have to handle the use of this header in strictly
- standard-compliant sources special. */
- struct timespec st_atim; /* Time of last access. */
- struct timespec st_mtim; /* Time of last modification. */
- struct timespec st_ctim; /* Time of last status change. */
-# define st_atime st_atim.tv_sec /* Backward compatibility. */
-# define st_mtime st_mtim.tv_sec
-# define st_ctime st_ctim.tv_sec
-#else
- __time_t st_atime; /* Time of last access. */
- unsigned long int st_atimensec; /* Nscecs of last access. */
- __time_t st_mtime; /* Time of last modification. */
- unsigned long int st_mtimensec; /* Nsecs of last modification. */
- __time_t st_ctime; /* Time of last status change. */
- unsigned long int st_ctimensec; /* Nsecs of last status change. */
-#endif
- unsigned long int __unused4;
- unsigned long int __unused5;
- unsigned long int __unused6;
- };
-# endif /* __USE_LARGEFILE64 */
-#endif
-
-
/* Tell code we have these members. */
#define _STATBUF_ST_BLKSIZE
#define _STATBUF_ST_RDEV
diff --git a/libc/sysdeps/linux/powerpc/bits/wordsize.h b/libc/sysdeps/linux/powerpc/bits/wordsize.h
index 3e8a1e0..0c0d31b 100644
--- a/libc/sysdeps/linux/powerpc/bits/wordsize.h
+++ b/libc/sysdeps/linux/powerpc/bits/wordsize.h
@@ -1,11 +1,6 @@
/* Determine the wordsize from the preprocessor defines. */
-#if defined __powerpc64__
-# define __WORDSIZE 64
-# define __WORDSIZE_TIME64_COMPAT32 1
-#else
-# define __WORDSIZE 32
-#endif
+#define __WORDSIZE 32
#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
diff --git a/libc/sysdeps/linux/powerpc/jmpbuf-offsets.h b/libc/sysdeps/linux/powerpc/jmpbuf-offsets.h
index eb7d7fd..5639ac5 100644
--- a/libc/sysdeps/linux/powerpc/jmpbuf-offsets.h
+++ b/libc/sysdeps/linux/powerpc/jmpbuf-offsets.h
@@ -16,25 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <bits/wordsize.h>
-
#define JB_GPR1 0 /* Also known as the stack pointer */
#define JB_GPR2 1
#define JB_LR 2 /* The address we will return to */
-#if __WORDSIZE == 64
-# define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18*2 words total. */
-# define JB_CR 21 /* Condition code registers with the VRSAVE at */
- /* offset 172 (low half of the double word. */
-# define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total. */
-# define JB_SIZE (64 * 8) /* As per PPC64-VMX ABI. */
-# define JB_VRSAVE 21 /* VRSAVE shares a double word with the CR at offset */
- /* 168 (high half of the double word). */
-# define JB_VRS 40 /* VRs 20 through 31 are saved, 12*4 words total. */
-#else
-# define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18 in total. */
-# define JB_CR 21 /* Condition code registers. */
-# define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total. */
-# define JB_SIZE ((64 + (12 * 4)) * 4)
-# define JB_VRSAVE 62
-# define JB_VRS 64
-#endif
+#define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18 in total. */
+#define JB_CR 21 /* Condition code registers. */
+#define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total. */
+#define JB_SIZE ((64 + (12 * 4)) * 4)
+#define JB_VRSAVE 62
+#define JB_VRS 64
diff --git a/libc/sysdeps/linux/powerpc/powerpc32/sysdep.h b/libc/sysdeps/linux/powerpc/powerpc32/sysdep.h
deleted file mode 100644
index 9459e79..0000000
--- a/libc/sysdeps/linux/powerpc/powerpc32/sysdep.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* Assembly macros for 32-bit PowerPC.
- Copyright (C) 1999, 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifdef __ASSEMBLER__
-
-#ifdef __ELF__
-
-/* If compiled for profiling, call `_mcount' at the start of each
- function. */
-#ifdef PROF
-/* The mcount code relies on a the return address being on the stack
- to locate our caller and so it can restore it; so store one just
- for its benefit. */
-# define CALL_MCOUNT \
- mflr r0; \
- stw r0,4(r1); \
- cfi_offset (lr, 4); \
- bl JUMPTARGET(_mcount);
-#else /* PROF */
-# define CALL_MCOUNT /* Do nothing. */
-#endif /* PROF */
-
-#define ENTRY(name) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
- .align ALIGNARG(2); \
- C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT
-
-#define EALIGN_W_0 /* No words to insert. */
-#define EALIGN_W_1 nop
-#define EALIGN_W_2 nop;nop
-#define EALIGN_W_3 nop;nop;nop
-#define EALIGN_W_4 EALIGN_W_3;nop
-#define EALIGN_W_5 EALIGN_W_4;nop
-#define EALIGN_W_6 EALIGN_W_5;nop
-#define EALIGN_W_7 EALIGN_W_6;nop
-
-/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
- past a 2^align boundary. */
-#ifdef PROF
-# define EALIGN(name, alignt, words) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
- .align ALIGNARG(2); \
- C_LABEL(name) \
- cfi_startproc; \
- CALL_MCOUNT \
- b 0f; \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- 0:
-#else /* PROF */
-# define EALIGN(name, alignt, words) \
- .globl C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- C_LABEL(name) \
- cfi_startproc;
-#endif
-
-#undef END
-#define END(name) \
- cfi_endproc; \
- ASM_SIZE_DIRECTIVE(name)
-
-#define DO_CALL(syscall) \
- li 0,syscall; \
- sc
-
-#undef JUMPTARGET
-#ifdef PIC
-# define JUMPTARGET(name) name##@plt
-#else
-# define JUMPTARGET(name) name
-#endif
-
-#if defined SHARED && defined DO_VERSIONING && defined PIC \
- && !defined NO_HIDDEN
-# undef HIDDEN_JUMPTARGET
-# define HIDDEN_JUMPTARGET(name) __GI_##name##@local
-#endif
-
-#define PSEUDO(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- DO_CALL (SYS_ify (syscall_name));
-
-#define PSEUDO_RET \
- bnslr+; \
- b __syscall_error@local
-#define ret PSEUDO_RET
-
-#undef PSEUDO_END
-#define PSEUDO_END(name) \
- END (name)
-
-#define PSEUDO_NOERRNO(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- DO_CALL (SYS_ify (syscall_name));
-
-#define PSEUDO_RET_NOERRNO \
- blr
-#define ret_NOERRNO PSEUDO_RET_NOERRNO
-
-#undef PSEUDO_END_NOERRNO
-#define PSEUDO_END_NOERRNO(name) \
- END (name)
-
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- DO_CALL (SYS_ify (syscall_name));
-
-#define PSEUDO_RET_ERRVAL \
- blr
-#undef ret_ERRVAL
-#define ret_ERRVAL PSEUDO_RET_ERRVAL
-
-#undef PSEUDO_END_ERRVAL
-#define PSEUDO_END_ERRVAL(name) \
- END (name)
-
-/* Local labels stripped out by the linker. */
-#undef L
-#define L(x) .L##x
-
-/* Label in text section. */
-#define C_TEXT(name) name
-
-#endif /* __ELF__ */
-
-#endif /* __ASSEMBLER__ */
diff --git a/libc/sysdeps/linux/powerpc/powerpc64/sysdep.h b/libc/sysdeps/linux/powerpc/powerpc64/sysdep.h
deleted file mode 100644
index 5a194af..0000000
--- a/libc/sysdeps/linux/powerpc/powerpc64/sysdep.h
+++ /dev/null
@@ -1,243 +0,0 @@
-/* Assembly macros for 64-bit PowerPC.
- Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifdef __ELF__
-
-#ifdef __ASSEMBLER__
-
-/* Support macros for CALL_MCOUNT. */
- .macro SAVE_ARG NARG
- .if \NARG
- SAVE_ARG \NARG-1
- std 2+\NARG,-72+8*(\NARG)(1)
- .endif
- .endm
-
- .macro REST_ARG NARG
- .if \NARG
- REST_ARG \NARG-1
- ld 2+\NARG,40+8*(\NARG)(1)
- .endif
- .endm
-
-/* If compiled for profiling, call `_mcount' at the start of each function.
- see ppc-mcount.S for more details. */
- .macro CALL_MCOUNT NARG
-#ifdef PROF
- mflr r0
- SAVE_ARG \NARG
- std r0,16(r1)
- stdu r1,-112(r1)
- bl JUMPTARGET (_mcount)
- ld r0,128(r1)
- REST_ARG \NARG
- addi r1,r1,112
- mtlr r0
-#endif
- .endm
-
-#ifdef USE_PPC64_OVERLAPPING_OPD
-# define OPD_ENT(name) .quad BODY_LABEL (name), .TOC.@tocbase
-#else
-# define OPD_ENT(name) .quad BODY_LABEL (name), .TOC.@tocbase, 0
-#endif
-
-#define ENTRY_1(name) \
- .section ".text"; \
- .type BODY_LABEL(name),@function; \
- .globl name; \
- .section ".opd","aw"; \
- .align 3; \
-name##: OPD_ENT (name); \
- .previous;
-
-# define DOT_LABEL(X) X
-# define BODY_LABEL(X) .LY##X
-# define ENTRY_2(name) \
- .type name,@function; \
- ENTRY_1(name)
-# define END_2(name) \
- .size name,.-BODY_LABEL(name); \
- .size BODY_LABEL(name),.-BODY_LABEL(name);
-
-#define ENTRY(name) \
- ENTRY_2(name) \
- .align ALIGNARG(2); \
-BODY_LABEL(name): \
- cfi_startproc;
-
-#define EALIGN_W_0 /* No words to insert. */
-#define EALIGN_W_1 nop
-#define EALIGN_W_2 nop;nop
-#define EALIGN_W_3 nop;nop;nop
-#define EALIGN_W_4 EALIGN_W_3;nop
-#define EALIGN_W_5 EALIGN_W_4;nop
-#define EALIGN_W_6 EALIGN_W_5;nop
-#define EALIGN_W_7 EALIGN_W_6;nop
-
-/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
- past a 2^alignt boundary. */
-#define EALIGN(name, alignt, words) \
- ENTRY_2(name) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
-BODY_LABEL(name): \
- cfi_startproc;
-
-/* Local labels stripped out by the linker. */
-#undef L
-#define L(x) .L##x
-
-#define tostring(s) #s
-#define stringify(s) tostring(s)
-#define XGLUE(a,b) a##b
-#define GLUE(a,b) XGLUE(a,b)
-#define LT_LABEL(name) GLUE(.LT,name)
-#define LT_LABELSUFFIX(name,suffix) GLUE(GLUE(.LT,name),suffix)
-
-/* Support Traceback tables */
-#define TB_ASM 0x000c000000000000
-#define TB_GLOBALLINK 0x0000800000000000
-#define TB_IS_EPROL 0x0000400000000000
-#define TB_HAS_TBOFF 0x0000200000000000
-#define TB_INT_PROC 0x0000100000000000
-#define TB_HAS_CTL 0x0000080000000000
-#define TB_TOCLESS 0x0000040000000000
-#define TB_FP_PRESENT 0x0000020000000000
-#define TB_LOG_ABORT 0x0000010000000000
-#define TB_INT_HANDL 0x0000008000000000
-#define TB_NAME_PRESENT 0x0000004000000000
-#define TB_USES_ALLOCA 0x0000002000000000
-#define TB_SAVES_CR 0x0000000200000000
-#define TB_SAVES_LR 0x0000000100000000
-#define TB_STORES_BC 0x0000000080000000
-#define TB_FIXUP 0x0000000040000000
-#define TB_FP_SAVED(fprs) (((fprs) & 0x3f) << 24)
-#define TB_GPR_SAVED(gprs) (((fprs) & 0x3f) << 16)
-#define TB_FIXEDPARMS(parms) (((parms) & 0xff) << 8)
-#define TB_FLOATPARMS(parms) (((parms) & 0x7f) << 1)
-#define TB_PARMSONSTK 0x0000000000000001
-
-#define PPC_HIGHER(v) (((v) >> 32) & 0xffff)
-#define TB_DEFAULT TB_ASM | TB_HAS_TBOFF | TB_NAME_PRESENT
-
-#define TRACEBACK(name) \
-LT_LABEL(name): ; \
- .long 0 ; \
- .quad TB_DEFAULT ; \
- .long LT_LABEL(name)-BODY_LABEL(name) ; \
- .short LT_LABELSUFFIX(name,_name_end)-LT_LABELSUFFIX(name,_name_start) ; \
-LT_LABELSUFFIX(name,_name_start): ;\
- .ascii stringify(name) ; \
-LT_LABELSUFFIX(name,_name_end): ; \
- .align 2 ;
-
-#define TRACEBACK_MASK(name,mask) \
-LT_LABEL(name): ; \
- .long 0 ; \
- .quad TB_DEFAULT | mask ; \
- .long LT_LABEL(name)-BODY_LABEL(name) ; \
- .short LT_LABELSUFFIX(name,_name_end)-LT_LABELSUFFIX(name,_name_start) ; \
-LT_LABELSUFFIX(name,_name_start): ;\
- .ascii stringify(name) ; \
-LT_LABELSUFFIX(name,_name_end): ; \
- .align 2 ;
-
-/* END generates Traceback tables */
-#undef END
-#define END(name) \
- cfi_endproc; \
- TRACEBACK(name) \
- END_2(name)
-
-/* This form supports more informative traceback tables */
-#define END_GEN_TB(name,mask) \
- cfi_endproc; \
- TRACEBACK_MASK(name,mask) \
- END_2(name)
-
-#define DO_CALL(syscall) \
- li 0,syscall; \
- sc
-
-/* ppc64 is always PIC */
-#undef JUMPTARGET
-#define JUMPTARGET(name) DOT_LABEL(name)
-
-#define PSEUDO(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- DO_CALL (SYS_ify (syscall_name));
-
-#define PSEUDO_RET \
- bnslr+; \
- b JUMPTARGET(__syscall_error)
-
-#define ret PSEUDO_RET
-
-#undef PSEUDO_END
-#define PSEUDO_END(name) \
- END (name)
-
-#define PSEUDO_NOERRNO(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- DO_CALL (SYS_ify (syscall_name));
-
-#define PSEUDO_RET_NOERRNO \
- blr
-
-#define ret_NOERRNO PSEUDO_RET_NOERRNO
-
-#undef PSEUDO_END_NOERRNO
-#define PSEUDO_END_NOERRNO(name) \
- END (name)
-
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .section ".text"; \
- ENTRY (name) \
- DO_CALL (SYS_ify (syscall_name));
-
-#define PSEUDO_RET_ERRVAL \
- blr
-
-#undef ret_ERRVAL
-#define ret_ERRVAL PSEUDO_RET_ERRVAL
-
-#undef PSEUDO_END_ERRVAL
-#define PSEUDO_END_ERRVAL(name) \
- END (name)
-
-#else /* !__ASSEMBLER__ */
-
-#ifdef USE_PPC64_OVERLAPPING_OPD
-# define OPD_ENT(name) ".quad " BODY_PREFIX #name ", .TOC.@tocbase;"
-#else
-# define OPD_ENT(name) ".quad " BODY_PREFIX #name ", .TOC.@tocbase, 0;"
-#endif
-
-# define DOT_PREFIX ""
-# define BODY_PREFIX ".LY"
-# define ENTRY_2(name) ".type " #name ",@function;"
-# define END_2(name) \
- ".size " #name ",.-" BODY_PREFIX #name ";\n" \
- ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";"
-
-#endif /* __ASSEMBLER__ */
-
-#endif /* __ELF__ */
diff --git a/libc/sysdeps/linux/powerpc/sys/ucontext.h b/libc/sysdeps/linux/powerpc/sys/ucontext.h
index 72fbae4..fa3cbb6 100644
--- a/libc/sysdeps/linux/powerpc/sys/ucontext.h
+++ b/libc/sysdeps/linux/powerpc/sys/ucontext.h
@@ -25,8 +25,6 @@
included in <signal.h>. */
#include <bits/sigcontext.h>
-#if __WORDSIZE == 32
-
/* Number of general registers. */
# define NGREG 48
@@ -59,84 +57,12 @@ typedef struct
vrregset_t vrregs __attribute__((__aligned__(16)));
} mcontext_t;
-#else
-
-/* For 64-bit kernels with Altivec support, a machine context is exactly
- * a sigcontext. For older kernel (without Altivec) the sigcontext matches
- * the mcontext upto but not including the v_regs field. For kernels that
- * don't AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the
- * v_regs field may not exit and should not be referenced. The v_regd field
- * can be refernced safely only after verifying that PPC_FEATURE_HAS_ALTIVEC
- * is set in AT_HWCAP. */
-
-/* Number of general registers. */
-# define NGREG 48 /* includes r0-r31, nip, msr, lr, etc. */
-# define NFPREG 33 /* includes fp0-fp31 &fpscr. */
-# define NVRREG 34 /* includes v0-v31, vscr, & vrsave in split vectors */
-
-typedef unsigned long gregset_t[NGREG];
-typedef double fpregset_t[NFPREG];
-
-/* Container for Altivec/VMX Vector Status and Control Register. Only 32-bits
- but can only be copied to/from a 128-bit vector register. So we allocated
- a whole quadword speedup save/restore. */
-typedef struct _libc_vscr
-{
- unsigned int __pad[3];
- unsigned int vscr_word;
-} vscr_t;
-
-/* Container for Altivec/VMX registers and status.
- Must to be aligned on a 16-byte boundary. */
-typedef struct _libc_vrstate
-{
- unsigned int vrregs[32][4];
- vscr_t vscr;
- unsigned int vrsave;
- unsigned int __pad[3];
-} vrregset_t __attribute__((__aligned__(16)));
-
-typedef struct {
- unsigned long __unused[4];
- int signal;
- int __pad0;
- unsigned long handler;
- unsigned long oldmask;
- struct pt_regs *regs;
- gregset_t gp_regs;
- fpregset_t fp_regs;
-/*
- * To maintain compatibility with current implementations the sigcontext is
- * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t)
- * followed by an unstructured (vmx_reserve) field of 69 doublewords. This
- * allows the array of vector registers to be quadword aligned independent of
- * the alignment of the containing sigcontext or ucontext. It is the
- * responsibility of the code setting the sigcontext to set this pointer to
- * either NULL (if this processor does not support the VMX feature) or the
- * address of the first quadword within the allocated (vmx_reserve) area.
- *
- * The pointer (v_regs) of vector type (elf_vrreg_t) is essentually
- * an array of 34 quadword entries. The entries with
- * indexes 0-31 contain the corresponding vector registers. The entry with
- * index 32 contains the vscr as the last word (offset 12) within the
- * quadword. This allows the vscr to be stored as either a quadword (since
- * it must be copied via a vector register to/from storage) or as a word.
- * The entry with index 33 contains the vrsave as the first word (offset 0)
- * within the quadword.
- */
- vrregset_t *v_regs;
- long vmx_reserve[NVRREG+NVRREG+1];
-} mcontext_t;
-
-#endif
-
/* Userlevel context. */
typedef struct ucontext
{
unsigned long int uc_flags;
struct ucontext *uc_link;
stack_t uc_stack;
-#if __WORDSIZE == 32
/*
* These fields are set up this way to maximize source and
* binary compatibility with code written for the old
@@ -167,10 +93,6 @@ typedef struct ucontext
} uc_mcontext;
sigset_t uc_sigmask;
char uc_reg_space[sizeof(mcontext_t) + 12]; /* last for extensibility */
-#else /* 64-bit */
- sigset_t uc_sigmask;
- mcontext_t uc_mcontext; /* last for extensibility */
-#endif
} ucontext_t;
#endif /* sys/ucontext.h */
diff --git a/libc/sysdeps/linux/powerpc/sysdep.h b/libc/sysdeps/linux/powerpc/sysdep.h
index 9a57062..c512c5a 100644
--- a/libc/sysdeps/linux/powerpc/sysdep.h
+++ b/libc/sysdeps/linux/powerpc/sysdep.h
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <common/sysdep.h>
+#include <sys/syscall.h>
/*
* Powerpc Feature masks for the Aux Vector Hardware Capabilities (AT_HWCAP).
@@ -169,9 +170,6 @@
#define VRSAVE 256
-
-#ifdef __ELF__
-
/* This seems to always be the case on PPC. */
#define ALIGNARG(log2) log2
/* For ELF we need the `.type' directive to make shared libs work right. */
@@ -182,14 +180,98 @@
#undef NO_UNDERSCORES
#define NO_UNDERSCORES
-#endif /* __ELF__ */
+#define ENTRY(name) \
+ .globl C_SYMBOL_NAME(name); \
+ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
+ .align ALIGNARG(2); \
+ C_LABEL(name) \
+ cfi_startproc; \
-# include <sys/syscall.h>
-# if defined(__powerpc64__)
-# include "powerpc64/sysdep.h"
-# else
-# include "powerpc32/sysdep.h"
-# endif
+#define EALIGN_W_0 /* No words to insert. */
+#define EALIGN_W_1 nop
+#define EALIGN_W_2 nop;nop
+#define EALIGN_W_3 nop;nop;nop
+#define EALIGN_W_4 EALIGN_W_3;nop
+#define EALIGN_W_5 EALIGN_W_4;nop
+#define EALIGN_W_6 EALIGN_W_5;nop
+#define EALIGN_W_7 EALIGN_W_6;nop
-#endif /* __ASSEMBLER__ */
+#define EALIGN(name, alignt, words) \
+ .globl C_SYMBOL_NAME(name); \
+ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
+ .align ALIGNARG(alignt); \
+ EALIGN_W_##words; \
+ C_LABEL(name) \
+ cfi_startproc;
+
+#undef END
+#define END(name) \
+ cfi_endproc; \
+ ASM_SIZE_DIRECTIVE(name)
+
+#define DO_CALL(syscall) \
+ li 0,syscall; \
+ sc
+
+#undef JUMPTARGET
+#ifdef PIC
+# define JUMPTARGET(name) name##@plt
+#else
+# define JUMPTARGET(name) name
+#endif
+
+#if defined SHARED && defined DO_VERSIONING && defined PIC \
+ && !defined NO_HIDDEN
+# undef HIDDEN_JUMPTARGET
+# define HIDDEN_JUMPTARGET(name) __GI_##name##@local
+#endif
+
+#define PSEUDO(name, syscall_name, args) \
+ .section ".text"; \
+ ENTRY (name) \
+ DO_CALL (SYS_ify (syscall_name));
+
+#define PSEUDO_RET \
+ bnslr+; \
+ b __syscall_error@local
+#define ret PSEUDO_RET
+
+#undef PSEUDO_END
+#define PSEUDO_END(name) \
+ END (name)
+#define PSEUDO_NOERRNO(name, syscall_name, args) \
+ .section ".text"; \
+ ENTRY (name) \
+ DO_CALL (SYS_ify (syscall_name));
+
+#define PSEUDO_RET_NOERRNO \
+ blr
+#define ret_NOERRNO PSEUDO_RET_NOERRNO
+
+#undef PSEUDO_END_NOERRNO
+#define PSEUDO_END_NOERRNO(name) \
+ END (name)
+
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+ .section ".text"; \
+ ENTRY (name) \
+ DO_CALL (SYS_ify (syscall_name));
+
+#define PSEUDO_RET_ERRVAL \
+ blr
+#undef ret_ERRVAL
+#define ret_ERRVAL PSEUDO_RET_ERRVAL
+
+#undef PSEUDO_END_ERRVAL
+#define PSEUDO_END_ERRVAL(name) \
+ END (name)
+
+/* Local labels stripped out by the linker. */
+#undef L
+#define L(x) .L##x
+
+/* Label in text section. */
+#define C_TEXT(name) name
+
+#endif /* __ASSEMBLER__ */
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
[PATCH] [v3] linuxthreads.old: Fix segfault when pthread_mutex_unlock() called against unlocked NORMAL mutex.
by Leonid Lisovskiy 02 Jun '16
by Leonid Lisovskiy 02 Jun '16
02 Jun '16
Althought, it is undefined behavior, there is no reason for segfault.
Program received signal SIGSEGV, Segmentation fault.
__pthread_unlock (lock=lock@entry=0x804b03c <lock+16>)
at libpthread/linuxthreads.old/spinlock.c:231
231 (&lock->__status, oldstatus, (long)(thr->p_nextlock) & ~1L))
It occurs only on platforms which has HAS_COMPARE_AND_SWAP defined.
Restore glibc commit fbaf6e72d6 "spinlock.c (__pthread_unlock): Don't crash if
called for an untaken mutex." behavior, broken later by commit 4ad1d0cfbf.
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
---
libpthread/linuxthreads/spinlock.c | 12 ++++++--
test/pthread/ex8-mtx-odd.c | 56 ++++++++++++++++++++++++++++++++++++++
2 files changed, 65 insertions(+), 3 deletions(-)
create mode 100644 test/pthread/ex8-mtx-odd.c
diff --git a/libpthread/linuxthreads/spinlock.c b/libpthread/linuxthreads/spinlock.c
index 80aeda5..ce97002 100644
--- a/libpthread/linuxthreads/spinlock.c
+++ b/libpthread/linuxthreads/spinlock.c
@@ -188,10 +188,16 @@ int __pthread_unlock(struct _pthread_fastlock * lock)
WRITE_MEMORY_BARRIER();
again:
- while ((oldstatus = lock->__status) == 1) {
- if (__compare_and_swap_with_release_semantics(&lock->__status,
+ oldstatus = lock->__status;
+ if (oldstatus == 0 || oldstatus == 1) {
+ /* No threads are waiting for this lock. Please note that we also
+ enter this case if the lock is not taken at all. If this wouldn't
+ be done here we would crash further down. */
+ if (! __compare_and_swap_with_release_semantics(&lock->__status,
oldstatus, 0))
- return 0;
+ goto again;
+
+ return 0;
}
/* Find thread in waiting queue with maximal priority */
diff --git a/test/pthread/ex8-mtx-odd.c b/test/pthread/ex8-mtx-odd.c
new file mode 100644
index 0000000..791b2c2
--- /dev/null
+++ b/test/pthread/ex8-mtx-odd.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper(a)redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+
+static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
+
+static int
+do_test (void)
+{
+
+ if (pthread_mutex_lock (&lock) != 0)
+ {
+ puts ("mutex_lock failed");
+ exit (1);
+ }
+
+ if (pthread_mutex_unlock (&lock) != 0)
+ {
+ puts ("1st mutex_unlock failed");
+ exit (1);
+ }
+
+ if (pthread_mutex_unlock (&lock) != 0)
+ {
+ puts ("2nd mutex_unlock failed");
+ exit (1);
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--
1.8.5.6
2
1
[PATCH] tests: Take in account Makefiles that have meaning for rebuild only.
by Leonid Lisovskiy 02 Jun '16
by Leonid Lisovskiy 02 Jun '16
02 Jun '16
Currently, targets dependancy list don't include Makefile.in,
this leads to incomplete rebuild after target's compiler/linker
flags was changed.
Use "$(wildcard)" function due to Makefile.in could be absent
in subdirectory.
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
---
test/Test.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/Test.mak b/test/Test.mak
index c1b34a7..c9b1f5a 100644
--- a/test/Test.mak
+++ b/test/Test.mak
@@ -116,7 +116,7 @@ compile: $(COMPILE_TARGETS)
G_TARGET_SRCS := $(addsuffix .c,$(G_TARGETS))
U_TARGET_SRCS := $(addsuffix .c,$(U_TARGETS))
-MAKE_SRCS := Makefile $(TESTDIR)Makefile $(TESTDIR)Rules.mak $(TESTDIR)Test.mak
+MAKE_SRCS := $(wildcard Makefile.in) $(TESTDIR)Makefile $(TESTDIR)Rules.mak $(TESTDIR)Test.mak
$(U_TARGETS): $(U_TARGET_SRCS) $(MAKE_SRCS)
$(showlink)
--
1.8.5.6
2
1
uClibc-ng - small C library for embedded systems branch master updated. v1.0.15-5-g493d0cc
by wbx@helium.openadk.org 02 Jun '16
by wbx@helium.openadk.org 02 Jun '16
02 Jun '16
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 493d0cc28b0d0fa1dc571ffc876b554376ccdd47 (commit)
via c526740e06e1f7cc0a4747e319c18cde93523482 (commit)
via 361f679c652647cdea4d5a66999a4b96c1653576 (commit)
via 8b28fc50a3891f823531aa276008e1b1b17e0a79 (commit)
from 3ac3d4e61a1de0c2d0e0d2bebf0d1b111f153f12 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 493d0cc28b0d0fa1dc571ffc876b554376ccdd47
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Wed Jun 1 19:59:03 2016 +0200
remove MJN only debug messages
commit c526740e06e1f7cc0a4747e319c18cde93523482
Author: Leonid Lisovskiy <lly.dev(a)gmail.com>
Date: Mon May 30 20:19:45 2016 +0300
ARM: nptl: Use generic lowlevellock.c, patch from glibc
lowlevellock.c for arm differs from the generic lowlevellock.c only in
insignificant ways, so can be removed. Follow glibc commit 6d96f5e4c0
Solves __lll_timedlock_wait busy-wait issues described at
http://sourceware.org/bugzilla/show_bug.cgi?id=15119
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit 361f679c652647cdea4d5a66999a4b96c1653576
Author: Leonid Lisovskiy <lly.dev(a)gmail.com>
Date: Sun May 29 10:06:55 2016 +0300
linuxthreads.old: Fix segfault when pthread_mutex_unlock() called against unlocked NORMAL mutex.
Althought, it is undefined behavior, there is no reason for segfault.
Program received signal SIGSEGV, Segmentation fault.
__pthread_unlock (lock=lock@entry=0x804b03c <lock+16>)
at libpthread/linuxthreads.old/spinlock.c:231
231 (&lock->__status, oldstatus, (long)(thr->p_nextlock) & ~1L))
It occurs only on platforms which has HAS_COMPARE_AND_SWAP defined.
Restore glibc commit fbaf6e72d6 "spinlock.c (__pthread_unlock): Don't crash if
called for an untaken mutex." behavior, broken later by commit 4ad1d0cfbf.
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit 8b28fc50a3891f823531aa276008e1b1b17e0a79
Author: Leonid Lisovskiy <lly.dev(a)gmail.com>
Date: Tue May 31 21:43:49 2016 +0300
tests: Take in account Makefiles that have meaning for rebuild only.
Currently, targets dependancy list don't include Makefile.in,
this leads to incomplete rebuild after target's compiler/linker
flags was changed.
Use "$(wildcard)" function due to Makefile.in could be absent
in subdirectory.
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
Makefile.in | 1 -
extra/Configs/Config.in | 14 ---
extra/Configs/defconfigs/or1k/defconfig | 1 -
include/nl_types.h | 4 -
include/time.h | 53 --------
include/wctype.h | 5 -
libc/inet/resolv.c | 6 -
libc/misc/ctype/ctype.c | 11 +-
libc/misc/error/err.c | 6 -
libc/misc/locale/locale.c | 75 ------------
libc/misc/time/time.c | 8 --
libc/misc/wchar/wchar.c | 35 ------
libc/misc/wctype/_wctype.c | 36 ------
libc/stdio/_READ.c | 6 -
libc/stdio/_WRITE.c | 3 -
libc/stdio/_fopen.c | 9 --
libc/stdio/_fpmaxtostr.c | 9 --
libc/stdio/_fwrite.c | 6 -
libc/stdio/_rfill.c | 4 -
libc/stdio/_scanf.c | 48 --------
libc/stdio/_vfprintf.c | 37 ------
libc/stdio/_wfwrite.c | 5 -
libc/stdio/fclose.c | 3 -
libc/stdio/fcloseall.c | 6 -
libc/stdio/fflush.c | 13 --
libc/stdio/fgets.c | 6 -
libc/stdio/fputc.c | 3 -
libc/stdio/fread.c | 3 -
libc/stdio/ftrylockfile.c | 4 -
libc/stdio/perror.c | 5 -
libc/stdio/popen.c | 4 -
libc/stdio/ungetc.c | 3 -
libc/stdio/vasprintf.c | 6 -
libc/stdio/vsnprintf.c | 5 -
libc/stdlib/drand48-iter.c | 3 -
libc/stdlib/stdlib.c | 11 --
libc/string/_collate.c | 35 ------
libpthread/linuxthreads/spinlock.c | 12 +-
.../nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch | 5 +-
.../unix/sysv/linux/arm/libc-lowlevellock.c | 20 ---
.../sysdeps/unix/sysv/linux/arm/lowlevellock.c | 136 ---------------------
test/Test.mak | 2 +-
test/{nptl/tst-mutex1.c => pthread/ex8-mtx-odd.c} | 34 +++---
43 files changed, 30 insertions(+), 671 deletions(-)
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arm/libc-lowlevellock.c
delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arm/lowlevellock.c
copy test/{nptl/tst-mutex1.c => pthread/ex8-mtx-odd.c} (64%)
diff --git a/Makefile.in b/Makefile.in
index 36245e3..5965685 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -497,7 +497,6 @@ allyesconfig: $(conf)
-e "s/^DOASSERTS=.*/# DOASSERTS is not set/" \
-e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" \
-e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" \
- -e "s/^UCLIBC_MJN3_ONLY=.*/# UCLIBC_MJN3_ONLY is not set/" \
$(KCONFIG_CONFIG)
$(Q)$< -o $(Kconfig)
alldefconfig: $(conf)
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 17ae847..f3494db 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -1848,20 +1848,6 @@ config UCLIBC_HAS_SYS_SIGLIST
Most people will answer N.
-config UCLIBC_HAS_GETTEXT_AWARENESS
- bool "Include gettext awareness"
- depends on UCLIBC_HAS_LOCALE && UCLIBC_MJN3_ONLY
- help
- NOTE!!! Not yet integrated with strerror and strsignal. NOTE!!!
-
- Answer Y if you want to include weak stub gettext support and
- make the *strerror*() and strsignal() functions gettext-aware.
-
- Currently, to get functional gettext functionality you will need
- to use gnu gettext.
-
- Most people will answer N.
-
config UCLIBC_HAS_GNU_GETOPT
bool "Support gnu getopt"
default y
diff --git a/extra/Configs/defconfigs/or1k/defconfig b/extra/Configs/defconfigs/or1k/defconfig
index 63d6571..a4658da 100644
--- a/extra/Configs/defconfigs/or1k/defconfig
+++ b/extra/Configs/defconfigs/or1k/defconfig
@@ -238,4 +238,3 @@ UCLIBC_EXTRA_CFLAGS=""
WARNINGS="-Wall"
# EXTRA_WARNINGS is not set
# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/include/nl_types.h b/include/nl_types.h
index cb86cf0..3692d0c 100644
--- a/include/nl_types.h
+++ b/include/nl_types.h
@@ -31,10 +31,6 @@
__BEGIN_DECLS
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning "mjn3 FIXME: None of these prototypes have implementations."
-#endif
-
#ifndef __UCLIBC_STRICT_HEADERS__
/* Message catalog descriptor type. */
typedef void *nl_catd;
diff --git a/include/time.h b/include/time.h
index a1dfdea..785c8f6 100644
--- a/include/time.h
+++ b/include/time.h
@@ -288,16 +288,6 @@ extern char *ctime_r (const time_t *__restrict __timer,
char *__restrict __buf) __THROW;
# endif /* POSIX or misc */
-
-/* Defined in localtime.c. */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning "mjn3 FIXME: __tzname, __daylight, and __timezone have a prototype but are not defined."
-extern char *__tzname[2]; /* Current timezone names. */
-extern int __daylight; /* If daylight-saving time is ever in use. */
-extern long int __timezone; /* Seconds west of UTC. */
-#endif /* __UCLIBC_MJN3_ONLY__ */
-
-
# ifdef __USE_POSIX
/* Same as above. */
extern char *tzname[2];
@@ -403,49 +393,6 @@ extern int timer_getoverrun (timer_t __timerid) __THROW;
# endif /* __UCLIBC_HAS_REALTIME__ */
# endif /* __USE_POSIX199309 */
-
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning "mjn3 FIXME: a bunch of unimplemented function prototypes."
-# ifdef __USE_XOPEN_EXTENDED
-/* Set to one of the following values to indicate an error.
- 1 the DATEMSK environment variable is null or undefined,
- 2 the template file cannot be opened for reading,
- 3 failed to get file status information,
- 4 the template file is not a regular file,
- 5 an error is encountered while reading the template file,
- 6 memory allication failed (not enough memory available),
- 7 there is no line in the template that matches the input,
- 8 invalid input specification Example: February 31 or a time is
- specified that can not be represented in a time_t (representing
- the time in seconds since 00:00:00 UTC, January 1, 1970) */
-extern int getdate_err;
-
-/* Parse the given string as a date specification and return a value
- representing the value. The templates from the file identified by
- the environment variable DATEMSK are used. In case of an error
- `getdate_err' is set.
-
- This function is a possible cancellation points and therefore not
- marked with __THROW. */
-extern struct tm *getdate (const char *__string);
-# endif
-
-# ifdef __USE_GNU
-/* Since `getdate' is not reentrant because of the use of `getdate_err'
- and the static buffer to return the result in, we provide a thread-safe
- variant. The functionality is the same. The result is returned in
- the buffer pointed to by RESBUFP and in case of an error the return
- value is != 0 with the same values as given above for `getdate_err'.
-
- This function is not part of POSIX and therefore no official
- cancellation point. But due to similarity with an POSIX interface
- or due to the implementation it is a cancellation point and
- therefore not marked with __THROW. */
-extern int getdate_r (const char *__restrict __string,
- struct tm *__restrict __resbufp);
-# endif
-#endif /* __UCLIBC_MJN3_ONLY__ */
-
__END_DECLS
#endif /* <time.h> included. */
diff --git a/include/wctype.h b/include/wctype.h
index aa133bd..3842ccf 100644
--- a/include/wctype.h
+++ b/include/wctype.h
@@ -101,11 +101,6 @@ enum
_ISwpunct = _ISwbit (__ISwpunct), /* Punctuation. */
_ISwalnum = _ISwbit (__ISwalnum) /* Alphanumeric. */
};
-# else
-# if defined(__UCLIBC_MJN3_ONLY__) && defined(L_iswctype)
-#warning remove _ISwbit already defined check?
-#error _ISwbit already defined!
-# endif
# endif /* Not _ISwbit */
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index f378c9b..e3ad513 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -2082,9 +2082,6 @@ int gethostbyname_r(const char *name,
return ERANGE;
/* we store only one "alias" - the name itself */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO -- generate the full list
-#endif
alias[0] = alias0;
alias[1] = NULL;
@@ -2283,9 +2280,6 @@ int gethostbyname2_r(const char *name,
return ERANGE;
/* we store only one "alias" - the name itself */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO -- generate the full list
-#endif
alias[0] = alias0;
alias[1] = NULL;
diff --git a/libc/misc/ctype/ctype.c b/libc/misc/ctype/ctype.c
index db8061d..bbe12e5 100644
--- a/libc/misc/ctype/ctype.c
+++ b/libc/misc/ctype/ctype.c
@@ -62,16 +62,7 @@
#endif /* __UCLIBC_HAS_CTYPE_SIGNED__ */
#endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
-/**********************************************************************/
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L_isspace
-/* emit only once */
-#warning CONSIDER: Should we assert when debugging and __UCLIBC_HAS_CTYPE_CHECKED?
-#warning TODO: Fix asserts in to{upper|lower}{_l}.
-#warning TODO: Optimize the isx*() funcs.
-#endif
-#endif /* __UCLIBC_MJN3_ONLY__ */
-/**********************************************************************/
+
#undef PASTE2
#define PASTE2(X,Y) X ## Y
diff --git a/libc/misc/error/err.c b/libc/misc/error/err.c
index 4f1e6a3..1563450 100644
--- a/libc/misc/error/err.c
+++ b/libc/misc/error/err.c
@@ -12,14 +12,8 @@
#include <errno.h>
#include <err.h>
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: Deal with wide oriented stderr case.
-#endif
-
#if defined __USE_BSD
-
-
static void vwarn_work(const char *format, va_list args, int showerr)
{
/* 0123 45678 9 a b*/
diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c
index 68e5441..f868ac0 100644
--- a/libc/misc/locale/locale.c
+++ b/libc/misc/locale/locale.c
@@ -58,11 +58,6 @@
#include <ctype.h>
#include <stdio.h>
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L_setlocale
-#warning TODO: Make the link_warning()s a config option?
-#endif
-#endif
#undef link_warning
#define link_warning(A,B)
@@ -78,13 +73,6 @@
#else /* __LOCALE_C_ONLY */
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L_setlocale
-#warning TODO: Fix the __CTYPE_HAS_8_BIT_LOCALES define at the top of the file.
-#warning TODO: Fix __WCHAR_ENABLED.
-#endif
-#endif
-
/* Need to include this before locale.h! */
#include <bits/uClibc_locale.h>
@@ -107,9 +95,6 @@
#define LOCALE_AT_MODIFIERS (__locale_mmap->locale_at_modifiers)
#define CATEGORY_NAMES (__locale_mmap->lc_names)
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: redo the MAX_LOCALE_STR stuff...
-#endif
#define MAX_LOCALE_STR 256 /* TODO: Only sufficient for current case. */
#define MAX_LOCALE_CATEGORY_STR 32 /* TODO: Only sufficient for current case. */
/* Note: Best if MAX_LOCALE_CATEGORY_STR is a power of 2. */
@@ -122,11 +107,6 @@ extern void _locale_init_l(__locale_t base) attribute_hidden;
#undef LOCALE_STRING_SIZE
#define LOCALE_SELECTOR_SIZE (2 * __LC_ALL + 2)
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L_setlocale
-#warning TODO: Create a C locale selector string.
-#endif
-#endif
#define C_LOCALE_SELECTOR "\x23\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80"
@@ -163,15 +143,9 @@ link_warning(setlocale,"REMINDER: The 'setlocale' function is _not_ threadsafe e
#error locales enabled, but not data other than for C locale!
#endif
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Move posix and utf8 strings.
-#endif
static const char posix[] = "POSIX";
static const char utf8[] = "UTF-8";
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Fix dimensions of hr_locale.
-#endif
/* Individual category strings start at hr_locale + category * MAX_LOCALE_CATEGORY.
* This holds for LC_ALL as well.
*/
@@ -355,9 +329,6 @@ __locale_t __curlocale_var = &__global_locale_data;
#endif
/*----------------------------------------------------------------------*/
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Move utf8 and ascii strings.
-#endif
static const char utf8[] = "UTF-8";
static const char ascii[] = "ASCII";
@@ -413,9 +384,6 @@ static int init_cur_collate(int der_num, __collate_t *cur_collate)
size_t n;
uint16_t i, w;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning kill of x86-specific asserts
-#endif
#if 0
assert(sizeof(coldata_base_t) == 19*2);
assert(sizeof(coldata_der_t) == 4*2);
@@ -431,9 +399,6 @@ static int init_cur_collate(int der_num, __collate_t *cur_collate)
cdh = (coldata_header_t *) __locale_collate_tbl;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Should we assert here?
-#endif
#if 0
if (der_num >= cdh->num_der) {
return 0;
@@ -492,11 +457,6 @@ static int init_cur_collate(int der_num, __collate_t *cur_collate)
cur_collate->MAX_WEIGHTS = cdh->MAX_WEIGHTS;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Fix the +1 by increasing max_col_index?
-#warning CONSIDER: Since this collate info is dependent only on LC_COLLATE ll_cc and not on codeset, we could just globally allocate this for each in a table
-#endif
-
cur_collate->index2weight = calloc(2*cur_collate->max_col_index+2,
sizeof(uint16_t));
if (!cur_collate->index2weight) {
@@ -643,9 +603,6 @@ int attribute_hidden _locale_set_l(const unsigned char *p, __locale_t base)
c -= 3;
base->codeset = (char *) (r + r[c]);
base->encoding = __ctype_encoding_8_bit;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: update 8 bit mb_cur_max when translit implemented!
-#endif
/* TODO - update when translit implemented! */
base->mb_cur_max = 1;
c8b = __locale_mmap->codeset_8_bit + c;
@@ -775,9 +732,6 @@ int attribute_hidden _locale_set_l(const unsigned char *p, __locale_t base)
#endif /* __CTYPE_HAS_8_BIT_LOCALES */
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Put the outdigit string length in the locale_mmap object.
-#endif
d = base->outdigit_length;
x = &base->outdigit0_mb;
for (c = 0 ; c < 10 ; c++) {
@@ -798,9 +752,6 @@ int attribute_hidden _locale_set_l(const unsigned char *p, __locale_t base)
= __locale_mbrtowc_l(&base->thousands_sep_wc,
base->thousands_sep, base);
#if 1
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Remove hack involving grouping without a thousep char (bg_BG).
-#endif
assert(base->thousands_sep_len >= 0);
if (base->thousands_sep_len == 0) {
base->grouping = base->thousands_sep; /* empty string */
@@ -898,9 +849,6 @@ void attribute_hidden _locale_init_l(__locale_t base)
__ctype_toupper = __C_ctype_toupper;
#endif /* __UCLIBC_HAS_XLOCALE__ */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Initialize code2flag correctly based on locale_mmap.
-#endif
base->code2flag = __code2flag;
_locale_set_l((unsigned char*) C_LOCALE_SELECTOR, base);
@@ -1056,9 +1004,6 @@ libc_hidden_def(__XL_NPP(nl_langinfo))
#warning mask defines for extra locale categories
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Move posix and utf8 strings.
-#endif
static const char posix[] = "POSIX";
static const char utf8[] = "UTF-8";
@@ -1073,9 +1018,6 @@ static int find_locale(int category_mask, const char *p,
#if defined(__LOCALE_DATA_AT_MODIFIERS_LENGTH) && 1
/* Support standard locale handling for @-modifiers. */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: Fix buf size in find_locale.
-#endif
char buf[18]; /* TODO: 7+{max codeset name length} */
const char *q;
@@ -1226,9 +1168,6 @@ __locale_t newlocale(int category_mask, const char *locale, __locale_t base)
return NULL; /* No locale or illegal/unsupported category. */
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Rename cur_locale to locale_selector.
-#endif
strcpy((char *) new_selector,
(base ? (char *) base->cur_locale : C_LOCALE_SELECTOR));
@@ -1272,15 +1211,9 @@ __locale_t newlocale(int category_mask, const char *locale, __locale_t base)
goto INVALID;
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Do a compatible codeset check!
-#endif
/* If we get here, the new selector corresponds to a valid locale. */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Probably want a _locale_new func to allow for caching of locales.
-#endif
#if 0
if (base) {
_locale_set_l(new_selector, base);
@@ -1309,10 +1242,6 @@ libc_hidden_def(newlocale)
#ifdef L_duplocale
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: When we allocate ctype tables, remember to dup them.
-#endif
-
__locale_t duplocale(__locale_t dataset)
{
__locale_t r;
@@ -1341,10 +1270,6 @@ __locale_t duplocale(__locale_t dataset)
/**********************************************************************/
#ifdef L_freelocale
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: When we allocate ctype tables, remember to free them.
-#endif
-
void freelocale(__locale_t dataset)
{
assert(dataset != __global_locale);
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
index 03635d8..cd18916 100644
--- a/libc/misc/time/time.c
+++ b/libc/misc/time/time.c
@@ -1033,10 +1033,6 @@ static wchar_t* fmt_to_wc_1(const char *src)
#define MAX_PUSH 4
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Check multibyte format string validity.
-#endif
-
size_t __XL_NPP(strftime)(CHAR_T *__restrict s, size_t maxsize,
const CHAR_T *__restrict format,
const struct tm *__restrict timeptr __LOCALE_PARAM )
@@ -1871,10 +1867,6 @@ static const char *getnumber(register const char *e, int *pn)
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Should we preserve errno from open/read/close errors re TZ file?
-#endif
-
#ifdef __UCLIBC_HAS_TZ_FILE__
#ifndef __UCLIBC_HAS_TZ_FILE_READ_MANY__
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 966f78d..201f307 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -112,12 +112,6 @@
/**********************************************************************/
#ifdef __UCLIBC_HAS_LOCALE__
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L_iswspace
-/* generates one warning */
-#warning TODO: Fix Cc2wc* and Cwc2c* defines!
-#endif
-#endif /* __UCLIBC_MJN3_ONLY__ */
#define ENCODING (__UCLIBC_CURLOCALE->encoding)
@@ -134,13 +128,6 @@
#else /* __UCLIBC_HAS_LOCALE__ */
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L_btowc
-/* emit only once */
-#warning fix preprocessor logic testing locale settings
-#endif
-#endif
-
#define ENCODING (__ctype_encoding_7_bit)
#ifdef __CTYPE_HAS_8_BIT_LOCALES
#error __CTYPE_HAS_8_BIT_LOCALES is defined!
@@ -313,10 +300,6 @@ size_t mbrtowc(wchar_t *__restrict pwc, const char *__restrict s,
}
#endif
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: This adds a trailing nul!
-#endif /* __UCLIBC_MJN3_ONLY__ */
-
r = mbsnrtowcs(wcbuf, &p, SIZE_MAX, 1, ps);
if (((ssize_t) r) >= 0) {
@@ -339,9 +322,6 @@ libc_hidden_def(mbrtowc)
size_t wcrtomb(register char *__restrict s, wchar_t wc,
mbstate_t *__restrict ps)
{
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Should wcsnrtombs nul-terminate unconditionally? Check glibc.
-#endif /* __UCLIBC_MJN3_ONLY__ */
wchar_t wcbuf[1];
const wchar_t *pwc;
size_t r;
@@ -473,9 +453,6 @@ size_t attribute_hidden _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn,
--n;
if ((wc = ((unsigned char) *s++)) >= 0x80) { /* Not ASCII... */
mask = 0x40;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Fix range for 16 bit wchar_t case.
-#endif
if (( ((unsigned char)(s[-1] - 0xc0)) < (0xfe - 0xc0) ) &&
(((unsigned char)s[-1] != 0xc0 ) && ((unsigned char)s[-1] != 0xc1 ))) {
goto START;
@@ -910,12 +887,6 @@ libc_hidden_def(wcsnrtombs)
/**********************************************************************/
#ifdef L_wcswidth
-
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: If we start doing translit, wcwidth and wcswidth will need updating.
-#warning TODO: Update wcwidth to match latest by Kuhn.
-#endif
-
#if defined(__UCLIBC_HAS_LOCALE__) && \
( defined(__CTYPE_HAS_8_BIT_LOCALES) || defined(__CTYPE_HAS_UTF_8_LOCALES) )
@@ -1442,9 +1413,6 @@ size_t weak_function iconv(iconv_t cd, char **__restrict inbuf,
}
return (size_t)(-1);
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: optimize this.
-#endif
if (p != NULL) { /* incomplete char case */
goto INVALID;
}
@@ -1519,9 +1487,6 @@ size_t weak_function iconv(iconv_t cd, char **__restrict inbuf,
do {
r = _wchar_wcsntoutf8s(*outbuf, *outbytesleft, &pw, 1);
if (r != (size_t)(-1)) {
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: What happens for a nul?
-#endif
if (r == 0) {
if (wc != 0) {
goto TOO_BIG;
diff --git a/libc/misc/wctype/_wctype.c b/libc/misc/wctype/_wctype.c
index 68fae8b..81076ba 100644
--- a/libc/misc/wctype/_wctype.c
+++ b/libc/misc/wctype/_wctype.c
@@ -93,13 +93,6 @@ enum {
/*--------------------------------------------------------------------*/
-#ifdef __UCLIBC_MJN3_ONLY__
-# ifdef L_iswspace
-/* generates one warning */
-# warning TODO: Fix WC* defines!
-# endif
-#endif
-
#define ENCODING (__UCLIBC_CURLOCALE->encoding)
#define WCctype (__UCLIBC_CURLOCALE->tblwctype)
@@ -459,10 +452,6 @@ libc_hidden_def(wctype)
/**********************************************************************/
#ifdef L_wctype_l
-#ifdef __UCLIBC_MJN3_ONLY__
-# warning REMINDER: Currently wctype_l simply calls wctype.
-#endif
-
wctype_t wctype_l (const char *property, __locale_t locale)
{
return wctype(property);
@@ -485,12 +474,6 @@ wctype_t wctype_l (const char *property, __locale_t locale)
) \
)
-#ifdef __UCLIBC_MJN3_ONLY__
-# ifdef L_iswctype
-# warning CONSIDER: Change to bit shift? would need to sync with wctype.h
-# endif
-#endif
-
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
# if !defined(__UCLIBC_HAS_XLOCALE__) || defined(L_iswctype_l)
static const unsigned short int desc2flag[] = {
@@ -570,12 +553,6 @@ int iswctype(wint_t wc, wctype_t desc)
#else /* __LOCALE_C_ONLY */
-#ifdef __UCLIBC_MJN3_ONLY__
-# ifdef L_iswctype
-# warning CONSIDER: Handle combining class?
-# endif
-#endif
-
#ifdef L_iswctype
# define ISWCTYPE(w,d) iswctype(w,d)
#else
@@ -629,9 +606,6 @@ int ISWCTYPE(wint_t wc, wctype_t desc)
#endif
}
-#ifdef __UCLIBC_MJN3_ONLY__
-# warning TODO: xdigit really needs to be handled better. Remember only for ascii!
-#endif
/* TODO - Add locale-specific classifications. */
return (desc == _CTYPE_iswxdigit) ? __C_iswxdigit(wc) : 0;
}
@@ -741,9 +715,6 @@ wint_t TOWCTRANS(wint_t wc, wctrans_t desc)
}
wc += WCuplow_diff[i];
if (desc == _CTYPE_totitle) {
-#ifdef __UCLIBC_MJN3_ONLY__
-# warning TODO: Verify totitle special cases!
-#endif
/* WARNING! These special cases work for glibc 2.2.4. Changes
* may be needed if the glibc locale tables are updated. */
if ((__uwchar_t)(wc - 0x1c4) <= (0x1cc - 0x1c4)
@@ -781,9 +752,6 @@ wint_t TOWCTRANS(wint_t wc, wctrans_t desc)
if ((unsigned)(desc - _CTYPE_toupper) <= (_CTYPE_totitle - _CTYPE_toupper)) {
wc = TOWUPPER(wc, __UCLIBC_CURLOCALE);
if (desc == _CTYPE_totitle) {
-#ifdef __UCLIBC_MJN3_ONLY__
-# warning TODO: Verify totitle special cases!
-#endif
/* WARNING! These special cases work for glibc 2.2.4. Changes
* may be needed if the glibc locale tables are updated. */
if ((__uwchar_t)(wc - 0x1c4) <= (0x1cc - 0x1c4)
@@ -843,10 +811,6 @@ libc_hidden_def(wctrans)
/**********************************************************************/
#ifdef L_wctrans_l
-# ifdef __UCLIBC_MJN3_ONLY__
-# warning REMINDER: Currently wctrans_l simply calls wctrans.
-# endif
-
wctrans_t wctrans_l(const char *property, __locale_t locale)
{
return wctrans(property);
diff --git a/libc/stdio/_READ.c b/libc/stdio/_READ.c
index a548dbb..a3c1413 100644
--- a/libc/stdio/_READ.c
+++ b/libc/stdio/_READ.c
@@ -38,9 +38,6 @@ size_t attribute_hidden __stdio_READ(register FILE *stream,
bufsize = SSIZE_MAX;
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning EINTR?
-#endif
/* RETRY: */
if ((rv = __READ(stream, (char *) buf, bufsize)) <= 0) {
if (rv == 0) {
@@ -50,9 +47,6 @@ size_t attribute_hidden __stdio_READ(register FILE *stream,
__STDIO_STREAM_SET_ERROR(stream);
rv = 0;
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Make custom stream read return check optional.
-#endif
#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
} else {
assert(rv <= bufsize);
diff --git a/libc/stdio/_WRITE.c b/libc/stdio/_WRITE.c
index 712236f..113f0eb 100644
--- a/libc/stdio/_WRITE.c
+++ b/libc/stdio/_WRITE.c
@@ -46,9 +46,6 @@ size_t attribute_hidden __stdio_WRITE(register FILE *stream,
stodo = (todo <= SSIZE_MAX) ? todo : SSIZE_MAX;
rv = __WRITE(stream, (char *) buf, stodo);
if (rv >= 0) {
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Make custom stream write return check optional.
-#endif
#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
assert(rv <= stodo);
if (rv > stodo) { /* Wrote more than stodo! */
diff --git a/libc/stdio/_fopen.c b/libc/stdio/_fopen.c
index be05c48..ddad158 100644
--- a/libc/stdio/_fopen.c
+++ b/libc/stdio/_fopen.c
@@ -64,11 +64,6 @@ FILE attribute_hidden *_stdio_fopen(intptr_t fname_or_mode,
open_mode += (O_RDWR - (O_RDONLY | O_WRONLY));
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Implement glibc ccs option to bind a codeset?
-#warning CONSIDER: Implement glibc mmap option for readonly files?
-#warning CONSIDER: Implement a text mode using custom read/write funcs?
-#endif
#if defined(__UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE__) || defined(__UCLIBC_HAS_FOPEN_LARGEFILE_MODE__) || \
defined(__UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE__)
@@ -110,10 +105,6 @@ FILE attribute_hidden *_stdio_fopen(intptr_t fname_or_mode,
#endif
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Verify fdopen append behavior of glibc.
-#endif
-
if (filedes >= 0) { /* Handle fdopen trickery. */
stream->__filedes = filedes;
/* NOTE: it is insufficient to just check R/W/RW agreement.
diff --git a/libc/stdio/_fpmaxtostr.c b/libc/stdio/_fpmaxtostr.c
index 3580584..b06b25a 100644
--- a/libc/stdio/_fpmaxtostr.c
+++ b/libc/stdio/_fpmaxtostr.c
@@ -210,9 +210,6 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
intptr_t pc_fwi[3*MAX_CALLS];
intptr_t *ppc;
intptr_t *ppc_last;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: The size of exp_buf[] should really be determined by the float constants.
-#endif /* __UCLIBC_MJN3_ONLY__ */
char exp_buf[16];
char buf[BUF_SIZE];
char sign_str[6]; /* Last 2 are for 1st digit + nul. */
@@ -291,9 +288,6 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
{
int i, j;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Clean up defines when hexadecimal float notation is unsupported.
-#endif /* __UCLIBC_MJN3_ONLY__ */
#ifdef __UCLIBC_HAS_HEXADECIMAL_FLOATS__
@@ -375,9 +369,6 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
do {
uint_fast32_t digit_block = (uint_fast32_t) x;
assert(digit_block < upper_bnd);
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Can rounding be a problem?
-#endif /* __UCLIBC_MJN3_ONLY__ */
x = (x - digit_block) * upper_bnd;
s += dpb;
j = 0;
diff --git a/libc/stdio/_fwrite.c b/libc/stdio/_fwrite.c
index 47860af..2e712c9 100644
--- a/libc/stdio/_fwrite.c
+++ b/libc/stdio/_fwrite.c
@@ -25,9 +25,6 @@ size_t attribute_hidden __stdio_fwrite(const unsigned char * __restrict buffer,
assert(bytes);
if (!__STDIO_STREAM_IS_NBF(stream)) { /* FBF or LBF. */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Try to consolidate some of the code?
-#endif
if (__STDIO_STREAM_IS_FAKE_VSNPRINTF(stream)) {
pending = __STDIO_STREAM_BUFFER_WAVAIL(stream);
if (pending > bytes) {
@@ -66,9 +63,6 @@ size_t attribute_hidden __stdio_fwrite(const unsigned char * __restrict buffer,
if (__STDIO_COMMIT_WRITE_BUFFER(stream)) { /* Commit failed! */
return 0;
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Do we want to try again if data now fits in buffer?
-#endif
/* goto RETRY; */
}
}
diff --git a/libc/stdio/_rfill.c b/libc/stdio/_rfill.c
index e9d2fa6..d2b3de5 100644
--- a/libc/stdio/_rfill.c
+++ b/libc/stdio/_rfill.c
@@ -7,10 +7,6 @@
#include "_stdio.h"
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Do we really need a seperate rfill function?
-#endif
-
#ifdef __STDIO_BUFFERS
/* Read some data into the buffer.
diff --git a/libc/stdio/_scanf.c b/libc/stdio/_scanf.c
index 80e4956..3f3000d 100644
--- a/libc/stdio/_scanf.c
+++ b/libc/stdio/_scanf.c
@@ -192,10 +192,6 @@ int vscanf(const char * __restrict format, va_list arg)
/**********************************************************************/
#ifdef L_vsscanf
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning WISHLIST: Implement vsscanf for non-buf and no custom stream case.
-#endif /* __UCLIBC_MJN3_ONLY__ */
-
#ifdef __STDIO_BUFFERS
int vsscanf(const char *sp, const char *fmt, va_list ap)
@@ -424,13 +420,6 @@ enum {
#define SPEC_BASE { 16, 16, 16, 8, 10, 10, 0 }
#endif /* __UCLIBC_HAS_FLOATS__ */
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L_vfscanf
-/* emit once */
-#warning CONSIDER: Add a '0' flag to eat 0 padding when grouping?
-#endif
-#endif /* __UCLIBC_MJN3_ONLY__ */
-
#define SPEC_FLAGS "*'I"
enum {
@@ -630,9 +619,6 @@ extern int __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc) attribute_hid
/**********************************************************************/
#ifdef L___scan_cookie
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Remove dependence on decpt_str and fake_decpt in stub locale mode.
-#endif
#ifndef __UCLIBC_HAS_LOCALE__
static const char decpt_str[] = ".";
#endif
@@ -856,11 +842,6 @@ int attribute_hidden __psfs_parse_spec(register psfs_t *psfs)
}
psfs->dataargtype = ((int)(p[(sizeof(qual_chars)-2) / 2])) << 8;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Should we validate that psfs->max_width > 0 in __psfs_parse_spec()? It would avoid whitespace consumption...
-#warning CONSIDER: Should INT_MAX be a valid width (%c/%C)? See __psfs_parse_spec().
-#endif /* __UCLIBC_MJN3_ONLY__ */
-
p = spec_chars;
do {
if (*psfs->fmt == *p) {
@@ -1109,9 +1090,6 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg)
psfs_t psfs;
int i;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Fix MAX_DIGITS. We do not do binary, so...!
-#endif
#define MAX_DIGITS 65 /* Allow one leading 0. */
unsigned char buf[MAX_DIGITS+2];
#ifdef L_vfscanf
@@ -1122,9 +1100,6 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg)
unsigned char zero_conversions = 1;
__STDIO_AUTO_THREADLOCK_VAR;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Make checking of the format string in C locale an option.
-#endif
/* To support old programs, don't check mb validity if in C locale. */
#if defined(__UCLIBC_HAS_LOCALE__) && !defined(L_vfwscanf)
/* ANSI/ISO C99 requires format string to be a valid multibyte string
@@ -1285,9 +1260,6 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg)
}
if (psfs.conv_num == CONV_n) {
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Should %n count as a conversion as far as EOF return value?
-#endif
/* zero_conversions = 0; */
if (psfs.store) {
_store_inttype(psfs.cur_ptr, psfs.dataargtype,
@@ -1740,19 +1712,12 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
#ifdef __UCLIBC_HAS_FLOATS__
int exp_adjust = 0;
#endif
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Fix MAX_DIGITS. We do not do binary, so...!
-#warning TODO: Fix buf!
-#endif
#define MAX_DIGITS 65 /* Allow one leading 0. */
unsigned char buf[MAX_DIGITS+2+ 100];
unsigned char usflag, base;
unsigned char nonzero = 0;
unsigned char seendigit = 0;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: What should be returned for an invalid conversion specifier?
-#endif
#ifndef __UCLIBC_HAS_FLOATS__
if (psfs->conv_num > CONV_i) { /* floating point */
goto DONE;
@@ -1786,9 +1751,6 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
}
} while (1);
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Should we require a 0x prefix and disallow +/- for pointer %p?
-#endif /* __UCLIBC_MJN3_ONLY__ */
}
__scan_getc(sc);
@@ -1844,10 +1806,6 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
int nblk1, nblk2, nbmax, lastblock, pass, i;
-
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Should we initalize the grouping blocks in __init_scan_cookie()?
-#endif /* __UCLIBC_MJN3_ONLY__ */
nbmax = nblk2 = nblk1 = *p;
if (*++p) {
nblk2 = *p;
@@ -1876,9 +1834,6 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
if (sc->cc == '0') {
seendigit = 1;
*b++ = '0'; /* Store the first 0. */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Should leading 0s be skipped before digit grouping? (printf 0 pad)
-#endif /* __UCLIBC_MJN3_ONLY__ */
#if 0
do { /* But ignore all subsequent 0s. */
__scan_getc(sc);
@@ -2155,9 +2110,6 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
__scan_getc(sc);
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Fix MAX_EXP_DIGITS!
-#endif
#define MAX_EXP_DIGITS 20
assert(seendigit);
seendigit = 0;
diff --git a/libc/stdio/_vfprintf.c b/libc/stdio/_vfprintf.c
index a795f49..fc5d3ff 100644
--- a/libc/stdio/_vfprintf.c
+++ b/libc/stdio/_vfprintf.c
@@ -130,14 +130,6 @@
/**********************************************************************/
-#ifdef __UCLIBC_MJN3_ONLY__
-# ifdef L_register_printf_function
-/* emit only once */
-# warning WISHLIST: Make MAX_USER_SPEC configurable?
-# warning WISHLIST: Make MAX_ARGS_PER_SPEC configurable?
-# endif
-#endif
-
#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_PRINTF__
# define MAX_USER_SPEC 10
# define MAX_ARGS_PER_SPEC 5
@@ -460,9 +452,6 @@ int attribute_hidden _ppfs_init(register ppfs_t *ppfs, const char *fmt0)
--ppfs->maxposarg; /* set to -1 */
#endif
ppfs->fmtpos = fmt0;
-#ifdef __UCLIBC_MJN3_ONLY__
-# warning TODO: Make checking of the format string in C locale an option.
-#endif
#ifdef __UCLIBC_HAS_LOCALE__
/* To support old programs, don't check mb validity if in C locale. */
if (__UCLIBC_CURLOCALE->encoding != __ctype_encoding_7_bit) {
@@ -878,11 +867,6 @@ int attribute_hidden _ppfs_parsespec(ppfs_t *ppfs)
} else {
if (maxposarg > 0) {
# ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
-# ifdef __UCLIBC_MJN3_ONLY__
-# warning TODO: Support prec and width for %m when positional args used
- /* Actually, positional arg processing will fail in general
- * for specifiers that don't require an arg. */
-# endif
if (*fmt == 'm') {
goto PREC_WIDTH;
}
@@ -1414,9 +1398,6 @@ static int _do_one_spec(FILE * __restrict stream,
int numfill = 0; /* TODO: fix */
int prefix_num = PREFIX_NONE;
char padchar = ' ';
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Determine appropriate buf size.
-#endif
/* TODO: buf needs to be big enough for any possible error return strings
* and also for any locale-grouped long long integer strings generated.
* This should be large enough for any of the current archs/locales, but
@@ -1468,11 +1449,6 @@ static int _do_one_spec(FILE * __restrict stream,
if (ppfs->conv_num <= CONV_i) { /* pointer or (un)signed int */
alphacase = __UIM_LOWER;
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L__vfprintf_internal
-#warning CONSIDER: Should we ignore these flags if stub locale? What about custom specs?
-#endif
-#endif
base = spec_base[(int)(ppfs->conv_num - CONV_p)];
if (base == 10) {
if (PRINT_INFO_FLAG_VAL(&(ppfs->info),group)) {
@@ -1497,11 +1473,6 @@ static int _do_one_spec(FILE * __restrict stream,
if (ppfs->info.prec < 0) { /* Ignore '0' flag if prec specified. */
padchar = ppfs->info.pad;
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L__vfprintf_internal
-#warning CONSIDER: If using outdigits and/or grouping, how should we interpret precision?
-#endif
-#endif
s = _uintmaxtostr(buf + sizeof(buf) - 1,
(uintmax_t)
_load_inttype(ppfs->conv_num == CONV_p ? PA_FLAG_LONG : *argtype & __PA_INTMASK,
@@ -1654,9 +1625,6 @@ static int _do_one_spec(FILE * __restrict stream,
} else if (ppfs->conv_num <= CONV_s) { /* char or string */
if (ppfs->conv_num == CONV_s) { /* string */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Fix %s for _vfwprintf_internal... output upto illegal sequence?
-#endif
s = *((char **) (*argptr));
if (s) {
#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
@@ -1722,11 +1690,6 @@ static int _do_one_spec(FILE * __restrict stream,
return -1;
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L__vfprintf_internal
-#warning CONSIDER: If using outdigits and/or grouping, how should we pad?
-#endif
-#endif
{
size_t t;
diff --git a/libc/stdio/_wfwrite.c b/libc/stdio/_wfwrite.c
index 517e3a7..65b38e7 100644
--- a/libc/stdio/_wfwrite.c
+++ b/libc/stdio/_wfwrite.c
@@ -12,11 +12,6 @@
#error wide function when no wide support!
#endif
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning TODO: Fix prototype.
-#endif
-
-
size_t attribute_hidden _wstdio_fwrite(const wchar_t *__restrict ws, size_t n,
register FILE *__restrict stream)
{
diff --git a/libc/stdio/fclose.c b/libc/stdio/fclose.c
index 7e7bc3b..26b27c8 100644
--- a/libc/stdio/fclose.c
+++ b/libc/stdio/fclose.c
@@ -85,9 +85,6 @@ int fclose(register FILE *stream)
__STDIO_AUTO_THREADUNLOCK(stream);
__STDIO_STREAM_FREE_BUFFER(stream);
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: inefficient - locks and unlocks twice and walks whole list
-#endif
#if defined(__UCLIBC_HAS_THREADS__) && defined(__STDIO_BUFFERS)
/* inefficient - locks/unlocks twice and walks whole list */
__STDIO_OPENLIST_INC_DEL_CNT;
diff --git a/libc/stdio/fcloseall.c b/libc/stdio/fcloseall.c
index 4d78b37..ab8248c 100644
--- a/libc/stdio/fcloseall.c
+++ b/libc/stdio/fcloseall.c
@@ -27,17 +27,11 @@ int fcloseall (void)
__STDIO_OPENLIST_INC_USE;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: should probably have a get_head() operation
-#endif
__STDIO_THREADLOCK_OPENLIST_ADD;
f = _stdio_openlist;
__STDIO_THREADUNLOCK_OPENLIST_ADD;
while (f) {
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: should probably have a get_next() operation
-#endif
FILE *n = f->__nextopen;
__STDIO_AUTO_THREADLOCK_VAR;
diff --git a/libc/stdio/fflush.c b/libc/stdio/fflush.c
index cf0356a..7c05ea5 100644
--- a/libc/stdio/fflush.c
+++ b/libc/stdio/fflush.c
@@ -10,10 +10,6 @@
#ifdef __DO_UNLOCKED
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning WISHLIST: Add option to test for undefined behavior of fflush.
-#endif /* __UCLIBC_MJN3_ONLY__ */
-
/* Even if the stream is set to user-locking, we still need to lock
* when all (lbf) writing streams are flushed. */
@@ -34,16 +30,10 @@ void attribute_hidden _stdio_openlist_dec_use(void)
FILE *n;
FILE *stream;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: As an optimization, we could unlock after we move past the head.
-#endif
/* Grab the openlist add lock since we might change the head of the list. */
__STDIO_THREADLOCK_OPENLIST_ADD;
for (stream = _stdio_openlist; stream; stream = n) {
n = stream->__nextopen;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: fix for nonatomic
-#endif
if ((stream->__modeflags & (__FLAG_READONLY|__FLAG_WRITEONLY|__FLAG_FAILED_FREOPEN))
== (__FLAG_READONLY|__FLAG_WRITEONLY)
) { /* The file was closed and should be removed from the list. */
@@ -70,9 +60,6 @@ int fflush_unlocked(register FILE *stream)
#ifdef __STDIO_BUFFERS
int retval = 0;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning REMINDER: should probably define a modeflags type
-#endif
unsigned short bufmask = __FLAG_LBF;
#ifndef NDEBUG
diff --git a/libc/stdio/fgets.c b/libc/stdio/fgets.c
index bc710c7..0a6d31e 100644
--- a/libc/stdio/fgets.c
+++ b/libc/stdio/fgets.c
@@ -19,9 +19,6 @@ char *fgets_unlocked(char *__restrict s, int n,
__STDIO_STREAM_VALIDATE(stream);
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: What should fgets do if n <= 0?
-#endif /* __UCLIBC_MJN3_ONLY__ */
/* Should we assert here? Or set errno? Or just fail... */
if (n <= 0) {
/* __set_errno(EINVAL); */
@@ -48,9 +45,6 @@ char *fgets_unlocked(char *__restrict s, int n,
}
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: If n==1 and not at EOF, should fgets return an empty string?
-#endif /* __UCLIBC_MJN3_ONLY__ */
if (p > s) {
*p = 0;
return s;
diff --git a/libc/stdio/fputc.c b/libc/stdio/fputc.c
index 7876d77..d4e5d25 100644
--- a/libc/stdio/fputc.c
+++ b/libc/stdio/fputc.c
@@ -41,9 +41,6 @@ int __fputc_unlocked(int c, register FILE *stream)
) {
goto BAD;
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Should we fail if the commit fails but we now have room?
-#endif
__STDIO_STREAM_BUFFER_ADD(stream, ((unsigned char) c));
diff --git a/libc/stdio/fread.c b/libc/stdio/fread.c
index 5df33b4..5f4ec6f 100644
--- a/libc/stdio/fread.c
+++ b/libc/stdio/fread.c
@@ -62,9 +62,6 @@ size_t fread_unlocked(void * __restrict ptr, size_t size, size_t nmemb,
}
#endif
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: should we refill and read from the buffer sometimes?
-#endif
while ((avail = __stdio_READ(stream, buffer, todo)) > 0) {
buffer += avail;
if (!(todo -= avail)) {
diff --git a/libc/stdio/ftrylockfile.c b/libc/stdio/ftrylockfile.c
index 0d2e156..c2f49ca 100644
--- a/libc/stdio/ftrylockfile.c
+++ b/libc/stdio/ftrylockfile.c
@@ -7,10 +7,6 @@
#include "_stdio.h"
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: What should this return when not threading?
-#endif
-
int ftrylockfile(FILE *stream)
{
__STDIO_STREAM_VALIDATE(stream);
diff --git a/libc/stdio/perror.c b/libc/stdio/perror.c
index 8b943e4..d36d75b 100644
--- a/libc/stdio/perror.c
+++ b/libc/stdio/perror.c
@@ -7,11 +7,6 @@
#include "_stdio.h"
-
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Increase buffer size for error message (non-%m case)?
-#endif
-
void perror(register const char *s)
{
/* If the program is calling perror, it's a safe bet that printf and
diff --git a/libc/stdio/popen.c b/libc/stdio/popen.c
index 1efbd3b..a5aa998 100644
--- a/libc/stdio/popen.c
+++ b/libc/stdio/popen.c
@@ -23,10 +23,6 @@
#include <sys/wait.h>
#include <bits/uClibc_mutex.h>
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning "hmm... susv3 says Pipe streams are byte-oriented."
-#endif /* __UCLIBC_MJN3_ONLY__ */
-
#ifndef VFORK_LOCK
__UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER);
# define VFORK_LOCK __UCLIBC_MUTEX_LOCK(mylock)
diff --git a/libc/stdio/ungetc.c b/libc/stdio/ungetc.c
index ea4edd2..14c8d95 100644
--- a/libc/stdio/ungetc.c
+++ b/libc/stdio/ungetc.c
@@ -31,9 +31,6 @@ int ungetc(int c, register FILE *stream)
__STDIO_AUTO_THREADLOCK(stream);
__STDIO_STREAM_VALIDATE(stream);
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning CONSIDER: Make fast ungetc an option?
-#endif
#ifdef __UCLIBC_HAS_STDIO_GETC_MACRO__
/* If buffered narrow reading with no ungot slots filled, and if not
* ungetting a different char than the one last read from the buffer,
diff --git a/libc/stdio/vasprintf.c b/libc/stdio/vasprintf.c
index fa7926c..026d8b2 100644
--- a/libc/stdio/vasprintf.c
+++ b/libc/stdio/vasprintf.c
@@ -12,12 +12,6 @@
#include <stdarg.h>
#include <bits/uClibc_va_copy.h>
-
-#ifdef __UCLIBC_MJN3_ONLY__
-/* Do the memstream stuff inline to avoid fclose and the openlist? */
-#warning CONSIDER: avoid open_memstream call?
-#endif
-
#ifndef __STDIO_HAS_VSNPRINTF
#warning Skipping vasprintf since no vsnprintf!
#else
diff --git a/libc/stdio/vsnprintf.c b/libc/stdio/vsnprintf.c
index 3a4c607..9e1bed1 100644
--- a/libc/stdio/vsnprintf.c
+++ b/libc/stdio/vsnprintf.c
@@ -8,11 +8,6 @@
#include "_stdio.h"
#include <stdarg.h>
-
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning WISHLIST: Implement vsnprintf for non-buffered and no custom stream case.
-#endif /* __UCLIBC_MJN3_ONLY__ */
-
#ifdef __STDIO_BUFFERS
/* NB: we can still have __USE_OLD_VFPRINTF__ defined in this case! */
diff --git a/libc/stdlib/drand48-iter.c b/libc/stdlib/drand48-iter.c
index b4b7b33..1ddf402 100644
--- a/libc/stdlib/drand48-iter.c
+++ b/libc/stdlib/drand48-iter.c
@@ -26,9 +26,6 @@
/* Global state for non-reentrant functions. */
struct drand48_data __libc_drand48_data;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning turn int __drand48_iterate into void
-#endif /* __UCLIBC_MJN3_ONLY__ */
int __drand48_iterate (unsigned short int xsubi[3], struct drand48_data *buffer)
{
uint64_t X;
diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
index 6c887ea..075e6e5 100644
--- a/libc/stdlib/stdlib.c
+++ b/libc/stdlib/stdlib.c
@@ -70,12 +70,6 @@
#else /* __UCLIBC_HAS_LOCALE__ */
-#ifdef __UCLIBC_MJN3_ONLY__
-#ifdef L_mblen
-/* emit only once */
-#warning devel checks
-#endif
-#endif
#ifdef __CTYPE_HAS_8_BIT_LOCALES
#error __CTYPE_HAS_8_BIT_LOCALES is defined!
#endif
@@ -821,11 +815,6 @@ size_t _stdlib_mb_cur_max(void)
#ifdef __CTYPE_HAS_UTF_8_LOCALES
return __UCLIBC_CURLOCALE->mb_cur_max;
#else
-#ifdef __CTYPE_HAS_8_BIT_LOCALES
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning need to change this when/if transliteration is implemented
-#endif
-#endif
return 1;
#endif
}
diff --git a/libc/string/_collate.c b/libc/string/_collate.c
index 93501b8..d487c8b 100644
--- a/libc/string/_collate.c
+++ b/libc/string/_collate.c
@@ -173,9 +173,6 @@ static void next_weight(col_state_t *cs, int pass __LOCALE_PARAM )
goto POSITION_SKIP;
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning should we walk pendings backwards?
-#endif
if (cs->cip) { /* possible pending weight */
if ((r = *(cs->cip++)) == 0) {
cs->cip = NULL;
@@ -267,9 +264,6 @@ static void next_weight(col_state_t *cs, int pass __LOCALE_PARAM )
} while (1);
} else if (r == 0) { /* illegal, undefined, or part of a range */
if ((CUR_COLLATE->range_count)
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning .. need to introduce range as a collating item?
-#endif
&& (((__uwchar_t)(WC - CUR_COLLATE->range_low)) <= CUR_COLLATE->range_count)
) { /* part of a range */
/* Note: cs->colitem = 0 already. */
@@ -288,9 +282,6 @@ static void next_weight(col_state_t *cs, int pass __LOCALE_PARAM )
assert(ri != 0); /* implicit undefined isn't supported */
TRACE((" found explicit UNDEFINED\n"));
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning right now single weight locales do not support ..
-#endif
if (CUR_COLLATE->num_weights == 1) {
TRACE((" single weight UNDEFINED\n"));
cs->weightidx = RANGE_IDX;
@@ -333,9 +324,6 @@ static void next_weight(col_state_t *cs, int pass __LOCALE_PARAM )
FOUND:
ri = CUR_COLLATE->index2ruleidx[cs->colitem - 1];
TRACE((" ri=%d ", ri));
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning make sure this is correct
-#endif
if (!ri) {
TRACE(("NOT IN THIS LOCALE\n"));
goto UNDEFINED;
@@ -344,9 +332,6 @@ static void next_weight(col_state_t *cs, int pass __LOCALE_PARAM )
RANGE_SKIP_TO:
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning ignoreables probably should not interrupt backwards processing, but this is wrong
-#endif
/* if (!(ru & WEIGHT_MASK)) { */
/* TRACE(("IGNORE\n")); */
/* cs->s += n; */
@@ -368,9 +353,6 @@ static void next_weight(col_state_t *cs, int pass __LOCALE_PARAM )
cs->bp = malloc(cs->bb_size + 128);
if (!cs->bp) {
/* __set_errno(ENOMEM); */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning what to do here?
-#endif
cs->weight = 0;
return;
}
@@ -380,9 +362,6 @@ static void next_weight(col_state_t *cs, int pass __LOCALE_PARAM )
cs->bp = realloc(cs->back_buf, cs->bb_size + 128);
if (!cs->bp) {
/* __set_errno(ENOMEM); */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning what to do here?
-#endif
cs->weight = 0;
return;
}
@@ -430,9 +409,6 @@ static void next_weight(col_state_t *cs, int pass __LOCALE_PARAM )
assert(ru & WEIGHT_MASK);
cs->ru_pushed = ru;
cs->weight = cs->position;
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning devel code
-#endif
cs->position = 0; /* reset to reduce size for strcoll? */
cs->s += n;
cs->weightidx = RANGE_IDX;
@@ -453,9 +429,6 @@ static void next_weight(col_state_t *cs, int pass __LOCALE_PARAM )
cs->rule = ru & RULE_MASK;
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning for pending we only want the weight... _not_ the rule
-#endif
if (!cs->weightidx) { /* ignore */
continue;
}
@@ -547,10 +520,6 @@ size_t __XL_NPP(wcsxfrm)(wchar_t *__restrict ws1, const wchar_t *__restrict ws2,
return __wcslcpy(ws1, ws2, n);
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning handle empty string as a special case
-#endif
-
count = pass = 0;
do { /* loop through the weights levels */
init_col_state(&cs, ws2);
@@ -630,10 +599,6 @@ size_t __XL_NPP(strxfrm)(char *__restrict ws1, const char *__restrict ws2, size_
return strlcpy(ws1, ws2, n);
}
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning handle empty string as a special case
-#endif
-
inc = count = pass = 0;
do { /* loop through the weights levels */
init_col_state(&cs, ws2);
diff --git a/libpthread/linuxthreads/spinlock.c b/libpthread/linuxthreads/spinlock.c
index 80aeda5..ce97002 100644
--- a/libpthread/linuxthreads/spinlock.c
+++ b/libpthread/linuxthreads/spinlock.c
@@ -188,10 +188,16 @@ int __pthread_unlock(struct _pthread_fastlock * lock)
WRITE_MEMORY_BARRIER();
again:
- while ((oldstatus = lock->__status) == 1) {
- if (__compare_and_swap_with_release_semantics(&lock->__status,
+ oldstatus = lock->__status;
+ if (oldstatus == 0 || oldstatus == 1) {
+ /* No threads are waiting for this lock. Please note that we also
+ enter this case if the lock is not taken at all. If this wouldn't
+ be done here we would crash further down. */
+ if (! __compare_and_swap_with_release_semantics(&lock->__status,
oldstatus, 0))
- return 0;
+ goto again;
+
+ return 0;
}
/* Find thread in waiting queue with maximal priority */
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
index 5522ce3..80a0306 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
@@ -7,10 +7,9 @@
libpthread_linux_arch_SSRC =
libpthread_linux_arch_CSRC = pthread_once.c \
- pt-__syscall_rt_sigaction.c pt-__syscall_error.c \
- lowlevellock.c
+ pt-__syscall_rt_sigaction.c pt-__syscall_error.c
-libc_linux_arch_CSRC = fork.c libc-lowlevellock.c
+libc_linux_arch_CSRC = fork.c
libc_linux_arch_SSRC = clone.S vfork.S
libc_linux_arch_SSRC-OMIT = waitpid.S
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/libc-lowlevellock.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/libc-lowlevellock.c
deleted file mode 100644
index 28672a6..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/libc-lowlevellock.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Paul Mackerras <paulus(a)au.ibm.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* No difference to lowlevellock.c, except we lose a couple of functions. */
-#include "lowlevellock.c"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/lowlevellock.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/lowlevellock.c
deleted file mode 100644
index cd42135..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/lowlevellock.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* low level locking for pthread library. Generic futex-using version.
- Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <sysdep.h>
-#include <lowlevellock.h>
-#include <sys/time.h>
-#include <tls.h>
-
-void
-#ifndef IS_IN_libpthread
-weak_function
-#endif
-__lll_lock_wait_private (int *futex)
-{
- do
- {
- int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
- if (oldval != 0)
- lll_futex_wait (futex, 2, LLL_PRIVATE);
- }
- while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
-}
-
-
-/* These functions don't get included in libc.so */
-#ifdef IS_IN_libpthread
-void
-__lll_lock_wait (int *futex, int private)
-{
- do
- {
- int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
- if (oldval != 0)
- lll_futex_wait (futex, 2, private);
- }
- while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
-}
-
-
-int
-__lll_timedlock_wait (int *futex, const struct timespec *abstime, int private)
-{
- struct timespec rt;
-
- /* Reject invalid timeouts. */
- if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
- return EINVAL;
-
- /* Upgrade the lock. */
- if (atomic_exchange_acq (futex, 2) == 0)
- return 0;
-
- do
- {
- struct timeval tv;
-
- /* Get the current time. */
- (void) gettimeofday (&tv, NULL);
-
- /* Compute relative timeout. */
- rt.tv_sec = abstime->tv_sec - tv.tv_sec;
- rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
- if (rt.tv_nsec < 0)
- {
- rt.tv_nsec += 1000000000;
- --rt.tv_sec;
- }
-
- /* Already timed out? */
- if (rt.tv_sec < 0)
- return ETIMEDOUT;
-
- // XYZ: Lost the lock to check whether it was private.
- lll_futex_timed_wait (futex, 2, &rt, private);
- }
- while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
-
- return 0;
-}
-
-
-int
-__lll_timedwait_tid (int *tidp, const struct timespec *abstime)
-{
- int tid;
-
- if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
- return EINVAL;
-
- /* Repeat until thread terminated. */
- while ((tid = *tidp) != 0)
- {
- struct timeval tv;
- struct timespec rt;
-
- /* Get the current time. */
- (void) gettimeofday (&tv, NULL);
-
- /* Compute relative timeout. */
- rt.tv_sec = abstime->tv_sec - tv.tv_sec;
- rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
- if (rt.tv_nsec < 0)
- {
- rt.tv_nsec += 1000000000;
- --rt.tv_sec;
- }
-
- /* Already timed out? */
- if (rt.tv_sec < 0)
- return ETIMEDOUT;
-
- /* Wait until thread terminates. */
- // XYZ: Lost the lock to check whether it was private.
- if (lll_futex_timed_wait (tidp, tid, &rt, LLL_SHARED) == -ETIMEDOUT)
- return ETIMEDOUT;
- }
-
- return 0;
-}
-#endif
diff --git a/test/Test.mak b/test/Test.mak
index c1b34a7..c9b1f5a 100644
--- a/test/Test.mak
+++ b/test/Test.mak
@@ -116,7 +116,7 @@ compile: $(COMPILE_TARGETS)
G_TARGET_SRCS := $(addsuffix .c,$(G_TARGETS))
U_TARGET_SRCS := $(addsuffix .c,$(U_TARGETS))
-MAKE_SRCS := Makefile $(TESTDIR)Makefile $(TESTDIR)Rules.mak $(TESTDIR)Test.mak
+MAKE_SRCS := $(wildcard Makefile.in) $(TESTDIR)Makefile $(TESTDIR)Rules.mak $(TESTDIR)Test.mak
$(U_TARGETS): $(U_TARGET_SRCS) $(MAKE_SRCS)
$(showlink)
diff --git a/test/nptl/tst-mutex1.c b/test/pthread/ex8-mtx-odd.c
similarity index 64%
copy from test/nptl/tst-mutex1.c
copy to test/pthread/ex8-mtx-odd.c
index 0f3a98c..791b2c2 100644
--- a/test/nptl/tst-mutex1.c
+++ b/test/pthread/ex8-mtx-odd.c
@@ -13,40 +13,40 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include <errno.h>
#include <pthread.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
+
static int
do_test (void)
{
- pthread_mutex_t m;
-
- if (pthread_mutex_init (&m, NULL) != 0)
- {
- puts ("mutex_init failed");
- return 1;
- }
- if (pthread_mutex_lock (&m) != 0)
+ if (pthread_mutex_lock (&lock) != 0)
{
puts ("mutex_lock failed");
- return 1;
+ exit (1);
}
- if (pthread_mutex_unlock (&m) != 0)
+ if (pthread_mutex_unlock (&lock) != 0)
{
- puts ("mutex_unlock failed");
- return 1;
+ puts ("1st mutex_unlock failed");
+ exit (1);
}
- if (pthread_mutex_destroy (&m) != 0)
+ if (pthread_mutex_unlock (&lock) != 0)
{
- puts ("mutex_destroy failed");
- return 1;
+ puts ("2nd mutex_unlock failed");
+ exit (1);
}
return 0;
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
From: Cupertino Miranda <cmiranda(a)synopsys.com>
Wih new bintuils supporting DT_RELACOUNT, ldso was crashing as it was
parsing relocs incorrectly.
Apparently that code ran for first time and was never tested.
Signed-off-by: Vineet Gupta <vgupta(a)synopsys.com>
---
ldso/ldso/arc/dl-sysdep.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ldso/ldso/arc/dl-sysdep.h b/ldso/ldso/arc/dl-sysdep.h
index b6bda9d14691..caece997d254 100644
--- a/ldso/ldso/arc/dl-sysdep.h
+++ b/ldso/ldso/arc/dl-sysdep.h
@@ -166,7 +166,7 @@ static __always_inline void
elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
Elf32_Word relative_count)
{
- Elf32_Rel * rpnt = (void *) rel_addr;
+ Elf32_Rela * rpnt = (void *) rel_addr;
--rpnt;
do {
Elf32_Addr *const reloc_addr = (void *) (load_off + (++rpnt)->r_offset);
--
2.5.0
4
10
uClibc-ng - small C library for embedded systems branch master updated. v1.0.15-1-g3ac3d4e
by wbx@helium.openadk.org 31 May '16
by wbx@helium.openadk.org 31 May '16
31 May '16
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 3ac3d4e61a1de0c2d0e0d2bebf0d1b111f153f12 (commit)
from 95174cb69c523a1544e5f6f20e47f7d60007e569 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3ac3d4e61a1de0c2d0e0d2bebf0d1b111f153f12
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Tue May 31 20:51:29 2016 +0200
arm: add non-assembly versions of pthread_spin_lock/pthread_spin_trylock
Sync pthread_spin_lock/pthread_spin_trylock with GNU libc as it avoids
any usage of deprecated SWP instruction. This allows to build uClibc-ng
for ARMv8 Cortex-A53 CPU in 32 Bit mode.
-----------------------------------------------------------------------
Summary of changes:
libpthread/nptl/sysdeps/arm/pthread_spin_lock.S | 30 ----------
libpthread/nptl/sysdeps/arm/pthread_spin_lock.c | 66 ++++++++++++++++++++++
libpthread/nptl/sysdeps/arm/pthread_spin_trylock.S | 33 -----------
.../sysdeps/{sparc => arm}/pthread_spin_trylock.c | 9 ++-
4 files changed, 70 insertions(+), 68 deletions(-)
delete mode 100644 libpthread/nptl/sysdeps/arm/pthread_spin_lock.S
create mode 100644 libpthread/nptl/sysdeps/arm/pthread_spin_lock.c
delete mode 100644 libpthread/nptl/sysdeps/arm/pthread_spin_trylock.S
copy libpthread/nptl/sysdeps/{sparc => arm}/pthread_spin_trylock.c (77%)
diff --git a/libpthread/nptl/sysdeps/arm/pthread_spin_lock.S b/libpthread/nptl/sysdeps/arm/pthread_spin_lock.S
deleted file mode 100644
index a9c07c8..0000000
--- a/libpthread/nptl/sysdeps/arm/pthread_spin_lock.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-
- .text
- .align 4
-
-ENTRY (pthread_spin_lock)
- mov r1, #1
-1: swp r2, r1, [r0]
- teq r2, #0
- bne 1b
- mov r0, #0
- PSEUDO_RET_NOERRNO
-END (pthread_spin_lock)
diff --git a/libpthread/nptl/sysdeps/arm/pthread_spin_lock.c b/libpthread/nptl/sysdeps/arm/pthread_spin_lock.c
new file mode 100644
index 0000000..77f5f50
--- /dev/null
+++ b/libpthread/nptl/sysdeps/arm/pthread_spin_lock.c
@@ -0,0 +1,66 @@
+/* pthread_spin_lock -- lock a spin lock. Generic version.
+ Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <atomic.h>
+#include "pthreadP.h"
+
+/* A machine-specific version can define SPIN_LOCK_READS_BETWEEN_CMPXCHG
+ to the number of plain reads that it's optimal to spin on between uses
+ of atomic_compare_and_exchange_val_acq. If spinning forever is optimal
+ then use -1. If no plain reads here would ever be optimal, use 0. */
+#define SPIN_LOCK_READS_BETWEEN_CMPXCHG 1000
+
+int
+pthread_spin_lock (pthread_spinlock_t *lock)
+{
+ /* atomic_exchange usually takes less instructions than
+ atomic_compare_and_exchange. On the other hand,
+ atomic_compare_and_exchange potentially generates less bus traffic
+ when the lock is locked.
+ We assume that the first try mostly will be successful, and we use
+ atomic_exchange. For the subsequent tries we use
+ atomic_compare_and_exchange. */
+ if (atomic_exchange_acq (lock, 1) == 0)
+ return 0;
+
+ do
+ {
+ /* The lock is contended and we need to wait. Going straight back
+ to cmpxchg is not a good idea on many targets as that will force
+ expensive memory synchronizations among processors and penalize other
+ running threads.
+ On the other hand, we do want to update memory state on the local core
+ once in a while to avoid spinning indefinitely until some event that
+ will happen to update local memory as a side-effect. */
+ if (SPIN_LOCK_READS_BETWEEN_CMPXCHG >= 0)
+ {
+ int wait = SPIN_LOCK_READS_BETWEEN_CMPXCHG;
+
+ while (*lock != 0 && wait > 0)
+ --wait;
+ }
+ else
+ {
+ while (*lock != 0)
+ ;
+ }
+ }
+ while (atomic_compare_and_exchange_val_acq (lock, 1, 0) != 0);
+
+ return 0;
+}
diff --git a/libpthread/nptl/sysdeps/arm/pthread_spin_trylock.S b/libpthread/nptl/sysdeps/arm/pthread_spin_trylock.S
deleted file mode 100644
index 8ccaffd..0000000
--- a/libpthread/nptl/sysdeps/arm/pthread_spin_trylock.S
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#define _ERRNO_H 1
-#include <bits/errno.h>
-
-#include <sysdep.h>
-
- .text
- .align 4
-
-ENTRY (pthread_spin_trylock)
- mov r1, #1
- swp r2, r1, [r0]
- teq r2, #0
- moveq r0, #0
- movne r0, #EBUSY
- PSEUDO_RET_NOERRNO
-END (pthread_spin_trylock)
diff --git a/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c b/libpthread/nptl/sysdeps/arm/pthread_spin_trylock.c
similarity index 77%
copy from libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
copy to libpthread/nptl/sysdeps/arm/pthread_spin_trylock.c
index c1b7b23..4e1a96c 100644
--- a/libpthread/nptl/sysdeps/sparc/pthread_spin_trylock.c
+++ b/libpthread/nptl/sysdeps/arm/pthread_spin_trylock.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* pthread_spin_trylock -- trylock a spin lock. Generic version.
+ Copyright (C) 2012-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,12 +17,11 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
+#include <atomic.h>
#include "pthreadP.h"
int
pthread_spin_trylock (pthread_spinlock_t *lock)
{
- int res;
- __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
- return res == 0 ? 0 : EBUSY;
+ return atomic_exchange_acq (lock, 1) ? EBUSY : 0;
}
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0
31 May '16
Hi
I meet a problem with sscanf(), I want to use this function to parse
string into number. But I found the neither uint16_t nor uint8_t could
work with %d. Here is the sample code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
int main(int argc, char **argv)
{
uint8_t num1;
uint16_t num2;
uint32_t num3;
sscanf("10", "%d", &num1);
sscanf("10", "%d", &num2);
sscanf("10", "%d", &num3);
printf("input number is %d %d %d\n", num1, num2, num3);
return 0;
}
input number is 0 0 10
But if it is built with glibc at x86_64, the result would be:
input number is 0 10 10
I have no idea why the uint8_t doesn't work, but why the uint16_t
doesn't work?
Here is the config of uclibc, from openwrt
#
# Automatically generated make config: don't edit
# Version: 0.9.33.2
# Sun Mar 20 17:05:37 2016
#
# TARGET_alpha is not set
# TARGET_arm is not set
# TARGET_avr32 is not set
# TARGET_bfin is not set
# TARGET_c6x is not set
# TARGET_cris is not set
# TARGET_e1 is not set
# TARGET_frv is not set
# TARGET_h8300 is not set
# TARGET_hppa is not set
# TARGET_i386 is not set
# TARGET_i960 is not set
# TARGET_ia64 is not set
# TARGET_m68k is not set
# TARGET_microblaze is not set
TARGET_mips=y
# TARGET_nios is not set
# TARGET_nios2 is not set
# TARGET_powerpc is not set
# TARGET_sh is not set
# TARGET_sh64 is not set
# TARGET_sparc is not set
# TARGET_v850 is not set
# TARGET_vax is not set
# TARGET_x86_64 is not set
# TARGET_xtensa is not set
#
# Target Architecture Features and Options
#
TARGET_ARCH="mips"
FORCE_OPTIONS_FOR_ARCH=y
CONFIG_MIPS_O32_ABI=y
# CONFIG_MIPS_N32_ABI is not set
# CONFIG_MIPS_N64_ABI is not set
# CONFIG_MIPS_ISA_1 is not set
# CONFIG_MIPS_ISA_2 is not set
# CONFIG_MIPS_ISA_3 is not set
# CONFIG_MIPS_ISA_4 is not set
CONFIG_MIPS_ISA_MIPS32=y
# CONFIG_MIPS_ISA_MIPS32R2 is not set
# CONFIG_MIPS_ISA_MIPS64 is not set
TARGET_SUBARCH=""
#
# Using ELF file format
#
ARCH_ANY_ENDIAN=y
ARCH_BIG_ENDIAN=y
ARCH_WANTS_BIG_ENDIAN=y
# ARCH_WANTS_LITTLE_ENDIAN is not set
ARCH_HAS_MMU=y
ARCH_USE_MMU=y
UCLIBC_HAS_FLOATS=y
# UCLIBC_HAS_FPU is not set
UCLIBC_HAS_SOFT_FLOAT=y
DO_C99_MATH=y
# DO_XSI_MATH is not set
# UCLIBC_HAS_FENV is not set
KERNEL_HEADERS="/home/ayaka/src/openwrt/chaos_calmer/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/linux-dev/include"
HAVE_DOT_CONFIG=y
#
# General Library Settings
#
DOPIC=y
HAVE_SHARED=y
# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
LDSO_LDD_SUPPORT=y
LDSO_CACHE_SUPPORT=y
LDSO_PRELOAD_ENV_SUPPORT=y
# LDSO_PRELOAD_FILE_SUPPORT is not set
LDSO_BASE_FILENAME="ld.so"
# LDSO_STANDALONE_SUPPORT is not set
# LDSO_PRELINK_SUPPORT is not set
# UCLIBC_STATIC_LDCONFIG is not set
LDSO_RUNPATH=y
# LDSO_SEARCH_INTERP_PATH is not set
LDSO_LD_LIBRARY_PATH=y
# LDSO_NO_CLEANUP is not set
UCLIBC_CTOR_DTOR=y
# LDSO_GNU_HASH_SUPPORT is not set
# HAS_NO_THREADS is not set
# LINUXTHREADS_OLD is not set
# LINUXTHREADS_NEW is not set
UCLIBC_HAS_THREADS_NATIVE=y
UCLIBC_HAS_THREADS=y
UCLIBC_HAS_TLS=y
PTHREADS_DEBUG_SUPPORT=y
UCLIBC_HAS_SYSLOG=y
UCLIBC_HAS_LFS=y
# MALLOC is not set
# MALLOC_SIMPLE is not set
MALLOC_STANDARD=y
MALLOC_GLIBC_COMPAT=y
UCLIBC_DYNAMIC_ATEXIT=y
# COMPAT_ATEXIT is not set
UCLIBC_SUSV3_LEGACY=y
UCLIBC_SUSV3_LEGACY_MACROS=y
UCLIBC_SUSV4_LEGACY=y
# UCLIBC_STRICT_HEADERS is not set
# UCLIBC_HAS_STUBS is not set
UCLIBC_HAS_SHADOW=y
UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
UCLIBC_HAS___PROGNAME=y
UCLIBC_HAS_PTY=y
ASSUME_DEVPTS=y
# UNIX98PTY_ONLY is not set
UCLIBC_HAS_GETPT=y
UCLIBC_HAS_LIBUTIL=y
UCLIBC_HAS_TM_EXTENSIONS=y
UCLIBC_HAS_TZ_CACHING=y
UCLIBC_HAS_TZ_FILE=y
UCLIBC_HAS_TZ_FILE_READ_MANY=y
UCLIBC_TZ_FILE_PATH="/etc/TZ"
# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set
#
# Advanced Library Settings
#
UCLIBC_PWD_BUFFER_SIZE=256
UCLIBC_GRP_BUFFER_SIZE=256
#
# Support various families of functions
#
UCLIBC_LINUX_MODULE_26=y
# UCLIBC_LINUX_MODULE_24 is not set
UCLIBC_LINUX_SPECIFIC=y
UCLIBC_HAS_GNU_ERROR=y
UCLIBC_BSD_SPECIFIC=y
UCLIBC_HAS_BSD_ERR=y
# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
# UCLIBC_NTP_LEGACY is not set
# UCLIBC_SV4_DEPRECATED is not set
UCLIBC_HAS_REALTIME=y
UCLIBC_HAS_ADVANCED_REALTIME=y
UCLIBC_HAS_EPOLL=y
# UCLIBC_HAS_XATTR is not set
# UCLIBC_HAS_PROFILING is not set
UCLIBC_HAS_CRYPT_IMPL=y
# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
UCLIBC_HAS_CRYPT=y
UCLIBC_HAS_NETWORK_SUPPORT=y
UCLIBC_HAS_SOCKET=y
UCLIBC_HAS_IPV4=y
UCLIBC_HAS_IPV6=y
# UCLIBC_HAS_RPC is not set
UCLIBC_USE_NETLINK=y
UCLIBC_SUPPORT_AI_ADDRCONFIG=y
UCLIBC_HAS_BSD_RES_CLOSE=y
UCLIBC_HAS_COMPAT_RES_STATE=y
# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
UCLIBC_HAS_RESOLVER_SUPPORT=y
UCLIBC_HAS_LIBRESOLV_STUB=y
UCLIBC_HAS_LIBNSL_STUB=y
#
# String and Stdio Support
#
UCLIBC_HAS_STRING_GENERIC_OPT=y
UCLIBC_HAS_STRING_ARCH_OPT=y
UCLIBC_HAS_CTYPE_TABLES=y
UCLIBC_HAS_CTYPE_SIGNED=y
# UCLIBC_HAS_CTYPE_UNSAFE is not set
UCLIBC_HAS_CTYPE_CHECKED=y
# UCLIBC_HAS_CTYPE_ENFORCED is not set
UCLIBC_HAS_WCHAR=y
# UCLIBC_HAS_LOCALE is not set
UCLIBC_HAS_HEXADECIMAL_FLOATS=y
UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
UCLIBC_HAS_STDIO_BUFSIZ_4096=y
# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
UCLIBC_HAS_STDIO_GETC_MACRO=y
UCLIBC_HAS_STDIO_PUTC_MACRO=y
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
UCLIBC_HAS_PRINTF_M_SPEC=y
UCLIBC_HAS_ERRNO_MESSAGES=y
# UCLIBC_HAS_SYS_ERRLIST is not set
UCLIBC_HAS_SIGNUM_MESSAGES=y
# UCLIBC_HAS_SYS_SIGLIST is not set
UCLIBC_HAS_GNU_GETOPT=y
UCLIBC_HAS_STDIO_FUTEXES=y
UCLIBC_HAS_GNU_GETSUBOPT=y
#
# Big and Tall
#
UCLIBC_HAS_REGEX=y
UCLIBC_HAS_REGEX_OLD=y
UCLIBC_HAS_FNMATCH=y
UCLIBC_HAS_FNMATCH_OLD=y
UCLIBC_HAS_WORDEXP=y
UCLIBC_HAS_NFTW=y
UCLIBC_HAS_FTW=y
UCLIBC_HAS_FTS=y
UCLIBC_HAS_GLOB=y
UCLIBC_HAS_GNU_GLOB=y
# UCLIBC_HAS_UTMPX is not set
#
# Library Installation Options
#
RUNTIME_PREFIX="/"
DEVEL_PREFIX="/usr/"
MULTILIB_DIR="lib"
# HARDWIRED_ABSPATH is not set
#
# Security options
#
# UCLIBC_BUILD_PIE is not set
# UCLIBC_HAS_ARC4RANDOM is not set
# UCLIBC_HAS_SSP is not set
UCLIBC_BUILD_RELRO=y
# UCLIBC_BUILD_NOW is not set
UCLIBC_BUILD_NOEXECSTACK=y
#
# Development/debugging options
#
CROSS_COMPILER_PREFIX=""
UCLIBC_EXTRA_CFLAGS=""
# DODEBUG is not set
DOSTRIP=y
# DOASSERTS is not set
# SUPPORT_LD_DEBUG is not set
# SUPPORT_LD_DEBUG_EARLY is not set
# UCLIBC_MALLOC_DEBUGGING is not set
# UCLIBC_HAS_BACKTRACE is not set
WARNINGS="-Wall"
# EXTRA_WARNINGS is not set
# DOMULTI is not set
# UCLIBC_MJN3_ONLY is not set
2
1
I have found a bug in .../libc/string/generic/memmove.c, which is the one that
MIPS uses, since there's no specialized, optimized version for MIPS.
We're currently using uClibc v. 1.0.12, but I suspect the bug to be present in
earlier releases too.
Here's a snippet from memmove.c#memmove():
---------------------oOo---------------------
/* This test makes the forward copying code be used whenever possible.
Reduces the working set. */
if (dstp - srcp >= len) /* *Unsigned* compare! */
{
#ifndef __ARCH_HAS_BWD_MEMCPY__
/* Backward memcpy implementation cannot be used */
memcpy(dest, src, len);
#else
/* Copy from the beginning to the end. */
---------------------oOo---------------------
Given the name of the define (__ARCH_HAS_BWD_MEMCPY__) it sounds as when this is
defined, the architecture indeed has backward memcpy() support. But how come the
line is preceded by #ifndef and not #ifdef, when the code inside calls memcpy()?
Also, the first comment inside the #ifndef seems odd, since memcpy() indeed is called:
/* Backward memcpy implementation cannot be used */
Our SDK does not define __ARCH_HAS_BWD_MEMCPY__, so when memmove()
resorts to a simple memcpy() that does the wrong thing for overlapping regions,
our application fails with disastrous side-effects.
I have attached a patch that fixes this.
Please CC me in case of any inquiries/replies: rene.nielsen (at) microsemi.com
Thanks & regards,
Rene Schipp von Branitz Nielsen
4
8
Hi Embedded Hackers,
I cut a new release.
Most important changes are the removal of LT.new. LT.old symbols
got renamed. Please update your uClibc-ng configs.
The microblaze support got some needed fixups and seems to be
usable now. (LDSO support fixed, Linuxthreads support fixed).
You need a GCC patch to make use of it.
http://cgit.openadk.org/cgi/cgit/openadk.git/tree/toolchain/gcc/patches/5.3…
Context functionality for sparc added in this release.
Alexey Brodkin (1):
ldso: Force disable -mlong-calls when compiling ldso for ARC
Baruch Siach (1):
sigaction: fix for THREADS_NATIVE
Cupertino Miranda (1):
ldso/ARC: fix DT_RELACOUNT handling
Leonid Lisovskiy (2):
linuxthreads: Fix warnings in pthread_tryjoin_np(),
pthread_timedjoin_np()
buildsys: Fix broken link.asneeded function
Waldemar Brodkorb (14):
dltest: fix a typo
sparc: add deprecated context switching functions
test: add memmove test
fixup stupid mixup of Makefile copyright and C code
nptl/tls tests need shared library support
libpthread: add missing file for gdbserver
remove linuxthreads.new, rename linuxthreads.old
microblaze: fix ELF detection in ld.so
microblaze: fix setjmp/longjmp
microblaze: fix linuxthreads support
sparc: remove unused 64 bit support code
Revert "disable always failing tst-signal7"
mips: allow to disable prefetch support in memcpy/memset
bump for release
Have fun,
Waldemar
1
0
uClibc-ng - small C library for embedded systems annotated tag v1.0.15 created. v1.0.15
by wbx@helium.openadk.org 29 May '16
by wbx@helium.openadk.org 29 May '16
29 May '16
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The annotated tag, v1.0.15 has been created
at 5a5dc1a00c63f86f5178c07a5db6bb3e2905863a (tag)
tagging 95174cb69c523a1544e5f6f20e47f7d60007e569 (commit)
replaces v1.0.14
tagged by Waldemar Brodkorb
on Sun May 29 09:19:37 2016 +0200
- Log -----------------------------------------------------------------
release 1.0.15 - Val-Dieu Brune
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iQIcBAABCAAGBQJXSpgKAAoJEMEz+QKmmH5imz8QAM+/sl7c82+VjddOQUJfxO45
LlEcPbFLp8AU658f/wXXInUseBsWMAdV/260p+JblciR+Gsm9zrE7s59k1IvbtxW
xZcsVaRXe4F+DMcyKRjk9uxH2kCaoYe9MUliqvMUirJEKQhKKUnPSlTt1r0Wt1pq
jMkbHzdZgR8BsvwHow+CIILrY/HBbDhkPEKh4JhvLNQqAUA+Y2SDhDLOk6pKXVN8
zXYuUliof/24HoyMprR//5w6ZggQy8mk+O2IZqk0tsd4B7G/TcutWFRBOf9Il/Zn
3B7R5vcmnXX80S+WLruHdtw7z8GizaaZd0lqy+quFx5vA4IiLDg9Vq6A6lWSCwan
mmgcyLjPfrW5GgjSrkVFhk4U6zZZ9O45OmCMpjHK7CxPZYeezvrKQpokuBl1gix9
mE0MtQfY9sz3LkuOy6kx/3YM16kWv/SKoM6wh4wHC4ae2GHXdwp3o3N/J+PamusL
PKjGQ2AjdFzzFo94y6d98AL2Y3fuCRYWuHQlNPg8gdoIrq3Q6Xj2kEO6e9/q9FS+
hBfI6hlJjdOzCLPx8AgP4cptd5esBbxlG/1FtA6OIOqYAbtuOTRaqknFxyyj4RQ9
RNeEfxD2J9u8xjL3tsN12NdLRvgJfhHE1F7Mu7v5ia/2ITYeJvFXKm2M1nsM0k3G
FqGqKCYEDBVkbi/SKCIo
=dxSt
-----END PGP SIGNATURE-----
Alexey Brodkin (1):
ldso: Force disable -mlong-calls when compiling ldso for ARC
Baruch Siach (1):
sigaction: fix for THREADS_NATIVE
Cupertino Miranda (1):
ldso/ARC: fix DT_RELACOUNT handling
Leonid Lisovskiy (2):
linuxthreads: Fix warnings in pthread_tryjoin_np(), pthread_timedjoin_np()
buildsys: Fix broken link.asneeded function
Waldemar Brodkorb (14):
dltest: fix a typo
sparc: add deprecated context switching functions
test: add memmove test
fixup stupid mixup of Makefile copyright and C code
nptl/tls tests need shared library support
libpthread: add missing file for gdbserver
remove linuxthreads.new, rename linuxthreads.old
microblaze: fix ELF detection in ld.so
microblaze: fix setjmp/longjmp
microblaze: fix linuxthreads support
sparc: remove unused 64 bit support code
Revert "disable always failing tst-signal7"
mips: allow to disable prefetch support in memcpy/memset
bump for release
-----------------------------------------------------------------------
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
1
0