Commit Graph

2390 Commits

Author SHA1 Message Date
Sebastian Huber 8a5af1a184 Use __machine_*_t_defined for internal types
Newlib defines defaults for internal types via <sys/_types.h> and uses
<machine/_types.h> to let targets define their own type if necessary.

Previously for example

	#ifndef __dev_t_defined
	typedef short __dev_t;
	#endif

However, the __*_t_defined pattern conflicts with the glibc type guard
pattern for user types, e.g. dev_t in this example.  Introduce a
__machine_*_t_defined pattern for internal types (defined by
<machine/_types.h>, used by <sys/_types.h>).  For example

	#ifndef __machine_dev_t_defined
	typedef short __dev_t;
	#endif

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15 14:51:39 +02:00
Yaakov Selkowitz 9f90ae0435 Feature test macros overhaul: string.h and strings.h overlaps
strings.h is the header mandated for these functions in POSIX.1 prior to
2008 (when most of these were removed).  The declarations in string.h are
only for BSD compatibility.  But when both headers are included, avoid
duplicate declarations.

Also, mark stpcpy and stpncpy as POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-13 23:50:11 -05:00
Corinna Vinschen 7b39124400 Get rid of some special cases for Cygwin in sys/types.h
Remove off_t typedef from cygwin/types.h thus relying on sys/types.h.
Introduce winsup/cygwin/machine/_types.h and move some types shared
with newlib into it.  Get rid of their definition in cygwin/types.h.
Add same handling for __key_t/key_t as for the other types.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-04-13 21:00:17 +02:00
Sebastian Huber de51829c17 Add BSD guards for off_t, dev_t, uid_t, and gid_t
Copy definitions of off_t, dev_t, uid_t, and gid_t verbatim from latest
FreeBSD <sys/types.h>.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-13 13:54:39 +02:00
Sebastian Huber 477463a201 Eliminate use of Newlib-specific <machine/types.h>
This change solves a glibc/BSD compatibility problem.

glibc and BSD use double underscore types for internal types.  The Linux
port of Newlib uses some glibc provided internal type definitions which
are not protected by guard defines, e.g. __off_t.  To avoid a conflict
Newlib uses single underscore types for some internal types, e.g.
_off_t.  However, for BSD compatibility we have to define the internal
types with double underscore names in <sys/_types.h>.

The header file <machine/types.h> is Newlib-specific.  It was used
instead of <sys/_types.h> to provide the internal type definitions
_CLOCK_T, _TIME_T_, _CLOCKID_T_, _TIMER_T_, and __suseconds_t.  Move
these definitions to <sys/_types.h> (there exist two instances of this
file, one for Linux and one for all other targets).  This makes the
_HAVE_SYSTYPES configuration define obsolete (could possibly break the
__RDOS__ target).  Use the standard <sys/_types.h> include throughout.

Move __loff_t defintion to default (non-Linux) <sys/_types.h>.  Define
it via _off64_t to avoid a dependency on the compiler.

Provide the __off_t definition via default (non-Linux) <sys/_types.h>
based on _off_t for all systems except Cygwin.  For Cygwin use _off64_t.
Define off_t via __off_t.

Provide the __pid_t definition via default (non-Linux) <sys/_types.h>.
This prevents a potential __pid_t and pid_t incompatibility.  Add BSD
guard defines for pid_t.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-13 13:30:27 +02:00
Sebastian Huber 3156cdcc80 Move kernel dependent parts of <sys/time.h>
Move the kernel dependent parts of <sys/time.h> to new system-specific
header file <machine/_time.h>.  Provide an empty default implementation.
Add a specialized implementation for RTEMS.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-08 11:34:42 +02:00
Yaakov Selkowitz 3fc46dc562 math: fix isinf/isnan on SPU after move to math.h
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-07 10:18:22 -05:00
Sebastian Huber 9672033c63 Drop <unistd.h> include from RTEMS <sys/param.h>
This include is not present in default Newlib, glibc and FreeBSD
<sys/param.h>.  With it there is now a conflict with <sys/libkern.h>
introduced by ecf453f963.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-07 17:13:47 +02:00
Yaakov Selkowitz cd84d1c2d0 math: update isinf/isnan function comments after move to math.h
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-05 08:49:44 -05:00
Yaakov Selkowitz 722e363c4d math: guard BSD finite/isinf/isnan functions properly in math.h
Now that we have properly functioning feature test macros, the BSD
floating-point classification functions can go into math.h instead of
the non-standard ieeefp.h, and not under the C99 guard:

http://man7.org/linux/man-pages/man3/finite.3.html

The isnan function was in earlier versions of SUS but removed starting with
POSIX.1-2001, compare:

http://pubs.opengroup.org/onlinepubs/007908799/xsh/math.h.html
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/math.h.html

Note that the isinf and isnan functions (but not the variants) conflict
with functions by the same name in C++11, hence they (and only they)
need to be hidden:

https://sourceware.org/git/?p=glibc.git;a=commit;h=d9b965fa56350d6eea9f7f438a0714c7ffbb183f
https://sourceware.org/git/?p=glibc.git;a=commit;h=3c47c83a9730c20e602694505b9278c25637b0d0

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-04 14:13:21 -05:00
Yaakov Selkowitz 9e277154ab Feature test macros overhaul: tar.h
TSVTX was marked XSI beginning with SUSv3, compare:

http://pubs.opengroup.org/onlinepubs/007908799/xsh/tar.h.html
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/tar.h.html
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/tar.h.html

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-04 10:25:29 -05:00
Yaakov Selkowitz 3f00f4f9fc Add cpio.h
This header dates back to XPG3:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/cpio.h.html

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-04 10:25:27 -05:00
Yaakov Selkowitz d55d03a87d cygwin: make POSIX/XSI version macros dependent on feature test macros
Each version of SUS specifies a different value for _POSIX_VERSION,
_POSIX2_VERSION, and _XOPEN_VERSION.  glibc also changes the value
of the other _POSIX2_ variables but not the _POSIX_* variables.

