663 Commits

Author SHA1 Message Date
Andrew Burgess
ec0827d3c2 test/silly: Extend include path.
When attempting to build uClibc under buildroot, including building the
tests, the silly tests don't currently compile, a result of attempting
to build using a compiler that does not yet have an installed version of
uClibc available.  The error is a missing header file, specifically
atomic.h.

Taking inspiration from the nptl tests, I have extended the EXTRA_CFLAGS
variable to add the required include paths.  The tests can now be built
under buildroot.

Signed-off-by: Andrew Burgess <andrew.burgess@embecosm.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-20 12:18:19 +02:00
Will Newton
fe7d30e633 _scanf.c: Implement 'm' modifier for 'c' and '[' conversions.
The current code implements the 'm' modifier only for 's'
conversions and would cause a segfault if it was used for 'c'
or '[' conversions. This patch extends the code to cover these
cases too.

The original version could write scanned data outside the passed buffer
because index i used in the '[' conversion handling block was clobbered.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-20 10:59:30 +02:00
Bernhard Reutner-Fischer
cc8d7d062e include: update atomic.h from glibc
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-27 00:08:46 +01:00
Bernhard Reutner-Fischer
560f416794 test: Add SIMULATOR_uclibc and SIMULATOR_glibc
where SIMULATOR_glibc is an optional simulator to run host binaries and
SIMULATOR_uclibc is an optional simulator to run target (uClibc)
binaries.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-27 00:08:45 +01:00
Bernhard Reutner-Fischer
9e552e6a2d test: tweaks
Fix arc4random exclusion for real.
Silence warning about missing prototype for external helper-function in
tst-scandir

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-25 23:59:52 +01:00
Bernhard Reutner-Fischer
6ff9c31abc utmp: favour POSIX utmpx over SVID utmp
Note: _PATH_UTMPX == _PATH_UTMP and the utmp struct is identical to the
utmpx struct so this only changes the external API entrypoints and NOT
the underlying data source.

This saves about 500b (~1300b from previously ~1950) while at it.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-25 23:59:45 +01:00
Bernhard Reutner-Fischer
6372941899 test: add utmpx test
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-22 14:49:27 +01:00
Bernhard Reutner-Fischer
fdebbe2044 test: enable libm test log2
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-22 14:49:27 +01:00
Bernhard Reutner-Fischer
6c4538905e libm: Add missing C99 float/ld wrappers
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-18 22:32:22 +01:00
Bernhard Reutner-Fischer
78e6494c2c test: skip arc4random on glibc
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-18 22:32:13 +01:00
Bernhard Reutner-Fischer
f334556476 test: Tweak arc4random exclusion
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-17 21:00:51 +01:00
Bernhard Reutner-Fischer
516c45013d test: Adjust passed options
to follow suit 0676373756

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-01-07 13:26:42 +01:00
Anthony G. Basile
638a23483b mkostemp: fix implementation
mkostemp(char *template, int flags) generates a unique temporary
filename from a template.  The flags parameter accepts three of
the same flags as open(2): O_APPEND, O_CLOEXEC, and O_SYNC.  The
current implementation of mkostemp(3) does not respect the flags
and in fact confuses the flags with the file mode which should
always be S_IRUSR | S_IWUSR.  This patch corrects this issue.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-12-15 17:53:06 +01:00
Bernhard Reutner-Fischer
bff3a664e6 test: Some more tests under conditionals
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-12-15 17:32:57 +01:00
Bernhard Reutner-Fischer
0676373756 unistd: allow to turn off getopt_long
The GNU variant of getopt() previously had no way to turn off
getopt_long() support.
2014-12-12 16:18:12 +01:00
Bernhard Reutner-Fischer
d6da534cbf test: disable ptytest unless HAS_PTY
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-12-12 16:06:17 +01:00
Bernhard Reutner-Fischer
b364229604 locale: Add wcsftime()
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-11-19 17:29:09 +01:00
Anthony G. Basile
33a12b5540 libc: add fallocate() and fallocate64()
We add the Linux-specific function fallocate() which allows the user to
directly manipulate allocate space for a file.  fallocate() can operate
in different modes, but the default mode is equivalent to posix_fallocate()
which is specified in POSIX.1.

