From patchwork Sun May 6 14:41:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Chen X-Patchwork-Id: 909313 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-92062-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=andestech.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="YZdoRZDf"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40f7kK5NrFz9s0q for ; Mon, 7 May 2018 00:42:01 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-type; q=dns; s=default; b=yHKxpAgGrh/iIGjM K4QvQZG4XvKbH2Wp20Te7VtU9CybBz+7Ed0nTG8W3yx62XbEdu69qaeBnwWiaC3d grteUDSXySoLx7VWigpR9jTRKyWoeu7orB6yv43u88AoyNGzRETVM30cYekwTDDj 2fFT18RzWnBFRpd15FOLcRrNozs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-type; s=default; bh=0VAMPdKIIQvNagV+5ZYeNW x2fXE=; b=YZdoRZDfTA7KQvTsjJEhwUYwrQXKLYYxWJNznUG8G128QzIAHZa1tQ T/E401XR+OXsR0Ya62rgMZ3KM407/ayjLL2jyajteoWOytHkalzUknDRWpy8J3rr zxLaOtd9aVzW23g8xkyuZcQX1pgsyB94w+t3b+Yidj/DxRUy+S7tE= Received: (qmail 32288 invoked by alias); 6 May 2018 14:41:54 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 32269 invoked by uid 89); 6 May 2018 14:41:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL, BAYES_00, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 spammy=UD:The, Before, flexibility, colleagues X-HELO: ATCSQR.andestech.com From: vincentc To: CC: , , vincentc Subject: [PATCH 00/11] nds32 glibc Port v1 Date: Sun, 6 May 2018 22:41:14 +0800 Message-ID: <1525617685-32083-1-git-send-email-vincentc@andestech.com> MIME-Version: 1.0 X-DNSRBL: X-MAIL: ATCSQR.andestech.com w46EXn8L047093 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.