_POSIX_TIMERS should be set to a version number, not just 1.

The _POSIX_V7_* macros were missing, which was not noticed because
the V6 values were aliased in sysconf (<unistd.h>).

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-04 10:25:25 -05:00
Igor Venevtsev 5d3ad3b123 Add Intel MCU target
Intel MCU System V ABI are incompartible with i386 System V ABI:
    o Minimum instruction set is Intel Pentium ISA minus x87 instructions
    o No x87 or vector registers
    o First three args are passed in %eax, %edx and %ecx
    o Full specification available here:
      https://github.com/hjl-tools/x86-psABI/wiki/iamcu-psABI-0.7.pdf

newlib/
    * configure.host: Add new ix86-*-elfiamcu target

newlib/libc/include/
    * setjmp.h: Change _JBLEN for Intel MCU target

newlib/libc/machine/i386/
    * memchr.S:  (memchr)  Target-specific size-optimized version
    * memcmp.S:  (memcmp)  Likewise
    * memcpy.S:  (memcpy)  Likewise
    * memmove.S: (memmove) Likewise
    * memset.S:  (memset)  Likewise
    * setjmp.S:  (setjmp)  Likewise
    * strchr.S:  (strchr)  Likewise
    * strlen.S:  (strlen)  Likewise

newlib/libc/stdlib/
    * srtold.c:  (__flt_rounds) Disable for Intel MCU
2016-04-04 16:32:07 +02:00
Jeff Johnston fbc4a0827b Bump up newlib version to 2.4.0 due to feature test refactoring 2016-03-29 17:33:42 -04:00
Corinna Vinschen 792e51b721 Add missing long double functions to Cygwin
This patch adds the long double functions missing in newlib to Cygwin.
Apart from some self-written additions (exp10l, finite{f,l}, isinf{f,l},
isnan{f,l}, pow10l) the files are taken from the Mingw-w64 math lib.
Minor changes were required, e.g. substitue _WIN64 with __x86_64__ and
fixing __FLT_RPT_DOMAIN/__FLT_RPT_ERANGE for Cygwin.

Cygwin:
	* math: New subdir with math functions.
	* Makefile.in (VPATH): Add math subdir.
	(MATH_OFILES): List of object files collected from building files in
	math subdir.
	(DLL_OFILES): Add $(MATH_OFILES).
	${CURDIR}/libm.a: Add $(MATH_OFILES) to build.
	* common.din: Add new functions from math subdir.
	* i686.din: Align to new math subdir.  Remove functions now commonly
	available.
	* x86_64.din: Ditto.
	* math.h: math.h wrapper to define mingw structs used in some files in
	math subdir.
	* include/cygwin/version.h: Bump API minor version.

newlib:
	* libc/include/complex.h: Add prototypes for complex long double
	functions.  Only define for Cygwin.
	* libc/include/math.h: Additionally enable prototypes of long double
	functions for Cygwin.  Add Cygwin-only prototypes for dreml, sincosl,
	exp10l and pow10l.  Explain why we don't add them to newlib.
	* libc/include/tgmath.h: Enable long double handling on Cygwin.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-29 14:43:55 +02:00
Joel Sherrill ecf453f963 Add simple versions of random() and srandom()
Prototypes also added for initstate() and setstate() but they
were not implemented in the shared newlib code.

	* newlib/libc/include/cygwin/stdlib.h: Prototypes added.
	* winsup/cygwin/include/cygwin/stdlib.h: Prototypes removed.
	* newlib/libc/stdlib/random.c: New file.
	* newlib/libc/machine/epiphany/machine/stdlib.h: Removed
	* newlib/libc/stdlib/Makefile.am: Added random.c.
	* newlib/libc/stdlib/stdlib.tex: Added random.def.
	* newlib/libc/stdlib/Makefile.in: Regenerated.
2016-03-28 22:39:50 -05:00
Corinna Vinschen 799fdda4d2 math.h: Use GCC builtins for C99 macros where available
GCCs builtin functions are mostly type agnostic and architecture
indepedent.  Prefer to use them if available.

	* libc/include/math.h (fpclassify, isfinite, isinf, isnan,
	isnormal): Use matching GCC builtin functions if built with
	GCC 4.4 or later.
	(signbit): Use matching GCC builtin functions if built with
	GCC 4.0 or later.
	(isgreater, isgreaterequal, isless, islessequal, islessgreater,
	isunordered): Use matching GCC builtin functions if built with
	GCC 2.97 or later.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-26 20:33:46 +01:00
Corinna Vinschen 373f81d17c finitel: Use correct GCC builtin
__builtin_isinf_sign doesn't reflect the correct return value for NaN
to emulate finite function.  Use __builtin_isfinite instead whichg is available
since GCC 4.4 just as __builtin_isinf_sign.

	* libm/common/sl_finite.c (finitel): Use __builtin_isfinite.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-26 20:29:20 +01:00
Corinna Vinschen 3e446e9723 strtold: Fix Infinity value.
Infinity returned from strtold is recognized as NaN by GCC builtin
functions.  The reason is that ULtox is missing to set a bit.

	* libc/stdlib/strtorx.c (ULtox): Set high bit in second word
	to create valid Infinity value.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-26 20:27:18 +01:00
Corinna Vinschen b1b46d4580 Drop usage of old-age BSD types in generically used Cygwin headers
u_char, u_short, u_int, u_long are BSD-only types.  Remove them from
Cygwin headers which are supposed to be used in a non-BSD scenario.
Drop special Cygwin handling of those types in sys/types.h.