Recent releases of e2fsprogs 1.42.11 and above expect fallocate64() to be
available.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-09 13:48:45 +02:00
Bernhard Reutner-Fischer
bc23c6440d test: wcsftime depends on XLOCALE
Thanks to Waldemar Brodkorb for noticing.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-04 13:16:35 +02:00
Bernhard Reutner-Fischer
ff48662bba test: disable librt shmtest on non-MMU systems
This test fails for non-MMU systems, because it uses fork()
Thanks to Waldemar Brodkorb!

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-04 13:12:52 +02:00
Waldemar Brodkorb
88041f133f test: disable test for systems without FPU
This test fails for systems without fpu.
For example m68k build for non-mmu/non-fpu systems fail.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-29 16:24:19 +02:00
Waldemar Brodkorb
512fd3804b test: sync with glibc, use do_test
This breaks out of a deadlock, which occurs when testing for powerpc. (qemu)
Otherwise the test suite does not finish.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-28 13:15:55 +02:00
Waldemar Brodkorb
697dbb016e test: get out of the endless while loop, when bind failed
When bind() fails in this test, then /tmp get filled up with
temp files and upcoming tests will fail, because they need to create
temp files, too. Better exit from the loop.
Test still needs to be investigated to fix the failing bind().

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-28 13:13:36 +02:00
Waldemar Brodkorb
ad687dda63 test: do not depend on compile
When you cross-compile the testsuite and then try to run
on a system without gcc/binutils it would be nice if no compiling
or linking is tried. Refresh test/README (suggested by Khem)

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-28 13:04:46 +02:00
Waldemar Brodkorb
23abbfa633 test: NPTL: sync WRITE_BUFFER_SIZE with glibc test
Test on Linux 3.16.1 in Qemu ARM fails with:
 TEST_EXEC nptl/ tst-cancel4
ret == 1 ; expected_ret == 0
make[1]: *** [tst-cancel4.exe] Error 1
The output of failed test is:
minimum write buffer size too large
../Test.mak:89: recipe for target 'tst-cancel4.exe' failed

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-28 13:02:45 +02:00
Alexey Brodkin
8c93ff92c3 test/math: fix for MIPS that takes 32/64 suffix into account
This fixes a breakage for MIPS32/64 introduced in:
http://git.uclibc.org/uClibc/commit/?id=c02bc5763ba9c8f8b464bca89fba28e091ce1ffc

Now ULP_SUFFIX is taken into account when searching for existing
libm-test-ulps-ARCH

Signed-off-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>

Cc: Waldemar Brodkorb <wbx@openadk.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Anton Kolesov <akolesov@synopsys.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18 12:22:02 +02:00
Alexey Brodkin
50442f4530 test/math: fix for disabled long double math
Commit "test: cater for config" http://git.uclibc.org/uClibc/commit/test/math/Makefile.in?id=7598eeaa1defa2884adaa890bb115c493d69cc35 inverted check from
	ifeq ($(UCLIBC_HAS_LONG_DOUBLE_MATH),y)
to
	ifeq ($(UCLIBC_HAS_LONG_DOUBLE_MATH),)
with first branch indeed inverted - instead of adding tests they were excluded.
But "else" branch was not moved up (remember check was inverted).

This causes compile breakage when building basic-test.c:
--->---
TEST_LINK math/ basic-test
basic-test.c: In function 'ldouble_test':
basic-test.c:111:1: warning: implicit declaration of function 'nanl' [-Wimplicit-function-declaration]
 TEST_FUNC (ldouble_test, long double, nanl, LDBL_EPSILON, HUGE_VALL)
 ^
