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>
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>
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>
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:
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>
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.
If small reent is enabled (_REENT_SMALL is defined) then malloc() was
used in __register_exitproc() even if user requested it to be disabled
(_ATEXIT_DYNAMIC_ALLOC is defined). With this fix, function fails when
_ATEXIT_DYNAMIC_ALLOC is defined and whole static storage is already
used.
2015-12-21 Freddie Chopin <freddie.chopin@gmail.com>
* libc/stdlib/__atexit.c (__register_exitproc): Fix for
_ATEXIT_DYNAMIC_ALLOC.
2015-12-21 Freddie Chopin <freddie.chopin@gmail.com>
* libc/stdlib/on_exit_args.{c,h}: New files.
* libc/stdlib/Makefile.am: Add new source file.
* libc/stdlib/Makefile.in: Regenerate.
* libc/stdlib/__atexit.c (__register_exitproc): Initialize
_on_exit_args_ptr field of _GLOBAL_ATEXIT on first run.
* libc/stdlib/on_exit.c: Force linking of static instance of
_on_exit_args.
* libc/stdlib/cxa_atexit.c: Likewise.
GCC for ARC has been updated to provide consistent naming of preprocessor
definitions for different optional architecture features:
* __ARC_BARREL_SHIFTER__ instead of __Xbarrel_shifter for
-mbarrel-shifter
* __ARC_LL64__ instead of __LL64__ for -mll64
* __ARCEM__ instead of __EM__ for -mcpu=arcem
* __ARCHS__ instead of __HS__ for -mcpu=archs
* etc (not used in newlib)
This patch updates assembly routines for ARC to use new definitions instead
of a deprecated ones. To ensure compatibility with older compiler new
definitions are also defined in asm.h if needed, based on deprecated
preprocessor definitions.
*** newlib/ChangeLog ***
2015-12-15 Anton Kolesov <Anton.Kolesov@synopsys.com>
* libc/machine/arc/asm.h: Define new GCC definition for old compiler.
* libc/machine/arc/memcmp-bs-norm.S: Use new GCC defines to detect
processor features.
* libc/machine/arc/memcmp.S: Likewise.
* libc/machine/arc/memcpy-archs.S: Likewise.
* libc/machine/arc/memcpy-bs.S: Likewise.
* libc/machine/arc/memcpy.S: Likewise.
* libc/machine/arc/memset-archs.S: Likewise.
* libc/machine/arc/memset-bs.S: Likewise.
* libc/machine/arc/memset.S: Likewise.
* libc/machine/arc/setjmp.S: Likewise.
* libc/machine/arc/strchr-bs-norm.S: Likewise.
* libc/machine/arc/strchr-bs.S: Likewise.
* libc/machine/arc/strchr.S: Likewise.
* libc/machine/arc/strcmp-archs.S: Likewise.
* libc/machine/arc/strcmp.S: Likewise.
* libc/machine/arc/strcpy-bs-arc600.S: Likewise.
* libc/machine/arc/strcpy-bs.S: Likewise.
* libc/machine/arc/strcpy.S: Likewise.
* libc/machine/arc/strlen-bs-norm.S: Likewise.
* libc/machine/arc/strlen-bs.S: Likewise.
* libc/machine/arc/strlen.S: Likewise.
* libc/machine/arc/strncpy-bs.S: Likewise.
* libc/machine/arc/strncpy.S: Likewise.
Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Provide a _REENT_INIT_PTR_ZEROED() macro to initialize an already
zero-initialized struct _reent.
* libc/include/sys/reent.h (_REENT_INIT_PTR_ZEROED): New.
(_REENT_INIT_PTR): Define only once and use _REENT_INIT_PTR_ZEROED().
* libc/include/sys/_sigset.h: New.
* libc/include/sys/select.h: Do not include <sys/types.h> and
<sys/time.h> to avoid cyclic header file dependencies. Include
specialized header files instead.
(sigset_t): Conditionally define.
* libc/include/sys/signal.h (sigset_t): Likewise.
* libc/include/sys/time.h: Include <sys/select.h> if
__BSD_VISIBLE.
* libc/include/sys/types.h: Likewise.
In some code paths the __atexit_lock held by this function was not
released when returning with an error.
* libc/stdlib/__atexit.c (__register_exitproc): Always release
lock before return.
Currently, double precision math functions in newlib/libm/machine/arm detect whether neon instructions can be used for double precision computation by checking the architecture version (>= 8) and the availability of floating-point instructions. However, these instructions would not be available if targeting fpv5-sp-d16 as the FPU, which by definition does not have 64bit float instructions. This patch adds a check that __ARM_FP advertises 64bit float instructions.
* libm/machine/arm/s_ceil.c: Also check that 64bit FP instructions are
available in the guard.
* libm/machine/arm/s_floor.c: Likewise.
* libm/machine/arm/s_nearbyint.c: Likewise.
* libm/machine/arm/s_rint.c: Likewise.
* libm/machine/arm/s_round.c: Likewise.
* libm/machine/arm/s_trunc.c: Likewise.
* libc/stdio/freopen.c (_freopen_r): Only reset __SWID bit per SUSv4.
* libc/stdio64/freopen64.c (_freopen64_r): Add missing resetting of
flag values and _mbstate.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* libc/include/sys/types.h: Move definitions of NBBY and howmany to
sys/param.h. Move definitions of select(2) macros to sys/select.h.
* libc/include/sys/param.h: See above.
* libc/include/sys/select.h: Move Cygwin's sys/select.h here.
* include/sys/select.h: Move select(2) macros from newlib's sys/types.h
here. Rename howmany to _howmany to unclutter namespace. Move file to
newlib.
* libc/rexex.cc: Add declaration for cygwin_gethostname.
* poll.cc: Include sys/param.h and locale select.h.
* select.h (cygwin_select): Declare.
* uname.cc: Declare cygwin_gethostname.
* winsup.h: Drop declarations of cygwin_select and cygwin_gethostname.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Reformulate the strcmp-armv7.S selection logic around the architecture
features required by the implementation code rather (some) version of
the architecture that expose those features.
The patch moves the inline ASM thumb2 -Os implementation out into its
own .S file.
Tested by building newlib and comparing libc.a binaries before and
after for all permutations of:
Architectures:
armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k
armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a
armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2
ISAs:
thumb arm
Optimization Levels:
Os O2
Excluding:
armv6s-m -mthumb
armv6-m -mthumb
armv6zk -mthumb
armv6z -mthumb
armv6k -mthumb
armv6j -mthumb
- move the description of the alternative form produced with the # flag from a
nested table to an additional table
2015-11-12 Jon Turney <jon.turney@dronecode.org.uk>
* libc/stdio/sprintf.c: Simplify documentation markup.
* libc/stdio/swprintf.c: Ditto.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
- use bullet points to separate width, size and type sections, rather than using
rows in an enormous table, for consistency with sprintf and swprintf.
- use code markup for size bullet point for consistency
- use a texinfo multitable for description of the size flags, rather than some
preformatted text
- tidy up some whitespace so type flags are all aligned
2015-11-12 Jon Turney <jon.turney@dronecode.org.uk>
* libc/stdio/sscanf.c: Improve documentation markup.
* libc/stdio/swscanf.c: Ditto.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
The patch moves the inline ASM thumb1 -O2 implementation out into its
own .S file.
Tested by building newlib and comparing libc.a binaries before and
after for all permutations of:
Architectures:
armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k
armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a
armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2
ISAs:
thumb arm
Optimization Levels:
Os O2
Excluding:
armv6s-m -mthumb
armv6-m -mthumb
armv6zk -mthumb
armv6z -mthumb
armv6k -mthumb
armv6j -mthumb
The patch adds strlen.S to contain the complementary preprocessor
logic to strlen-stub.c intended to provide #inclusion of alternative
.S implementations.
Initially we just include the existing strlen-armv7.S implementation.
We rewrite _ISA_ARMV7 in both strlen.S and strlen-stub.c to use the
underlying existing underlying defintion from arm_asm.h in order to
avoide including that file, this is in effect the first step towards a
move to ACLE predefines only.
Tested by building newlib and comparing libc.a binaries before and
after for all permutations of:
Architectures:
armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k
armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a
armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2
ISAs:
thumb arm
Optimization Levels:
Os O2
Excluding:
armv6s-m -mthumb
armv6-m -mthumb
armv6zk -mthumb
armv6z -mthumb
armv6k -mthumb
armv6j -mthumb
In order to maintain consistency both within machine/arm and between
machine/arm and machine/aarch64, rename the 'c' stub to -stub.c.
Tested by building newlib and comparing libc.a binaries before and
after for all permutations of:
Architectures:
armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k
armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a
armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2
ISAs:
thumb arm
Optimization Levels:
Os O2
Excluding:
armv6s-m -mthumb
armv6-m -mthumb
armv6zk -mthumb
armv6z -mthumb
armv6k -mthumb
armv6j -mthumb
This patch flattens the condition code selection used in strlen in an
attempt to make the guarding condition for each alternative
implementation clearer and to structure the logic in a manner that
makes it easier to maintain complementary logic between the
alternative 'C' and assembler implementations.
Tested by building newlib and comparing libc.a binaries before and
after for all permutations of:
Architectures:
armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k
armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a
armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2
ISAs:
thumb arm
Optimization Levels:
Os O2
Excluding:
armv6s-m -mthumb
armv6-m -mthumb
armv6zk -mthumb
armv6z -mthumb
armv6k -mthumb
armv6j -mthumb
Regression testing newlib in conjunction with libgloss and
--enable-multilib can result in incompatible multilib versions of
newlib and libgloss being used during link.
This manifests on ARM target when newlib regression is run using a
GCC configured using --with-multilib-list=aprofile
With this configuration many of the multilib variants built are
mutually incompatible.
The issue is that the newlib dejagnu foo iterates each multilib
variant and correctly chooses the appropriate newlib variant but
always chooses the root/base libgloss variant.
The implementation of newlib/testsuite/lib/flags.exp contains the
following fragment:
set target_build_path "$objdir/$multibuildtop.."
The effect of this fragment is to explicitly select the root version
of libgloss, irrespective of the current multilib.
Digging around in VC it appears that the original implementation of
multlib magic came into the tree back in 2002 with:
6e9d950a (Thomas Fitzsimmons 2002-05-01 17:06:25 +0000 39)
In this initial version of multilib support, newlib was multilib
capable, but libgloss was not multilib capable, hence the necessity to
explicitly select the root libgloss version.
Subsequently flags.exp was modified to support out of tree testing:
cec1d3b4 (Jeff Johnston 2005-07-05 00:11:50 +0000 25)
This change is orthogonal to this issue, its effect is to exit early
in none multilib configurations.
Subsequently libgloss gained --enable-multilib support, the relevant
change is:
https://sourceware.org/ml/newlib/2006/msg00440.html
commit 00a4b31ad0
Author: Jeff Johnston <jjohnstn@redhat.com>
Date: Wed May 10 20:51:41 2006 +0000
This change enabled multilib support throughout libgloss, but ommitted
to adjust the flag.exp behaviour which anchors the libgloss multilib
selection to the base version.
The attached patch adjusts flags.exp to select the current multilib
variant of libgloss.
2015-11-06 Marcus Shawcroft <marcus.shawcroft@arm.com>
* testsuite/lib/flags.exp (libgloss_link_flags): Drop multilibtop
from target_build_path.
Align makedoc's iscommand() with it's documentation, and don't allow commands to
contain a space. A command is a line containing only a sequence of capital
letters or '_', followed by optional spaces.
This prevents "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE" (the only line in the license text which consists of only
capitals and spaces, without any punctuation) from being interepreted as a
makedoc command, leading to:
"Can't find IMPLIED"
"warning, IMPLIED is not recognised"
being emitted by makedoc, (which is normally un-noticed because makedoc's stderr
is redirected to a .ref file)
2015-11-06 Jon Turney <jon.turney@dronecode.org.uk>
* doc/makedoc.c (iscommand): Only allow commands to have trailing
spaces, not space separated words.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>