newlib:
	* libc/include/sys/types.h (u_char,u_short,u_int,u_long): Drop
	Cygwin exception.

cygwin:
	* fhandler_socket.cc (fhandler_socket::ioctl): Accommodate change
	in include/asm/socket.h.  Continue using u_long since that's the
	MS type here.
	* include/asm/socket.h: Since the type given in _IOR/_IOW macros
	is only used for its sizeof, replace u_long with equivalent long.
	* netdb.h (getnetbyaddr): Fix prototype.
	* netinet/ip.h: Replace old BSD-only types with generically defined
	old BSD types (u_char -> u_int8_t, etc).
	* netinet/tcp.h: Ditto.
	* netinet/udp.h: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-24 15:55:25 +01:00
Corinna Vinschen db5bfdbd8a Define BSD u_intN_t types indiscriminately
The u_intN_t types are BSD types but sanctioned by POSIX.  They are
always defined when using Glibc headers so we follow suit.

newlib:
	* libc/include/sys/types.h: Drop outdated __INTTYPES_DEFINED__
	macro.  Always define u_intN_t types.

cygwin:
	* include/cygwin/types.h: Remove definition of u_intN_t types.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-24 15:51:14 +01:00
Corinna Vinschen 08fdddea3d Fix coverity CID 143502: Null pointer dereference
* libc/locale/ldpart.c (split_lines): Don't dereference result
	of strchr without checking for NULL pointer first.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-24 10:06:50 +01:00
Yaakov Selkowitz b9bbe1bccb Feature test macros overhaul: C++ TR1
While C++11 was the first version of the standard to use C99 functionality,
TR1 (for C++03) also does, and G++ does not distinguish between C++98 and
C++03, or when TR1 is in use.  Therefore, while not strictly correct for
"pure" C++98, enabling C99 for all C++ usage is the simplest solution (and
much better than always using -D_GNU_SOURCE as on Linux).

See thread starting: https://sourceware.org/ml/newlib/2016/msg00297.html

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-23 16:14:00 -05:00
Corinna Vinschen 3737bc4e98 Drop Cygwin-only posix_memalign prototype
newlib:
	* libc/include/stdlib.h (posix_memalign): Drop __rtmes__ guards.

cygwin:
	* include/cygwin/stdlib.h (posix_memalign): Drop prototype.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-23 11:50:27 +01:00
Konrad Schwarz 5ec2d62bea Target/Host configuration elucidated 2016-03-23 11:18:50 +01:00
Corinna Vinschen 3f258ada43 Guard u_char,u_short,u_int,u_long with __MISC_VISIBLE
These types are available in SVID as well.

	* libc/include/sys/types.h (u_char,u_short,u_int,u_long): Replace
	__BSD_VISIBLE with __MISC_VISIBLE.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-23 11:17:59 +01:00
Sebastian Huber 98b615106d Fix "/*" within comment warning
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-03-22 22:39:22 +01:00
Yaakov Selkowitz 1e6205b1ae stdio: fseeko/ftello are also POSIX.1-2001
_LARGEFILE_SOURCE, which controls only these two functions, is implicitly
defined by _XOPEN_SOURCE >= 500.  However, they are also later added to
POSIX.1-2001 (and therefore available by default).

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-22 10:50:31 -05:00
Joel Sherrill 1f9599f3a7 pthread.h: Mark pthread_exit() as not returning 2016-03-22 09:48:26 -05:00
Joel Sherrill 13707ae933 epiphany/machine/stdlib.h: Disable epiphany unique random wrappers for RTEMS 2016-03-22 09:47:00 -05:00
Joel Sherrill 4db48d17eb newlib/configure.host: Turn off sti/cli for i386 setjmp for i386-rtems*
When running RTEMS paravirtualized in user space, the cli/sti instructions
can't be used. But I can't see why they are needed in either user or
supervisor state. Turning the use of them off for RTEMS.

This code is unmodified since the beginning of the repository, so I have
no insight into why it was done. I may even have been the one to add them.
Absolutely no idea except they aren't necessary.
2016-03-22 09:45:08 -05:00
Peter Foley 3ba2c39fb2 Add nonnull annotation to posix_memalign.
GCC 6.0+ asserts that the memptr argument to the builtin function
posix_memalign is nonnull.
Add the necessary annotation to the prototype and
remove the now unnecessary check to fix a warning.

newlib/Changelog
newlib/libc/include/stdlib.h: Annotate arg to posix_memalign as
non-null.

winsup/cygwin/ChangeLog
malloc_wrapper.cc (posix_memalign): Remove always true nonnull check.

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
2016-03-21 20:27:16 +01:00
Sebastian Huber 08537d88f6 Move arc4random Cygwin only code to Cygwin
Keep the Newlib arc4random.c identical to the OpenBSD upstream version.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>.
2016-03-21 11:12:19 +01:00
Corinna Vinschen f7f26f65ab Allow machine-dependent arc4 locking
newlib:
	* libc/stdlib/arc4random.h: Remove Cygwin-specific locking code.
	Conditionalize arc4 locking.  Check for _ARC4_LOCK_INIT being
	undefined to fall back to default implementation.

cygwin:
	* include/machine/_arc4random.h: New file.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-20 21:30:08 +01:00
Jeff Johnston d17977ccc7 Regenerate configure script. 2016-03-19 00:27:59 -04:00
Yaakov Selkowitz 97d1536d17 sparc64: move struct timeval to <sys/_timeval.h>
commit bb01594897 moved the struct timeval
declaration from <sys/time.h> to <sys/_timeval.h>, and commit
01885f533d changed <sys/select.h> to include
<sys/_timeval.h>.  Therefore, sparc64's own struct timeval needs to be
moved accordingly in order to avoid a conflict from the generic type.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Acked-by: Corinna Vinschen <vinschen@redhat.com>
2016-03-18 15:29:13 -05:00
Yaakov Selkowitz f049607eb0 Feature test macros overhaul: sparc64
sparc64 has a number of its own headers which override the generic ones.
These too need to use feature test macros properly.