basic-test.o: In function `main':
basic-test.c:(.text.startup+0x834): undefined reference to `nanl'
basic-test.c:(.text.startup+0x858): undefined reference to `nanl'
basic-test.c:(.text.startup+0x880): undefined reference to `nanl'
basic-test.c:(.text.startup+0x8a8): undefined reference to `nanl'
basic-test.c:(.text.startup+0x8d4): undefined reference to `nanl'
basic-test.o:basic-test.c:(.text.startup+0x8e0): more undefined references to `nanl' follow
collect2: error: ld returned 1 exit status
make[3]: *** [basic-test] Error 1
--->---

Fix is simple - merge "old else" branch with the first current one.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Anton Kolesov <akolesov@synopsys.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18 12:11:52 +02:00
Anton Kolesov
361285886a lseek: Correct order of offset arguments
There was a runtime error in systems without large file support. Call
fseek(fd, 4096, SEEK_SET) has been failing with EINVAL, though it was
succeeding for offset = 4092. This has been happening because llseek system
call accepts 64-bit value as an offset argument and lseek function has been
ordering 32-bits words that form this offset value, according to the
endianness. However this ordering to match endianness is not required,
because llseek doesn't accept one 64-bit offset argument, it accepts two
32-bit offset argument, then stitches them into one following its
endianness. As a result on little endian system, order of words has been
swapped two time: in libc and in kernel. Thus call to fseek with offset 4096
(0x1000) was doing a system call to llseek with offset 0x1000_0000_0000. I'm
not entirely sure why then offset = 4092 hasn't been failing then.

This patch removes malicious swap of words when calling llseek.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18 12:01:36 +02:00
Alexey Brodkin
fe1075ea83 test_nptl: replace __sigpause with sigpause
On attempt to build uClibc tests following error message appears:
=========
TEST_LINK nptl/ tst-cancel4
tst-cancel4.c: In function 'tf_sigpause':
tst-cancel4.c:765:3: warning: implicit declaration of function
'__sigpause' [-Wimplicit-function-declaration]
__sigpause (SIGCANCEL, 1);
^
tst-cancel4.o: In function `tf_sigpause':
tst-cancel4.c:(.text+0x1054): undefined reference to `__sigpause'
collect2: error: ld returned 1 exit status
=========

This commit http://git.uclibc.org/uClibc/commit/?id=cef1f9517c319d86b4b426ecc14a10d0fa5494c7
makes __sigpause static limiting its scope to "libc/signal/sigpause.c".

Switching to common implementation "sigpause()" fixes this issue.

Signed-off-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>

Suggested-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18 11:55:43 +02:00
Vineet Gupta
fd4a5861e2 ARC/NPTL: Add tests
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18 11:52:35 +02:00
Jian Peng
c02bc5763b test/math: add fallback to libm-test-ulps-generic logic
Under test/math/, there is libm-test-ulps-generic used as fallback
in case that libm-test-ulps-$(TARGET_ARCH) does not exist.

This is required for arches that don't have ULPS yet.

Original patch from Jian Peng was found here:
http://lists.uclibc.org/pipermail/uclibc/2011-April/045172.html

Signed-off-by: Jian Peng <jipeng2005@gmail.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Anton Kolesov <akolesov@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-07-24 21:56:31 +02:00
Gregory Fong
3a3b2e42e5 test/math: Adjust arm tests for older ULPs format
The ULPs format in glibc has changed slightly and now deviates from
that in uClibc, so when using the files directly from glibc, for
certain types of tests the ULPs values were incorrectly defaulting to
0 rather than using the values provided.  This caused some tests to
fail despite the max ULPs being correctly marked.

Regenerated and updated part of the ULPs file to fix this issue.  This
also added values for exp and log.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-04-23 13:40:50 +02:00
Gregory Fong
9902a14bea test/math: add libm-test-ulps-{arm,mips32,mips64} files
Adds the mips and arm test ULPs from glibc.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-04-06 01:23:52 +02:00
Gregory Fong
b281287719 test/math: don't try to build test dep as test
libm-test.c is a generated file needed by the other math tests, but
test rules were trying to build it as a test if trying to compile the
tests a second time.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-04-04 16:13:16 +02:00
Gregory Fong
8589144721 test/math: Select correct ULPs for mips32/mips64
Using TARGET_ARCH isn't sufficient when ISA can differ.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-04-04 16:07:51 +02:00
Bernhard Reutner-Fischer
988d78ad25 test: Reuse PTINC in nptl tests
Use toplevel Rules.mak notion of PTINC as list of includes to use for
the testcases.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-04-02 15:22:43 +02:00
Bernhard Reutner-Fischer
a20a91ad7c test: Fix math .c dependency
When explicitly running the compile target we were missing a dependency
to generate the libm-test.c.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-02-18 23:30:28 +01:00
Vineet Gupta
7b797aa69e test/tls/tst-tls[6-8]: Fix build errors
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-02-15 11:06:57 +01:00
Baruch Siach
931e839156 test: tls: fix build with newer binutils
Fix the following build failures:

ld: tst-tls10.o: undefined reference to symbol 'f2a'
ld: tst-tls12.o: undefined reference to symbol 'a1'

binutils ld defaults to --no-copy-dt-needed-entries since version 2.22. Add
library dependencies explicitly.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-06 22:22:00 +01:00
Baruch Siach
f33b9d2538 test: inet: fix build when res_close support is disabled
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-06 22:22:00 +01:00
Bernhard Reutner-Fischer
e286a67441 pull kconfig from linux-3.11
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-06 22:21:59 +01:00
Anthony G. Basile
10d12e77d5 libc/misc/gnu/obprintf.c: implement obstack_printf and obstack_vprintf
This adds a straight forward implementation for obstack_printf and
obstack_vprintf on uClibc's already existing obstack_grow and
vasprintf.  It does not attempt to port over glibc's implementation
in terms of _IO_* structs and functions.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-06-14 10:44:08 +02:00
Anthony G. Basile
f143f92069 config: UCLIBC_HAS_OBSTACK to optionally enable obstack support
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-06-14 10:43:41 +02:00
Bernhard Reutner-Fischer
e80657059a add UCLIBC_SUSV2_LEGACY to hide valloc
valloc was marked as LEGACY in SUSv2, removed from SUSv3 and later.
TODO: Remove this (point people to memalign and it's successors?).

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-04-04 00:25:06 +02:00
Bernhard Reutner-Fischer
044ac16085 inet: Fix LT{.old,} compilation due to res_iclose
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-20 11:08:49 +01:00
Bernhard Reutner-Fischer
64828a12a0 test: fix non-O checking
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-20 10:08:15 +01:00
Bernhard Reutner-Fischer
6bfb450b58 test: add missing top_srcdir
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-14 22:49:25 +01:00
Bernhard Reutner-Fischer
8b150a9491 test: silence warning in skeleton
Some tests use fd, rename the one in the skeleton.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-14 22:49:25 +01:00
Bernhard Reutner-Fischer
bad7c039de test: silence warning in testsuite.h
silence warnings about unused parameters

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-14 22:49:25 +01:00
Bernhard Reutner-Fischer
74dd5ff42c test: update test-skeleton.c
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-14 22:49:25 +01:00