From: "Anthony G. Basile" <blueness(a)gentoo.org>
On systems where uClibc doesn't provide an arch specific byteswap.h,
we fall back on bits/byteswap-common.h. However, there is a bug
in this header in the __bswap_constant_64(x) macro. If, for example,
a double is passed, we get 'invalid operands to binary &' in which we
mismatch a 'double' and 'long long unsigned int'. The newer glibc
headers fix this and so we import them. Also, since the inclusion of
byteswap.h is not appropriate for assembly code, we guard a portion
of endian.h which uses byteswap.h from inclusion in any assembly.
This is needed, for example, for f2fs-tools 1.6.0 on 32-bit big
endian PowerPC.
Signed-off-by: Anthony G. Basile <blueness(a)gentoo.org>
---
include/endian.h | 2 +-
libc/sysdeps/linux/common/bits/byteswap-16.h | 34 +++++++
libc/sysdeps/linux/common/bits/byteswap-common.h | 109 ++++++++++++-----------
3 files changed, 92 insertions(+), 53 deletions(-)
create mode 100644 libc/sysdeps/linux/common/bits/byteswap-16.h
diff --git a/include/endian.h b/include/endian.h
index 23a2654..eb2039e 100644
--- a/include/endian.h
+++ b/include/endian.h
@@ -66,7 +66,7 @@
# endif
#endif
-#ifdef __USE_BSD
+#if defined(__USE_BSD) && !defined(__ASSEMBLER__)
/* Conversion interfaces. */
# include <byteswap.h>
diff --git a/libc/sysdeps/linux/common/bits/byteswap-16.h b/libc/sysdeps/linux/common/bits/byteswap-16.h
new file mode 100644
index 0000000..8063aa8
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/byteswap-16.h
@@ -0,0 +1,34 @@
+/* Macros to swap the order of bytes in 16-bit integer values.
+ 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/>. */
+
+#ifndef _BITS_BYTESWAP_H
+# error "Never use <bits/byteswap-16.h> directly; include <byteswap.h> instead."
+#endif
+
+#ifdef __GNUC__
+# define __bswap_16(x) \
+ (__extension__ \
+ ({ unsigned short int __bsx = (unsigned short int) (x); \
+ __bswap_constant_16 (__bsx); }))
+#else
+static __inline unsigned short int
+__bswap_16 (unsigned short int __bsx)
+{
+ return __bswap_constant_16 (__bsx);
+}
+#endif
diff --git a/libc/sysdeps/linux/common/bits/byteswap-common.h b/libc/sysdeps/linux/common/bits/byteswap-common.h
index 4941d47..0effea6 100644
--- a/libc/sysdeps/linux/common/bits/byteswap-common.h
+++ b/libc/sysdeps/linux/common/bits/byteswap-common.h
@@ -1,5 +1,5 @@
/* Macros to swap the order of bytes in integer values.
- Copyright (C) 1997,1998,2000,2001,2002,2005 Free Software Foundation, Inc.
+ Copyright (C) 1997-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
@@ -16,54 +16,40 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
#endif
#ifndef _BITS_BYTESWAP_H
#define _BITS_BYTESWAP_H 1
+#include <features.h>
+#include <bits/types.h>
+
/* Swap bytes in 16 bit value. */
#define __bswap_constant_16(x) \
- ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
+ ((unsigned short int)((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8)))
-#ifndef __bswap_non_constant_16
-# define __bswap_non_constant_16(x) __bswap_constant_16(x)
-#endif
-#ifdef __GNUC__
-# define __bswap_16(x) \
- (__extension__ \
- ({ unsigned short int __bsv, __bsx = (x); \
- if (__builtin_constant_p (__bsx)) \
- __bsv = __bswap_constant_16 (__bsx); \
- else \
- __bsv = __bswap_non_constant_16 (__bsx); \
- __bsv; }))
-#else
-static __inline unsigned short int
-__bswap_16 (unsigned short int __bsx)
-{
- return __bswap_constant_16 (__bsx);
-}
-#endif
+/* Get __bswap_16. */
+#include <bits/byteswap-16.h>
/* Swap bytes in 32 bit value. */
#define __bswap_constant_32(x) \
((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \
(((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
-#ifndef __bswap_non_constant_32
-# define __bswap_non_constant_32(x) __bswap_constant_32(x)
-#endif
#ifdef __GNUC__
-# define __bswap_32(x) \
- (__extension__ \
- ({ unsigned int __bsv, __bsx = (x); \
- if (__builtin_constant_p (__bsx)) \
- __bsv = __bswap_constant_32 (__bsx); \
- else \
- __bsv = __bswap_non_constant_32 (__bsx); \
- __bsv; }))
+# if __GNUC_PREREQ (4, 3)
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+ return __builtin_bswap32 (__bsx);
+}
+# else
+# define __bswap_32(x) \
+ (__extension__ \
+ ({ unsigned int __bsx = (x); __bswap_constant_32 (__bsx); }))
+# endif
#else
static __inline unsigned int
__bswap_32 (unsigned int __bsx)
@@ -72,8 +58,40 @@ __bswap_32 (unsigned int __bsx)
}
#endif
-#if defined __GNUC__ && __GNUC__ >= 2
/* Swap bytes in 64 bit value. */
+#if __GNUC_PREREQ (2, 0)
+# define __bswap_constant_64(x) \
+ (__extension__ ((((x) & 0xff00000000000000ull) >> 56) \
+ | (((x) & 0x00ff000000000000ull) >> 40) \
+ | (((x) & 0x0000ff0000000000ull) >> 24) \
+ | (((x) & 0x000000ff00000000ull) >> 8) \
+ | (((x) & 0x00000000ff000000ull) << 8) \
+ | (((x) & 0x0000000000ff0000ull) << 24) \
+ | (((x) & 0x000000000000ff00ull) << 40) \
+ | (((x) & 0x00000000000000ffull) << 56)))
+
+# if __GNUC_PREREQ (4, 3)
+static __inline __uint64_t
+__bswap_64 (__uint64_t __bsx)
+{
+ return __builtin_bswap64 (__bsx);
+}
+# else
+# define __bswap_64(x) \
+ (__extension__ \
+ ({ union { __extension__ __uint64_t __ll; \
+ unsigned int __l[2]; } __w, __r; \
+ if (__builtin_constant_p (x)) \
+ __r.__ll = __bswap_constant_64 (x); \
+ else \
+ { \
+ __w.__ll = (x); \
+ __r.__l[0] = __bswap_32 (__w.__l[1]); \
+ __r.__l[1] = __bswap_32 (__w.__l[0]); \
+ } \
+ __r.__ll; }))
+# endif
+#else
# define __bswap_constant_64(x) \
((((x) & 0xff00000000000000ull) >> 56) \
| (((x) & 0x00ff000000000000ull) >> 40) \
@@ -84,24 +102,11 @@ __bswap_32 (unsigned int __bsx)
| (((x) & 0x000000000000ff00ull) << 40) \
| (((x) & 0x00000000000000ffull) << 56))
-# ifndef __bswap_non_constant_64
-# define __bswap_non_constant_64(x) \
- (__extension__ \
- ({ union { __extension__ unsigned long long int __ll; \
- unsigned int __l[2]; } __w, __r; \
- __w.__ll = (x); \
- __r.__l[0] = __bswap_non_constant_32 (__w.__l[1]); \
- __r.__l[1] = __bswap_non_constant_32 (__w.__l[0]); \
- __r.__ll; }))
-# endif
-# define __bswap_64(x) \
- (__extension__ \
- ({ __extension__ unsigned long long int __ll; \
- if (__builtin_constant_p (x)) \
- __ll = __bswap_constant_64 (x); \
- else \
- __ll = __bswap_non_constant_64 (x); \
- __ll; }))
+static __inline __uint64_t
+__bswap_64 (__uint64_t __bsx)
+{
+ return __bswap_constant_64 (__bsx);
+}
#endif
#endif /* _BITS_BYTESWAP_H */
--
2.7.3
Hi,
GDB 7.11 does not build if compiled against uclibc-ng (1.0.12 was used,
but the problematic code exists in 1.0.13 as well). The reason is that
GDB release includes its own obstack implementation, but elides the code
if <gnu-versions.h> declares a compatible obstack implementation in
libc. uclibc-ng does claim compatible obstack interface (GDB expects
version 2, but accepts version 1 if sizeof(int) == sizeof(size_t)),
however, uclibc-ng does not provide the _obstack_free symbol that is a
part of the interface (glibc does provide this symbol). This later
causes a link failure.
The attached patch makes uclibc-ng enables an alias _obstack_free ->
obstack_free.
Signed-off-by: Alexey Neyman <stilor(a)att.net>
Regards,
Alexey.
Hi,
GDB 7.11 does not build if compiled against uclibc-ng (1.0.12 was used,
but the problematic code exists in 1.0.13 as well). The reason is that
GDB release includes its own obstack implementation, but elides the code
if <gnu-versions.h> declares a compatible obstack implementation in
libc. uclibc-ng does claim compatible obstack interface (GDB expects
version 2, but accepts version 1 if sizeof(int) == sizeof(size_t)),
however, uclibc-ng does not provide the _obstack_free symbol that is a
part of the interface (glibc does provide this symbol). This later
causes a link failure.
The attached patch makes uclibc-ng enables an alias _obstack_free ->
obstack_free.
Signed-off-by: Alexey Neyman <stilor(a)att.net>
Regards,
Alexey.
Currently, the Thumb support on ARM has three related Config.in
options, which are not trivial for users to understand, and are in
fact not needed:
- The USE_BX option is not needed: knowing whether BX is available or
not is easy. If you have an ARM > v4 or ARMv4T, then BX is
available, otherwise it's not. This is the logic used in glibc.
- The USE_LDREXSTREX option is not needed: whenever Thumb2 is
available, ldrex/strex are available, so we can simply rely on
__thumb2__ to determine whether ldrex/strex should be used, without
requiring a Config.in option.
- Once USE_BX and USE_LDREXSTREX are removed, the only thing left
that COMPILE_IN_THUMB does is to set -mthumb. This makes the option
unnecessary, as on ARM at least, the user is already supposed to
pass -march=<foo> or other compiler options tuning the library for
a specific ARM variant. There is no reason to do otherwise for
Thumb, which allows to get rid of the COMPILE_IN_THUMB option.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni(a)free-electrons.com>
---
Rules.mak | 1 -
extra/Configs/Config.arm | 22 ----------------------
libc/sysdeps/linux/arm/bits/arm_bx.h | 10 ++++------
libc/sysdeps/linux/arm/clone.S | 2 +-
.../linuxthreads.old/sysdeps/arm/pt-machine.h | 7 +++----
5 files changed, 8 insertions(+), 34 deletions(-)
diff --git a/Rules.mak b/Rules.mak
index b1cecec..0ae3bb1 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -392,7 +392,6 @@ endif
ifeq ($(TARGET_ARCH),arm)
CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN)+=-mlittle-endian
CPU_CFLAGS-$(ARCH_BIG_ENDIAN)+=-mbig-endian
- CPU_CFLAGS-$(COMPILE_IN_THUMB_MODE)+=-mthumb
endif
ifeq ($(TARGET_ARCH),metag)
diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm
index 00cf982..0d02e3f 100644
--- a/extra/Configs/Config.arm
+++ b/extra/Configs/Config.arm
@@ -24,25 +24,3 @@ config CONFIG_ARM_EABI
If you say 'n' here, then the library will be built for the
old Linux ABI.
-
-config COMPILE_IN_THUMB_MODE
- bool "Build using Thumb mode"
- select USE_BX
- select USE_LDREXSTREX
- help
- Say 'y' here to force building uClibc in thumb mode.
- Say 'n' to use your compiler's default mode.
-
-config USE_BX
- bool "Use BX in function return"
- help
- Say 'y' to use BX to return from functions on your thumb-aware
- processor. Say 'y' if you need to use interworking. Say 'n' if not.
- It is safe to say 'y' even if you're not doing interworking.
-
-config USE_LDREXSTREX
- bool "Use load-store exclusive ASM ops (not supported in SmartFusion)"
- depends on COMPILE_IN_THUMB_MODE
- default n
- help
- Say 'y' to use LDREX/STREX ASM ops.
diff --git a/libc/sysdeps/linux/arm/bits/arm_bx.h b/libc/sysdeps/linux/arm/bits/arm_bx.h
index 2c29089..1c775b6 100644
--- a/libc/sysdeps/linux/arm/bits/arm_bx.h
+++ b/libc/sysdeps/linux/arm/bits/arm_bx.h
@@ -23,13 +23,11 @@
#error Please include features.h first
#endif /* features.h not yet included */
-#if defined(__USE_BX__)
-# if (__ARM_ARCH <= 4 && !defined __ARM_ARCH_4T__)
-# error Use of BX was requested, but is not available on the target processor.
-# endif /* ARCH level */
-#endif /* __USE_BX__ */
+#if __ARM_ARCH > 4 || defined (__ARM_ARCH_4T__)
+# define ARCH_HAS_BX
+#endif
-#if defined(__USE_BX__) && (__ARM_ARCH > 4 || (__ARM_ARCH == 4 && defined __ARM_ARCH_4T__))
+#if defined(ARCH_HAS_BX)
# define BX(reg) bx reg
# define BXC(cond, reg) bx##cond reg
#else
diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
index b4c7d8a..fd7590d 100644
--- a/libc/sysdeps/linux/arm/clone.S
+++ b/libc/sysdeps/linux/arm/clone.S
@@ -69,7 +69,7 @@ __clone:
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
-#if defined(__USE_BX__)
+#if defined(ARCH_HAS_BX)
ldr r1, [sp]
bl 2f @ blx r1
#else
diff --git a/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
index 2b877f9..fc17e9b 100644
--- a/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
+++ b/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
@@ -28,8 +28,7 @@
# define PT_EI __extern_always_inline
#endif
-#if defined(__thumb__)
-#if defined(__USE_LDREXSTREX__)
+#if defined(__thumb2__)
PT_EI long int ldrex(int *spinlock)
{
long int ret;
@@ -63,7 +62,7 @@ testandset (int *spinlock)
return ret;
}
-#else /* __USE_LDREXSTREX__ */
+#elif defined(__thumb__)
/* This will not work on ARM1 or ARM2 because SWP is lacking on those
machines. Unfortunately we have no way to detect this at compile
@@ -88,7 +87,7 @@ PT_EI long int testandset (int *spinlock)
: "0"(1), "r"(spinlock));
return ret;
}
-#endif
+
#else /* __thumb__ */
PT_EI long int testandset (int *spinlock);
--
2.6.4
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 feb9f08cfe8ddd1fd4fb62265e17ee35147ab268 (commit)
via 4ab024d22980cf493dc95a089353df6ebc743f46 (commit)
from adedda211de69fa0fa09af167aa327d4550f497e (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 feb9f08cfe8ddd1fd4fb62265e17ee35147ab268
Author: Thomas Petazzoni <thomas.petazzoni(a)free-electrons.com>
Date: Sun Mar 20 17:58:35 2016 +0100
arm: simplify handling of Thumb related options
Currently, the Thumb support on ARM has three related Config.in
options, which are not trivial for users to understand, and are in
fact not needed:
- The USE_BX option is not needed: knowing whether BX is available or
not is easy. If you have an ARM > v4 or ARMv4T, then BX is
available, otherwise it's not. This is the logic used in glibc.
- The USE_LDREXSTREX option is not needed: whenever Thumb2 is
available, ldrex/strex are available, so we can simply rely on
__thumb2__ to determine whether ldrex/strex should be used, without
requiring a Config.in option.
- Once USE_BX and USE_LDREXSTREX are removed, the only thing left
that COMPILE_IN_THUMB does is to set -mthumb. This makes the option
unnecessary, as on ARM at least, the user is already supposed to
pass -march=<foo> or other compiler options tuning the library for
a specific ARM variant. There is no reason to do otherwise for
Thumb, which allows to get rid of the COMPILE_IN_THUMB option.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni(a)free-electrons.com>
commit 4ab024d22980cf493dc95a089353df6ebc743f46
Author: Max Filippov <jcmvbkbc(a)gmail.com>
Date: Tue Mar 22 02:13:05 2016 +0300
xtensa: fix __sigsetjmp call12 case
Register window saving loop in __sigsetjmp incorrectly calculates offset
in the jmp_buf in case it was called with call12. The bug was introduced
in commit f4b1b7ade7971141 "xtensa: fix setjmp that didn't save all
registers correctly".
Signed-off-by: Max Filippov <jcmvbkbc(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 1 -
extra/Configs/Config.arm | 22 ----------------------
libc/sysdeps/linux/arm/bits/arm_bx.h | 10 ++++------
libc/sysdeps/linux/arm/clone.S | 2 +-
libc/sysdeps/linux/xtensa/setjmp.S | 2 +-
.../linuxthreads.old/sysdeps/arm/pt-machine.h | 7 +++----
6 files changed, 9 insertions(+), 35 deletions(-)
diff --git a/Rules.mak b/Rules.mak
index fc53ad1..dc1a02e 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -392,7 +392,6 @@ endif
ifeq ($(TARGET_ARCH),arm)
CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN)+=-mlittle-endian
CPU_CFLAGS-$(ARCH_BIG_ENDIAN)+=-mbig-endian
- CPU_CFLAGS-$(COMPILE_IN_THUMB_MODE)+=-mthumb
endif
ifeq ($(TARGET_ARCH),metag)
diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm
index 00cf982..0d02e3f 100644
--- a/extra/Configs/Config.arm
+++ b/extra/Configs/Config.arm
@@ -24,25 +24,3 @@ config CONFIG_ARM_EABI
If you say 'n' here, then the library will be built for the
old Linux ABI.
-
-config COMPILE_IN_THUMB_MODE
- bool "Build using Thumb mode"
- select USE_BX
- select USE_LDREXSTREX
- help
- Say 'y' here to force building uClibc in thumb mode.
- Say 'n' to use your compiler's default mode.
-
-config USE_BX
- bool "Use BX in function return"
- help
- Say 'y' to use BX to return from functions on your thumb-aware
- processor. Say 'y' if you need to use interworking. Say 'n' if not.
- It is safe to say 'y' even if you're not doing interworking.
-
-config USE_LDREXSTREX
- bool "Use load-store exclusive ASM ops (not supported in SmartFusion)"
- depends on COMPILE_IN_THUMB_MODE
- default n
- help
- Say 'y' to use LDREX/STREX ASM ops.
diff --git a/libc/sysdeps/linux/arm/bits/arm_bx.h b/libc/sysdeps/linux/arm/bits/arm_bx.h
index 2c29089..1c775b6 100644
--- a/libc/sysdeps/linux/arm/bits/arm_bx.h
+++ b/libc/sysdeps/linux/arm/bits/arm_bx.h
@@ -23,13 +23,11 @@
#error Please include features.h first
#endif /* features.h not yet included */
-#if defined(__USE_BX__)
-# if (__ARM_ARCH <= 4 && !defined __ARM_ARCH_4T__)
-# error Use of BX was requested, but is not available on the target processor.
-# endif /* ARCH level */
-#endif /* __USE_BX__ */
+#if __ARM_ARCH > 4 || defined (__ARM_ARCH_4T__)
+# define ARCH_HAS_BX
+#endif
-#if defined(__USE_BX__) && (__ARM_ARCH > 4 || (__ARM_ARCH == 4 && defined __ARM_ARCH_4T__))
+#if defined(ARCH_HAS_BX)
# define BX(reg) bx reg
# define BXC(cond, reg) bx##cond reg
#else
diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
index b4c7d8a..fd7590d 100644
--- a/libc/sysdeps/linux/arm/clone.S
+++ b/libc/sysdeps/linux/arm/clone.S
@@ -69,7 +69,7 @@ __clone:
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
-#if defined(__USE_BX__)
+#if defined(ARCH_HAS_BX)
ldr r1, [sp]
bl 2f @ blx r1
#else
diff --git a/libc/sysdeps/linux/xtensa/setjmp.S b/libc/sysdeps/linux/xtensa/setjmp.S
index 862bf67..b8152fd 100644
--- a/libc/sysdeps/linux/xtensa/setjmp.S
+++ b/libc/sysdeps/linux/xtensa/setjmp.S
@@ -122,7 +122,7 @@ ENTRY (__sigsetjmp)
l32i a4, a6, 12
s32i a7, a5, 8
s32i a4, a5, 12
- addi a5, a6, 16
+ addi a5, a5, 16
addi a6, a6, 16
blt a6, a8, .Lsjloop
.Lendsj:
diff --git a/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
index 2b877f9..fc17e9b 100644
--- a/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
+++ b/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
@@ -28,8 +28,7 @@
# define PT_EI __extern_always_inline
#endif
-#if defined(__thumb__)
-#if defined(__USE_LDREXSTREX__)
+#if defined(__thumb2__)
PT_EI long int ldrex(int *spinlock)
{
long int ret;
@@ -63,7 +62,7 @@ testandset (int *spinlock)
return ret;
}
-#else /* __USE_LDREXSTREX__ */
+#elif defined(__thumb__)
/* This will not work on ARM1 or ARM2 because SWP is lacking on those
machines. Unfortunately we have no way to detect this at compile
@@ -88,7 +87,7 @@ PT_EI long int testandset (int *spinlock)
: "0"(1), "r"(spinlock));
return ret;
}
-#endif
+
#else /* __thumb__ */
PT_EI long int testandset (int *spinlock);
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
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 adedda211de69fa0fa09af167aa327d4550f497e (commit)
from 50a5c1c36f39b3d0feffcbdf20d906508c545ffe (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 adedda211de69fa0fa09af167aa327d4550f497e
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sat Mar 26 23:33:28 2016 +0100
frv: enable in config
-----------------------------------------------------------------------
Summary of changes:
extra/Configs/Config.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 3afc291..8eac9e0 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -64,8 +64,8 @@ config TARGET_c6x
config TARGET_cris
bool "cris"
-#config TARGET_frv
-# bool "frv (BROKEN)"
+config TARGET_frv
+ bool "frv"
config TARGET_h8300
bool "h8300"
@@ -541,6 +541,7 @@ config UCLIBC_HAS_THREADS_NATIVE
!TARGET_bfin && \
!TARGET_c6x && \
!TARGET_cris && \
+ !TARGET_frv && \
!TARGET_h8300 && \
!TARGET_hppa && \
!TARGET_ia64 && \
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
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, uclibc has been deleted
was 9930f8b92bb47b2dbea7679d948e3ecfbce23ca9
- Log -----------------------------------------------------------------
9930f8b92bb47b2dbea7679d948e3ecfbce23ca9 getconf.c: undef VERSION
-----------------------------------------------------------------------
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
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, devel-old has been deleted
was 2799f2c1cb4ec270314c16608e8ba70f03c9aeea
- Log -----------------------------------------------------------------
2799f2c1cb4ec270314c16608e8ba70f03c9aeea frv: resurrect port somehow, totally untested
-----------------------------------------------------------------------
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
From: "Anthony G. Basile" <blueness(a)gentoo.org>
On systems where uClibc doesn't provide an arch specific byteswap.h,
we fall back on bits/byteswap-common.h. However, there is a bug
in this header in the __bswap_constant_64(x) macro. If, for example,
a double is passed, we get "invalid operands to binary &" in which we
mismatch a 'double' and 'long long unsigned int'. The newer glibc
headers fix this and so we import them.
This is needed, for example, for f2fs-tools 1.6.0 on 32-bit big
endian PowerPC.
Signed-off-by: Anthony G. Basile <blueness(a)gentoo.org>
---
libc/sysdeps/linux/common/bits/byteswap-16.h | 34 +++++++
libc/sysdeps/linux/common/bits/byteswap-common.h | 109 ++++++++++++-----------
2 files changed, 91 insertions(+), 52 deletions(-)
create mode 100644 libc/sysdeps/linux/common/bits/byteswap-16.h
diff --git a/libc/sysdeps/linux/common/bits/byteswap-16.h b/libc/sysdeps/linux/common/bits/byteswap-16.h
new file mode 100644
index 0000000..8063aa8
--- /dev/null
+++ b/libc/sysdeps/linux/common/bits/byteswap-16.h
@@ -0,0 +1,34 @@
+/* Macros to swap the order of bytes in 16-bit integer values.
+ 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/>. */
+
+#ifndef _BITS_BYTESWAP_H
+# error "Never use <bits/byteswap-16.h> directly; include <byteswap.h> instead."
+#endif
+
+#ifdef __GNUC__
+# define __bswap_16(x) \
+ (__extension__ \
+ ({ unsigned short int __bsx = (unsigned short int) (x); \
+ __bswap_constant_16 (__bsx); }))
+#else
+static __inline unsigned short int
+__bswap_16 (unsigned short int __bsx)
+{
+ return __bswap_constant_16 (__bsx);
+}
+#endif
diff --git a/libc/sysdeps/linux/common/bits/byteswap-common.h b/libc/sysdeps/linux/common/bits/byteswap-common.h
index 4941d47..0effea6 100644
--- a/libc/sysdeps/linux/common/bits/byteswap-common.h
+++ b/libc/sysdeps/linux/common/bits/byteswap-common.h
@@ -1,5 +1,5 @@
/* Macros to swap the order of bytes in integer values.
- Copyright (C) 1997,1998,2000,2001,2002,2005 Free Software Foundation, Inc.
+ Copyright (C) 1997-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
@@ -16,54 +16,40 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
#endif
#ifndef _BITS_BYTESWAP_H
#define _BITS_BYTESWAP_H 1
+#include <features.h>
+#include <bits/types.h>
+
/* Swap bytes in 16 bit value. */
#define __bswap_constant_16(x) \
- ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
+ ((unsigned short int)((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8)))
-#ifndef __bswap_non_constant_16
-# define __bswap_non_constant_16(x) __bswap_constant_16(x)
-#endif
-#ifdef __GNUC__
-# define __bswap_16(x) \
- (__extension__ \
- ({ unsigned short int __bsv, __bsx = (x); \
- if (__builtin_constant_p (__bsx)) \
- __bsv = __bswap_constant_16 (__bsx); \
- else \
- __bsv = __bswap_non_constant_16 (__bsx); \
- __bsv; }))
-#else
-static __inline unsigned short int
-__bswap_16 (unsigned short int __bsx)
-{
- return __bswap_constant_16 (__bsx);
-}
-#endif
+/* Get __bswap_16. */
+#include <bits/byteswap-16.h>
/* Swap bytes in 32 bit value. */
#define __bswap_constant_32(x) \
((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \
(((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
-#ifndef __bswap_non_constant_32
-# define __bswap_non_constant_32(x) __bswap_constant_32(x)
-#endif
#ifdef __GNUC__
-# define __bswap_32(x) \
- (__extension__ \
- ({ unsigned int __bsv, __bsx = (x); \
- if (__builtin_constant_p (__bsx)) \
- __bsv = __bswap_constant_32 (__bsx); \
- else \
- __bsv = __bswap_non_constant_32 (__bsx); \
- __bsv; }))
+# if __GNUC_PREREQ (4, 3)
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+ return __builtin_bswap32 (__bsx);
+}
+# else
+# define __bswap_32(x) \
+ (__extension__ \
+ ({ unsigned int __bsx = (x); __bswap_constant_32 (__bsx); }))
+# endif
#else
static __inline unsigned int
__bswap_32 (unsigned int __bsx)
@@ -72,8 +58,40 @@ __bswap_32 (unsigned int __bsx)
}
#endif
-#if defined __GNUC__ && __GNUC__ >= 2
/* Swap bytes in 64 bit value. */
+#if __GNUC_PREREQ (2, 0)
+# define __bswap_constant_64(x) \
+ (__extension__ ((((x) & 0xff00000000000000ull) >> 56) \
+ | (((x) & 0x00ff000000000000ull) >> 40) \
+ | (((x) & 0x0000ff0000000000ull) >> 24) \
+ | (((x) & 0x000000ff00000000ull) >> 8) \
+ | (((x) & 0x00000000ff000000ull) << 8) \
+ | (((x) & 0x0000000000ff0000ull) << 24) \
+ | (((x) & 0x000000000000ff00ull) << 40) \
+ | (((x) & 0x00000000000000ffull) << 56)))
+
+# if __GNUC_PREREQ (4, 3)
+static __inline __uint64_t
+__bswap_64 (__uint64_t __bsx)
+{
+ return __builtin_bswap64 (__bsx);
+}
+# else
+# define __bswap_64(x) \
+ (__extension__ \
+ ({ union { __extension__ __uint64_t __ll; \
+ unsigned int __l[2]; } __w, __r; \
+ if (__builtin_constant_p (x)) \
+ __r.__ll = __bswap_constant_64 (x); \
+ else \
+ { \
+ __w.__ll = (x); \
+ __r.__l[0] = __bswap_32 (__w.__l[1]); \
+ __r.__l[1] = __bswap_32 (__w.__l[0]); \
+ } \
+ __r.__ll; }))
+# endif
+#else
# define __bswap_constant_64(x) \
((((x) & 0xff00000000000000ull) >> 56) \
| (((x) & 0x00ff000000000000ull) >> 40) \
@@ -84,24 +102,11 @@ __bswap_32 (unsigned int __bsx)
| (((x) & 0x000000000000ff00ull) << 40) \
| (((x) & 0x00000000000000ffull) << 56))
-# ifndef __bswap_non_constant_64
-# define __bswap_non_constant_64(x) \
- (__extension__ \
- ({ union { __extension__ unsigned long long int __ll; \
- unsigned int __l[2]; } __w, __r; \
- __w.__ll = (x); \
- __r.__l[0] = __bswap_non_constant_32 (__w.__l[1]); \
- __r.__l[1] = __bswap_non_constant_32 (__w.__l[0]); \
- __r.__ll; }))
-# endif
-# define __bswap_64(x) \
- (__extension__ \
- ({ __extension__ unsigned long long int __ll; \
- if (__builtin_constant_p (x)) \
- __ll = __bswap_constant_64 (x); \
- else \
- __ll = __bswap_non_constant_64 (x); \
- __ll; }))
+static __inline __uint64_t
+__bswap_64 (__uint64_t __bsx)
+{
+ return __bswap_constant_64 (__bsx);
+}
#endif
#endif /* _BITS_BYTESWAP_H */
--
2.5.4