These changes correspond to the generic fcntl.h and sys/stat.h changes
in commit d2df6d381b and
commit 069e400c91.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Acked-by: Corinna Vinschen <vinschen@redhat.com>
2016-03-18 15:29:05 -05:00
Howland, Craig D 19879c03c5 Cleanup macros in chacha_private.h to be target-type independent
* libc/stdlib/chacha_private.h (U8C, U32C): Remove un-necessary macros.
	(U8V, U32V): Drop masking.
2016-03-18 21:20:06 +01:00
Corinna Vinschen 8e2b2adb3d Only export arc4random_stir and arc4random_addrandom on Cygwin
Export to maintain backward compatibility, but don't let
	them do anything useful.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-18 21:12:12 +01:00
Yaakov Selkowitz d3f203d091 Feature test macros overhaul: signal.h (part 2)
Move the sig*set macros following the functions inside their feature
test macro conditional.

This fixes the build on bare-metal targets following
commit 5c78499ae2.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Acked-by: Corinna Vinschen <vinschen@redhat.com>
2016-03-18 11:22:32 -05:00
Yaakov Selkowitz f3ec63771b arm: fix build with newlib supplied syscalls enabled
In file included from libc/sys/arm/crt0.S:2:0:
libc/sys/arm/arm.h:32:25: fatal error: acle-compat.h: No such file or directory

acle-compat.h is libc/machine/arm.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18 11:22:32 -05:00
Corinna Vinschen 7c96d6059c Arc4random locking: Check for threaded application on Cygwin
libc/stdlib/arc4random.h (_ARC4_LOCK): Special case Cygwin.
        (_ARC4_UNLOCK): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-18 14:40:26 +01:00
Corinna Vinschen 5ccdcf0219 Add arc4random_stir and arc4random_addrandom for OpenBSD compatibility
* libc/stdlib/arc4random.c (arc4random_stir): New function.
        (arc4random_addrandom): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-18 14:39:58 +01:00
Sebastian Huber f74cf1350e Add arc4random() etc. from OpenBSD 5.8
According to the OpenBSD man page, "A Replacement Call for Random".  It
offers high quality random numbers derived from input data obtained by
the OpenBSD specific getentropy() system call which is declared in
<unistd.h> and must be implemented for each Newlib port externally.  The
arc4random() functions are used for example in LibreSSL and OpenSSH.

Cygwin provides currently its own implementation of the arc4random
family.  Maybe it makes sense to use this getentropy() implementation:

http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libcrypto/crypto/getentropy_win.c?rev=1.4&content-type=text/x-cvsweb-markup

	* libc/include/stdlib.h (arc4random): Declare if __BSD_VISIBLE.
	(arc4random_buf): Likewise.
	(arc4random_uniform): Likewise.
	* libc/include/sys/unistd.h (getentropy): Likewise.
	* libc/include/machine/_arc4random.h: New file.
	* libc/stdlib/arc4random.c: Likewise.
	* libc/stdlib/arc4random.h: Likewise.
	* libc/stdlib/arc4random_uniform.c: Likewise.
	* libc/stdlib/chacha_private.h: Likewise.
	* libc/sys/rtems/include/machine/_arc4random.h: Likewise.
	* libc/stdlib/Makefile.am (EXTENDED_SOURCES): Add arc4random.c
	and arc4random_uniform.c.
	* libc/stdlib/Makefile.in: Regenerate.
2016-03-18 12:33:41 +01:00
Sebastian Huber 55c239d834 Add timingsafe_memcmp()
This function is used by LibreSSL and OpenSSH and is provided by the
OpenBSD libc.

	* libc/include/string.h (timingsafe_memcmp): Declare.
	* libc/string/timingsafe_memcmp.c: New file.
	* libc/string/Makefile.am: Add new file.
	* libc/string/Makefile.in: Regenerate.
2016-03-18 12:33:40 +01:00
Sebastian Huber 559fd77dda Add timingsafe_bcmp()
This function is used by LibreSSL and OpenSSH and is provided by the
OpenBSD libc.

	* libc/include/string.h (timingsafe_bcmp): Declare.
	* libc/string/timingsafe_bcmp.c: New file.
	* libc/string/Makefile.am: Add new file.
	* libc/string/Makefile.in: Regenerate.
2016-03-18 12:33:40 +01:00
Sebastian Huber 8740fa7fd0 Add explicit_bzero()
This function is used by LibreSSL and OpenSSH and is provided by the
OpenBSD libc.

	* libc/include/string.h (explicit_bzero): Declare.
	* libc/string/explicit_bzero.c: New file.
	* libc/string/Makefile.am: Add new file.
	* libc/string/Makefile.in: Regenerate.
2016-03-18 12:33:40 +01:00
Sebastian Huber a10dacbdac Guard ssize_t definition by _SSIZE_T_DECLARED
This guard is used by FreeBSD <sys/socket.h> for example.  The FreeBSD
network stack is used in RTEMS.

	* newlib/libc/include/sys/types.h (ssize_t): Guard by
	_SSIZE_T_DECLARED.
2016-03-18 12:28:55 +01:00
Yaakov Selkowitz 396942b0b5 Feature test macros overhaul: sys/types.h
The u_int/u_char/etc. BSD types are needed by Cygwin's netinet/*.h
headers, so they always need to be available.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:21 -05:00
Yaakov Selkowitz ee97c4b224 Revert "Remove inclusion of sys/select.h in sys/types.h for backward compat"
This BSDism is still in use (e.g. putty).

