[PATCH 00/11] nds32 glibc Port v1
vincentc
vincentc@andestech.com
Sun May 6 14:41:00 GMT 2018
Hi, this serious of patch contains glibc port for Andes nds32 ISA. This is a
32 bit target using Linux-generic. The nds32 port for Linux had been included in
4.17-rc1. For testing convenience, the minimum kernel version is temporarily set
as 4.16. The nds32 ports for GCC and Binutils in upstream are too old to compile
this patchset. My colleagues are trying to upload the latest patch to upstream.
Before they finish, we put workable GCC and Binutils in the private git
repository and people can use them to build nds32 glibc toolchain. By the way,
the patch of build-many-glibcs.py for Andes nds32 port does not be included in
this patchest because we need to replace all download path with our private git
repository in build-many-glibcs.py. Therefore, we provide another
build-many-glibcs.py whose name is nds32-build-many-glibcs.py for nds32 in
the nds32 glibc git repository. The git repository path of each component for
nds32 is listed as below.
1. GCC git repo path:
path: https://github.com/andestech/gcc.git
branch: nds32-6.3.0-open
2. Binutils git repo path:
path: https://github.com/andestech/binutils.git
branch: nds32-binutils-2.30-branch-open
3. Glibc git repo
path: https://github.com/andestech/glibc.git
branch: nds32-glibc-2.27-v0
i. nds32's build-many-glibcs.py
https://github.com/andestech/glibc/blob/nds32-glibc-2.27-v0/sysdeps/nds32/misc/nds32-build-many-glibcs.py
4. Linux git repo
path: https://github.com/andestech/linux/commits/master
branch: master
In this patchset, the port for nds32 FPU extension is not included. We plan to
add it after the FPU ports for nds32 is accepted by Linux. Therefore, we keep
some flexibility in code for the ports of nds32 FPU extension.
The port has been cross-tested on the FPGA board running Linux 4.17-rc2. In
order to avoid false timeout, we set a large number to TIMEOUTFACTOR. In
addition, we found many testcases in conform fails because some nds32 predefined
macro lack double underscore prefix in this version nds32 gcc. This bug will be
fixed in newer nds32 gcc version which is based on gcc 8.1.0 and we will upload
it after few weeks. For testing convenience, we create a temporary patch which
add these illegal macros to ISO C90 keywords in conform/conformtest.pl to skip
these failures. This temporary patch will be removed after we upload newer nds32
gcc version to our private github.
(Temporary patch: https://github.com/andestech/glibc/commit/8b76851ba91eed053 )
The summary of glibc testsuite is listed as follows which includs the above
temporary patch:
Summary of test results that the extra tests are included:
14 FAIL
4886 PASS
10 UNSUPPORTED
Detail result:
https://github.com/andestech/glibc/blob/nds32-glibc-2.27-v0/sysdeps/nds32/misc/glibc_final_testing_result
The reasons for the 14 FAIL cases are listed as bellow.
1. nptl (8 FAIL cases)
i. The following 6 testcase fail because the testing environment lacks native
python:
./nptl/test-condattr-printers.test-result
./nptl/test-cond-printers.test-result
./nptl/test-mutexattr-printers.test-result
./nptl/test-mutex-printers.test-result
./nptl/test-rwlockattr-printers.test-result
./nptl/test-rwlock-printers.test-result
ii.The tst-cancel7 and tst-cancel7x fails because the 1 second timeout, at
108-th line in tst-cancel7.c, is not enough for child thread to finish all
work before system(). In other words, parent thread executes
xpthread_cancel () before child thread executes system(). Therefore, child
thread cannot write self-pid on pidfile and error message 'could not read
pid' is got. The nds32 port can pass this testing after we extend the
timeout to 5 seconds.
2. misc (3 FAIL cases)
i. A new flag, RWF_APPEND, for preadv2/pwritev2 is added in Linux 4.16. This
change causes expected ENOTSUP does not be caught in misc/tst-preadvwritev2
and misc/tst-preadvwritev64v2. The nds32 ports can pass these two cases
after adding the new flag RWF_APPEND to sysdeps/unix/sysv/linux/bits/uio-ext.h
and misc/ tst-preadvwritev2-common.c.
ii.The misc/test-errno-linux occasionally fails in sendfile function because
EINVAL is caught rather than EBADF. The reason is due to uninitialized
local variable 'off'. When 'off' is a negative number, the errno is set as
EINVAL in glibc sendfile function before issuing sendfile syscall. The
nds32 port can always pass the testing after initializing variable 'off'
to zero.
3. stdio-common (1 FAIL case)
i. The required memory size for stdio-common/bug22 testcase is more than 2 GB
but the DRAM size on our FPGA is just 2GB. Therefore, the errno is set as
ENOMEM instead of EOVERFLOW.
4. sunrpc (1 FAIL case)
i. sunrpc/bug20790 fails because the testing environment lacks native cpp
5. malloc(1 FAIL case)
i. malloc/tst-malloc-usable-tunables randomly fails. We hadn't found the root
causes but we found some people encountered the same failure on the
Internet. They think this failure is due to kernel bug. Therefore, we
temporarily treat it as a false positive case for glibc.
(https://www.mail-archive.com/debian-glibc@lists.debian.org/msg57118.html)
We imitate the RISC-V patchset to create our patches. Che-Wei and I volunteer to
be port maintainer. Thanks to everyone who helped us and contributed to it. :)
Any feedback is welcome.
More information about the Libc-alpha
mailing list