This reverts commit 088f7a7239.
2016-03-17 21:09:19 -05:00
Yaakov Selkowitz 04f288851a Feature test macros overhaul: sys/time.h
The inclusion of <sys/select.h> is required also by POSIX.1-2001.
setitimer is XSI, and futimesat is GNU.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:18 -05:00
Yaakov Selkowitz 069e400c91 Feature test macros overhaul: sys/stat.h
Replace all !_POSIX_SOURCE with BSD.  All *at functions depend on
ATFILE; futimens is POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:16 -05:00
Yaakov Selkowitz 03c4ef1c51 Feature test macros overhaul: sys/select.h
Remove !_POSIX_SOURCE conditional; pselect is POSIX.1-2001.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:15 -05:00
Yaakov Selkowitz 73e2f46419 Feature test macros overhaul: wchar.h
open_wmemstream is POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:13 -05:00
Yaakov Selkowitz be657151f1 Feature test macros overhaul: unistd.h
Throughout, use proper internal macros for functions, including those
marked as target-specific.  Use ATFILE for all *at functions.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:12 -05:00
Yaakov Selkowitz 43e5ee83fe Feature test macros overhaul: time.h
Throughout, replace __STRICT_ANSI__ with the proper internal macros.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:10 -05:00
Yaakov Selkowitz 6fe6a822ee Feature test macros overhaul: strings.h
Replace __STRICT_ANSI__ with the proper internal macros for bcmp etc.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:09 -05:00
Yaakov Selkowitz 615d63599b Feature test macros overhaul: string.h
Throughout, remove __STRICT_ANSI__ and use the proper internal macros.

bcmp, bcopy, bzero, index, and rindex were in POSIX prior to 2008.

memrchr is GNU.

strdup and strndup are POSIX.1-2008.

The int-returning form of strerror_r is POSIX.1-2001.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:07 -05:00
Yaakov Selkowitz 84ba25226c Feature test macros overhaul: stdlib.h
Throughout, simplify the C99/C11 conditionals, and replace
__STRICT_ANSI__ with the proper internal POSIX macros.  The _*_r
reentrant functions need not be guarded (and most haven't been) because
such names in the global scope are reserved to the implementation.

atoff is unique to newlib.

dtoa is not actually exported (_dtoa_r is used internally), is
nonstandard, and the declaration conflicts with the code included in
MySQL, NSPR, and SpiderMonkey.

mktemp was removed in POSIX.1-2001.

The qsort_r declarations are reordered so that the GNU version retains
precedence.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:06 -05:00
Yaakov Selkowitz feec81e571 Feature test macros overhaul: stdio.h
Throughout, remove references to __STRICT_ANSI__ and use the proper
internal macros and versions for C99, POSIX, ATFILE for the various *at
functions, or LARGEFILE for fseeko and ftello.

[v]asprintf are GNU extensions, but the *iprintf, *iscanf, and
*asnprintf functions are unique to newlib.

getw and putw were removed from POSIX.1-2001. funopen is BSD, and
fopencookie is GNU.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:04 -05:00
Yaakov Selkowitz 5c78499ae2 Feature test macros overhaul: signal.h
Use proper internal macros for BSD sig_t and GNU sighandler_t.

sigaltstack and friends are XSI even in SUSv4 but in glibc are
nonetheless handled as POSIX.1-2008 (not 2001).

The requirement for the ucontext_t typedef in signal.h was XSI prior to
POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:03 -05:00
Yaakov Selkowitz 25507f80a2 Feature test macros overhaul: pwd.h
getpw*_r dates back to POSIX.1c, and *pwent to XPG4v2.  Both are also BSD.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:01 -05:00
Yaakov Selkowitz 96972e7198 Feature test macros overhaul: pthread.h
Use internal macros for GNU extensions.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:09:00 -05:00
Yaakov Selkowitz 4e8291b8b0 Feature test macros overhaul: math.h
Simplify the C99 conditionals.  Mark the drem and gamma functions as
BSD|SVID, the Bessel double functions also XSI and the floats also SUSv3.
signgam is BSD|SVID|XSI, and matherr is SVID.  Finally, use the internal
macros to control the symbolic constants.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:08:59 -05:00
Yaakov Selkowitz 86a724b8c0 Feature test macros overhaul: limits.h
Simplify the C99 conditional, and use the internal macro for GNU extensions.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:08:57 -05:00
Yaakov Selkowitz ec4fe40b23 Feature test macros overhaul: grp.h
_PATH_GROUP is a BSDism. getgr*_r are BSD|SVID|POSIX, and the *grent
functions are BSD|SVID|XPG4v2.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:08:56 -05:00
Yaakov Selkowitz d94d983d1b Feature test macros overhaul: fnmatch.h
Use the proper internal macro for GNU extensions.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:08:54 -05:00
Yaakov Selkowitz d2df6d381b Feature test macros overhaul: fcntl.h
Most of the !_POSIX_SOURCE code is BSD, although ironically some were
added to POSIX.1-2001.

Use the ATFILE conditional for most of the *at functions, except
futimesat which is GNU.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:08:53 -05:00
Yaakov Selkowitz d2937299fa Feature test macros overhaul: dirent.h
MAXNAMLEN is a BSDism.

Use the proper internal macros instead of !_POSIX_SOURCE.  telldir and
seekdir are XSI, scandir and alphasort are POSIX.1-2008, and scandirat
is GNU.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:08:51 -05:00
Yaakov Selkowitz 575608b202 Feature test macros overhaul: ctype.h
Simplify C99 test for isblank.  isascii and toascii are BSD|SVID|XSI.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:08:50 -05:00
Yaakov Selkowitz 6ba26630e0 Feature test macros overhaul: sys/features.h
This is the complete rework of the feature tests macros for better
compatibility with GNU libc, primarily based on the Linux man pages
documentation:

http://man7.org/linux/man-pages/man7/feature_test_macros.7.html

The previous implementation was flawed in its approach that macros were
often used to hide symbols if defined (e.g. !defined __STRICT_ANSI__ or
!defined _POSIX_SOURCE), whereas the approach of glibc is that these macros
make symbols available when defined (e.g. defined _BSD_SOURCE, or as used
internally, #if __BSD_VISIBLE).  As much open-source software is written
with glibc in mind, this necessitated patching numerous packages just to
compile.

In particular, __STRICT_ANSI__ (which is defined by gcc -ansi or -std=c*)
was given too much importance.  This implementation limits the influence
of __STRICT_ANSI__ to controlling the default when no other feature test
macros are defined, and to the inclusion of <alloca.h> in <stdlib.h> as
documented.  These are the only places where __STRICT_ANSI__ should be
tested.

The following macros are now accepted: _ATFILE_SOURCE, _BSD_SOURCE,
_DEFAULT_SOURCE, _ISOC99_SOURCE, _ISOC11_SOURCE, _LARGEFILE_SOURCE,
_SVID_SOURCE, _XOPEN_SOURCE_EXTENDED.

The existing __*_VISIBLE internal macros have been kept mostly
compatible with the original BSD implementation, with some changes to
the criteria which controls them.  Several more macros in this style
have been added where needed for concision or accuracy.

Enabling C++11 or newer in the compiler also enables C99 and C11
functions.  Doing so should help move away from the need to define
_GNU_SOURCE in g++ for _GLIBCXX_USE_C99 support as on Linux:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51749

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:06:40 -05:00
Corinna Vinschen 8c5911b37c setvbuf: Drop setting reent->__cleanup
The __sinit call added with 1eb6db6 already sets reent->__cleanup.

	* libc/stdio/setvbuf.c (setvbuf): Drop setting reent->__cleanup.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-13 12:03:03 +01:00
Corinna Vinschen 1eb6db6efb Update setvbuf to latest OpenBSD implementation
Newlib's setvbuf function is very old and has two bugs:
- It sets the SRD/SWR flags incorrectly in case of files opened for
  reading and writing.
  See https://cygwin.com/ml/cygwin/2016-03/msg00180.html
  for a desription of the effect.
- It always sets the buffer size to BUFSIZ if it's not provided by
  the application, independent of the optimal blocksize for the
  underlying IO device.

Update setvbuf to latest code from OpenBSD to fix both problems.

	* libc/stdio/setvbuf.c (setvbuf): Import latest OpenBSD
	implementation.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-12 23:41:21 +01:00
Corinna Vinschen 99d0e2341d Add __swhatbuf function from OpenBSD
To fix a long-standing setvbuf bug, import __swhatbuf function from
OpenBSD and only slightly rearrange for newlib.

	* libc/stdio/local.h (__swhatbuf_r): Declare.
	* libc/stdio/makebuf (__smakebuf_r): New function.
	(__smakebuf_r): Drop file handling code and call __smakebuf_r.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-12 23:37:01 +01:00
Corinna Vinschen 6b97fabf1b Use __sputc_r inline code when building with gcc
Per the preceeding comment this inline code is disabled since 1993(!)
because of a bug in GCC at the time.  This is long gone and the equivalent
inline code is used in the BSDs for quite some time.  Enable this code for
newlib as well.

	* libc/include/stdio.h (__sputc_r): Enable GCC inline code.  Add
	handling for targets defining __SCLE.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-12 23:25:11 +01:00
Corinna Vinschen b9217601f8 Enable HW interrupt setup on x86/x86_64 systems by default
* configure.host: Define _I386MACH_DISABLE_HW_INTERRUPTS on rdos.
	Remove setting _I386MACH_ALLOW_HW_INTERRUPTS anywhere else.
	* libc/machine/i386/i386mach.h: Replace test for
	_I386MACH_ALLOW_HW_INTERRUPTS with test for
	!_I386MACH_DISABLE_HW_INTERRUPTS.
	* libc/machine/x86_64/x86_64mach.h: Ditto.
	* libc/sys/linux/machine/i386/i386mach.h: Ditto.
	* libm/machine/i386/i386mach.h: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-02-26 18:52:46 +01:00
Joel Sherrill 678f774727 newlib/configure.host: Turn off sti/cli for i386 setjmp for i386-rtems* 2016-02-25 14:11:27 -06:00
Jeff Johnston b8a88d0b04 Fix _newlib_version.h logic to support building gcc with newlib. 2016-02-25 15:04:19 -05:00
Yaakov Selkowitz a9ab09dfa9 libm/complex: add clog10, clog10f
newlib/
	* libc/include/complex.h (clog10, clog10f): Declare.
	* libm/complex/Makefile.am (src): Add clog10.c.
	(fsrc): Add clog10f.c.
	(CHEWOUT_FILES): Add clog10.def.
	* libm/complex/Makefile.in: Regenerate.
	* libm/complex/clog10.c: New file.
	* libm/complex/clog10f.c: New file.
	* libm/complex/complex.tex: Add references to clog10 docs.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-02-22 14:43:41 -06:00
Joel Sherrill 4fa84f10ec pthread.h, sys/types.h Add missing pthread methods
* pthread.h: Add prototypes for pthread_condattr_getclock(),
	pthread_condattr_setclock(), pthread_setschedpri(),
	pthread_getcpuclockid(), pthread_getconcurrency(), and
	pthread_setconcurrency().  Also cleaned up file header to
	remove CVS Id string.
	* sys/types.h: Add clock ID to pthread_condattr_t.
2016-02-22 10:05:17 -06:00
Corinna Vinschen c716affcef sys/features.h: Update Cygwin POSIX option macros
* libc/include/sys/features.h: Set POSIX option macros from 200112L
	to 200809L for Cygwin.
	(_POSIX_SPAWN): Set to 200809L for Cygwin.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-02-18 13:10:28 +01:00
Jeff Johnston 182e2502c8 Also fix libm/machine generated files. 2016-02-17 17:08:54 -05:00
Jeff Johnston 8d40d78ae0 Fix libm regenerated files again. 2016-02-17 17:06:46 -05:00
Jeff Johnston 0e03371dbf Fix regeneration of libm autotool files. 2016-02-17 16:49:59 -05:00
Pieter du Preez 264b817b8e Define the newlib version macros in one place: _newlib_version.h.
Currently, the newlib version information needs to be updated in two places:
 - newlib/acinclude.m4
 - newlib/libc/include/sys/features.h

The goal of this patch is to:
 - supply a single location for defining the newlib version
   information: newlib/acinclude.m4
 - define __NEWLIB__, __NEWLIB_MINOR__ and __NEWLIB_PATCHLEVEL__
   This is in line with what gcc does for its version macros. See:
   https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

This patch moves the definition of the _NEWLIB_VERSION, __NEWLIB__
and __NEWLIB_MINOR__ macros from newlib/libc/include/sys/features.h,
to the newly generated newlib/_newlib_version.h file. Additionally,
the __NEWLIB_PATCHLEVEL__ macro was created, for completeness.

In order to stay backwards compatible, newlib/_newlib_version.h gets
included by newlib/newlib.h and newlib/libc/include/sys/features.h.

Note: This patch does _not_ include the modifications to the following
files, as these should all be generated any way.
      *Makefile.in,
      *aclocal.m4,
      *configure
      stamp-* files

Signed-off-by: Pieter du Preez <pdupreez@gmail.com>
2016-02-17 16:04:09 -05:00
Václav Haisman 813da84442 POSIX barrier implementation, take 3
The attached patch should address all of the review comments.

Modifed change log:

Newlib:

	* libc/include/sys/features.h (_POSIX_BARRIERS): Define for Cygwin.
	* libc/include/sys/types.h (pthread_barrier_t)
	(pthread_barrierattr_t): Do not define for Cygwin.

Cygwin:

	* common.din (pthread_barrierattr_init)
	(pthread_barrierattr_setpshared, pthread_barrierattr_getpshared)
	(pthread_barrierattr_destroy, pthread_barrier_init)
	(pthread_barrier_destroy, pthread_barrier_wait): Export.
	* include/cygwin/types.h (pthread_barrierattr_t)
	(pthread_barrier_t): Declare.
	* include/pthread.h (PTHREAD_BARRIER_SERIAL_THREAD)
	(pthread_barrierattr_init, pthread_barrierattr_setpshared)
	(pthread_barrierattr_getpshared, pthread_barrierattr_destroy)
	(pthread_barrier_init, pthread_barrier_destroy)
	(pthread_barrier_wait): Declare.
	* thread.h (PTHREAD_BARRIER_MAGIC)
	(PTHREAD_BARRIERATTR_MAGIC): Define.
	(class pthread_barrierattr, class pthread_barrier): Declare.
	* thread.cc (delete_and_clear): New local helper function.
	(class pthread_barrierattr, class pthread_barrier): Implement.
	* miscfuncs.h (likely, unlikely): New macros.

--
VH
2016-02-13 16:03:15 +01:00
Yaakov Selkowitz ac2f9e23ec Remove broken ieeefp.h macros
Any attempt to use isnanf, isinff, or finitef from <ieeefp.h> with
GCC 5 on platforms other than SPU result in a "lvalue required as
unary '&' operand" error.

	newlib/libc/
	* include/ieeefp.h (__ieeefp_isnanf): Remove broken macro.
	(__ieeefp_isinff, __ieeefp_finitef): Ditto.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-02-12 11:35:56 -06:00
Yaakov Selkowitz 8b8952064c Fix compile with GCC 5 -Werror
newlib/libc/
	* stdio64/freopen64.c: Include <string.h> for memset().
	* stdlib/quick_exit.c: Include <unistd.h> for _exit().
	* string/gnu_basename.c (__gnu_basename): Fix discarded const
	qualifier warning.
	* stdlib/strtold.c: Include "mprec.h" for _strtorx_r().

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-02-12 10:16:06 -06:00
Corinna Vinschen c4dcfc1bda printf(3): Handle multibyte decimal point in field size computation
This patch fixes the problem reported in
  https://cygwin.com/ml/cygwin/2016-02/msg00014.html

  The 2009 changes to handle multibyte decimal point and thousands
  separator missed to take the length of a multibyte decimal point into
  account when computing the field size.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-02-08 13:33:17 +01:00
Jon Turney c5fee55606 stdio.h: Use __POSIX_VISIBLE etc. guards for POSIX 1003.1:2001 functions
Current mesa expects stdio.h to prototype fileno() when compiling with gcc
-std=c99 -D_XOPEN_SOURCE

Fix the 'POSIX 1003.1:2001' block in stdio.h to prototype functions if not
__STRICT_ANSI__, or _BSD_SOURCE, _POSIX_C_SOURCE or _XOPEN_SOURCE are defined
appropriately

As far as I can tell, despite being in this block, setbuffer() and setlinebuf()
are BSDisms which aren't in POSIX 1003.1:2001

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-02-08 10:39:31 +01:00
Игорь Веневцев 352cdbb012 Newlib build is broken if configured with nano-malloc and non-reentrant system calls
Non-reentrant system calls version implies both MISSING_SYSCALL_NAMES
and REENTRANT_SYSCALL_PROVIDED macros to be defined.
Being coupled with --enable-newlib-nano-malloc knob it breaks the build:

bash-4.3$ ../newlib-2.3.0.20160104/configure CC_FOR_TARGET=gcc
AR_FOR_TARGET=ar RANLIB_FOR_TARGET=ranlib CFLAGS_FOR_TARGET="-m32
-DMISSING_SYSCALL_NAMES -DREENTRANT_SYSCALLS_PROVIDED"
--target=i386-elf --enable-newlib-nano-malloc && make

<...omitted output...>

../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:
In function ‘_mallinfo_r’:
../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:489:35:
error: macro "_sbrk_r" requires 2 arguments, but only 1 given
         sbrk_now = _sbrk_r(RCALL 0);
                                   ^
../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:489:20:
error: ‘_sbrk_r’ undeclared (first use in this function)
         sbrk_now = _sbrk_r(RCALL 0);
                    ^
../../../../../../newlib-2.3.0.20160104/newlib/libc/stdlib/nano-mallocr.c:489:20:
note: each undeclared identifier is reported only once for each
function it appears in
Makefile:1512: recipe for target 'lib_a-nano-mallinfor.o' failed
make[8]: *** [lib_a-nano-mallinfor.o] Error 1

In case of non-reentrant system calls _sbrk_r became a macro with TWO
args (defined in reent.h):

#define _sbrk_r(__reent, __incr)  sbrk(__incr)

But in our case only one argument is present. (RCALL 0) is considered
as a single argument despite RCALL itself is a macro:)

So intermediate one-arg macro will be enough to expand args before
final _sbrk_r expansion:

#define _SBRK_R(X) _sbrk_r(X)

Here is a patch:
2016-02-08 10:33:07 +01:00
Igor Venevtsev 7c9651e3cc * newlib/libc/stdio/nano-vfscanf.c: Fix '%X' specifier procesing 2016-02-08 10:24:31 +01:00
Igor Venevtsev fa08ba8b23 * newlib/libc/stdio/nano-vfscanf.c: Fix '%F', '%G' and '%E' specifiers processing 2016-02-08 10:22:17 +01:00
Jeff Johnston c2a27453c6 Change if_nameindex() to use unsigned int i variable.
- i variable used in loop that shifts to right so use
  unsigned int instead
2016-02-04 13:30:14 -05:00
Corinna Vinschen ba4433e47f include/grp.h: Remove prototypes of non-standard functions
* libc/include/grp.h (group_from_gid): Remove prototype.
	(setgrfile): Ditto.
	(setgroupent): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-01-29 13:39:57 +01:00
Steve Ellcey 4792146a0f Fix memcpy bug that reads past end of buffer.
* libc/machine/mips/memcpy.S (memcpy): Fix read past end of
	input.
2016-01-28 14:08:35 -08:00
Yaakov Selkowitz a710c89dcb grp.h: use __BSD_VISIBLE and __XSI_VISIBLE guards
This fixes the build of krb5 and other packages on Cygwin.

	* libc/include/grp.h: Use __BSD_VISIBLE and __XSI_VISIBLE guards.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-01-28 15:41:59 -06:00
Thomas Preud'homme 69f4c40291 Make macro checks ARMv8-M baseline proof
libgloss:

        * arm/Makefile.in: Add newlib/libc/machine/arm to the include path if
        newlib is present.
        * arm/arm.h: Include acle-compat.h.
        (THUMB_V7_V6M): Rename to ...
        (PREFER_THUMB): This.  Use ACLE macros __ARM_ARCH_ISA_ARM instead of
        __ARM_ARCH_6M__ to decide whether to define it.
        (THUMB1_ONLY): Define for Thumb-1 only targets.
        (THUMB_V7M_V6M): Rename to ...
        (THUMB_VXM): This.  Defined based on __ARM_ARCH_ISA_ARM, excluding
        ARMv7.
        * arm/crt0.S: Use THUMB1_ONLY rather than __ARM_ARCH_6M__,
        !__ARM_ARCH_ISA_ARM rather than THUMB_V7M_V6M for fp enabling, and
        PREFER_THUMB rather than THUMB_V7_V6M.  Rename other occurences of
        THUMB_V7M_V6M to THUMB_VXM.
        * arm/linux-crt0.c: Likewise.
        * arm/redboot-crt0.S: Likewise.
        * arm/swi.h: Likewise.
        * arm/trap.S: Likewise.

newlib:

        * libc/machine/arm/memcpy-stub.c: Use ACLE macros __ARM_ARCH_ISA_THUMB
        and __ARM_ARCH_ISA_ARM to check for Thumb-2 only targets rather than
        __ARM_ARCH and __ARM_ARCH_PROFILE.
        * libc/machine/arm/memcpy.S: Likewise.
        * libc/machine/arm/setjmp.S: Likewise for Thumb-1 only target and
        include acle-compat.h.
        * libc/machine/arm/strcmp.S: Likewise for Thumb-1 and Thumb-2 only
        target and include acle-compat.h.
        * libc/sys/arm/arm.h: Include acle-compat.h.
        (THUMB_V7_V6M): Rename to ...
        (PREFER_THUMB): This.  Use ACLE macro __ARM_ARCH_ISA_ARM instead of
        __ARM_ARCH_6M__ to decide whether to define it.
        (THUMB1_ONLY): Define for Thumb-1 only targets.
        (THUMB_V7M_V6M): Rename to ...
        (THUMB_VXM): This.  Defined based on __ARM_ARCH_ISA_ARM, excluding
        ARMv7.
        * libc/sys/arm/crt0.S: Use PREFER_THUMB rather than THUMB_V7_V6M and
        rename THUMB_V7M_V6M into THUMB_VXM.
        * libc/sys/arm/swi.h: Likewise.
2016-01-28 11:26:37 +01:00
Corinna Vinschen 0b42ea7960 Deprecate newlib and winsup ChangeLog files
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-01-28 11:15:33 +01:00