Hi All: We have some patches to port klibc to ArmV8. The first set of patches from Neil Williams fixes the build issues. The second set of patches from Anil Singhar fixes functionalities. The following files have changed in the second set of patches ------------------------------------------------------------------------------------------ usr/include/arch/aarch64/klibc/archconfig.h usr/include/arch/aarch64/klibc/archsetjmp.h usr/include/arch/aarch64/klibc/archstat.h usr/include/sys/stat.h usr/include/unistd.h usr/klibc/SYSCALLS.def usr/klibc/arch/aarch64/Kbuild usr/klibc/arch/aarch64/MCONFIG usr/klibc/arch/aarch64/crt0.S usr/klibc/arch/aarch64/link.c usr/klibc/arch/aarch64/mknod.c usr/klibc/arch/aarch64/select.c usr/klibc/arch/aarch64/setjmp.S usr/klibc/arch/aarch64/symlink.c usr/klibc/arch/aarch64/syscall.S usr/klibc/arch/aarch64/sysstub.ph usr/klibc/arch/aarch64/vfork.S usr/klibc/statfs.c usr/klibc/tests/stat.c The above changes broadly include the following: 1. start-up code in crt0.S 2. wrapper to system calls as generated from sysstub.ph and error handling in syscall.S 3. corrections to some system call definitions such as symlinkat, mkdirat etc. 4. corrections to some data structure definitions such as stat etc. 5. separate aarch64 specific definition for some syscalls such as fork, vfork etc. 6. fixes to setjmp and longjmp functions Manual testing as provided within the package has been done with all tests passing. This includes the units tests available under usr/klibc/tests, usr/utils, usr/dash and usr/gzip. For dash and gzip, only sanity testing has been done. Automatic testing has been done using mksh with the following results: Total failed: 5 (4 ignored) (1 unexpected) Total passed: 431 The code is available at: git clone git://git.linaro.org/people/anil.singhar/klibc-aarch64.git Comments are highly appreciated. Thanks and Regards, Anil -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.zytor.com/pipermail/klibc/attachments/20131009/afb80f1b/attachment.html>
Anil Singhar dixit:>Manual testing as provided within the package has been done with all tests >passing. This includes the units tests available under usr/klibc/tests, >usr/utils, usr/dash and usr/gzip. For dash and gzip, only sanity testing >has been done.It?s *massively* recommended to try to build mksh against klibc then run mksh?s testsuite, since it?s proven, time and time again, to be a decent toolchain exercise. To do this: $ export CC=/path/to/klcc # can be cross-klcc too $ export CFLAGS='-Os' # can add -g3 for debugging $ wget https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R48b.tgz $ tar xzf mksh-R48b.tgz $ cd mksh $ sh Build.sh -r 2>&1 | tee build.log Then, if cross-compiling, transfer the following files to the arm64 target system (or emulator): check.pl check.t (from source) mksh test.sh (generated) Install /bin/ed on the arm64 system (or, otherwise, ignore the three testsuite failures that result from missing it). Install stuff like coreutils and perl on the arm64 system in order to be able to actually run the testsuite. Then, on the arm64 system, run $ ./test.sh 2>&1 | tee test.log The current path of the build directory is hardcoded in test.sh, so you can also run this instead: $ ./mksh test.sh -p $(pwd)/mksh 2>&1 | tee test.log Then, send both build.log and test.log if I need to inspect any failures. For added fun, set CC='klcc -shared' and copy /lib/klibc-*.so over, too. On at least one architecture (IA64 aka Itanic), the dynamic version fails while the static (default) one works. bye, //mirabilos --> emacs als auch vi zum Kotzen finde (joe rules) und pine f?r den einzig > bedienbaren textmode-mailclient halte (und ich hab sie alle ausprobiert). ;)Hallooooo, ich bin der Holger ("Hallo Holger!"), und ich bin ebenfalls ... pine-User, und das auch noch gewohnheitsm??ig ("Oooooooohhh"). [aus dasr]
On Wed, 9 Oct 2013 10:44:27 +0000 (UTC) Thorsten Glaser <tg at mirbsd.de> wrote:> Anil Singhar dixit: > > >Manual testing as provided within the package has been done with all > >tests passing. This includes the units tests available under > >usr/klibc/tests, usr/utils, usr/dash and usr/gzip. For dash and > >gzip, only sanity testing has been done. > > It?s *massively* recommended to try to build mksh against klibc > then run mksh?s testsuite, since it?s proven, time and time again, > to be a decent toolchain exercise.I gave Anil that advice when he started working from my original code base. He has run those tests.> Hi Neil, > > Thanks for your response. I prepared the mksh test and ran them. > There were 5 failures (out of the 436 tests) as follows.root at genericarmv8:~/anilss/AArch64/mksh# ./mksh test.sh -p $PWD/mksh The only failure which did not have an (ignored) tag was: FAIL ./check.t:glob-bad-2 Description: Check that symbolic links aren't stat()'d unexpected stdout - first difference: line 2, char 2 (wanted 'i', got '*' wanted: dir/abc dir/abc got: dir/abc d*/abc Apologies that the full log wasn't attached - Anil, could you attach that, please? Also, the patch for my original changes seems to have been too large for the mailing list. debian branch at: https://github.com/codehelp/klibc-aarch64 -- Neil Williams ============http://www.linux.codehelp.co.uk/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://www.zytor.com/pipermail/klibc/attachments/20131009/68ee84fb/attachment.sig>
On Wed, Oct 09, 2013 at 03:14:44PM +0530, Anil Singhar wrote:> Hi All: > > We have some patches to port klibc to ArmV8. > > The first set of patches from Neil Williams fixes the build issues. > The second set of patches from Anil Singhar fixes functionalities.pleasse come up with a single patchset for the architecture as it is not merged, with signed-offs by both of you guys.> The following files have changed in the second set of patches > ------------------------------------------------------------------------------------------ > usr/include/arch/aarch64/klibc/archconfig.h > usr/include/arch/aarch64/klibc/archsetjmp.h > usr/include/arch/aarch64/klibc/archstat.h > usr/include/sys/stat.h > usr/include/unistd.h > usr/klibc/SYSCALLS.defok fine.> usr/klibc/arch/aarch64/Kbuild > usr/klibc/arch/aarch64/MCONFIG > usr/klibc/arch/aarch64/crt0.S > usr/klibc/arch/aarch64/link.c > usr/klibc/arch/aarch64/mknod.c > usr/klibc/arch/aarch64/select.c > usr/klibc/arch/aarch64/setjmp.S > usr/klibc/arch/aarch64/symlink.c > usr/klibc/arch/aarch64/syscall.S > usr/klibc/arch/aarch64/sysstub.ph > usr/klibc/arch/aarch64/vfork.SThis looks very fishy! No other arch bothers to do such a rework of those standard calls, what happens here? I do have slight sympathies for vfork, but symlink, link, mknod and select!?> usr/klibc/statfs.c > usr/klibc/tests/stat.cWhat has this todo with aarch64?> The above changes broadly include the following: > 1. start-up code in crt0.S > 2. wrapper to system calls as generated from sysstub.ph and error handling > in syscall.S > 3. corrections to some system call definitions such as symlinkat, mkdirat > etc. > 4. corrections to some data structure definitions such as stat etc. > 5. separate aarch64 specific definition for some syscalls such as fork, > vfork etc. > 6. fixes to setjmp and longjmp functions > > Manual testing as provided within the package has been done with all tests > passing. This includes the units tests available under usr/klibc/tests, > usr/utils, usr/dash and usr/gzip. For dash and gzip, only sanity testing > has been done. > > Automatic testing has been done using mksh with the following results: > Total failed: 5 (4 ignored) (1 unexpected) > Total passed: 431 > > The code is available at: > git clone git://git.linaro.org/people/anil.singhar/klibc-aarch64.git > > Comments are highly appreciated.You don't indicate if kinit boots? Thank you for the submission. -- maks
On Wed, 9 Oct 2013 15:51:32 +0200 maximilian attems <maks at stro.at> wrote:> On Wed, Oct 09, 2013 at 03:14:44PM +0530, Anil Singhar wrote: > > Hi All: > > > > We have some patches to port klibc to ArmV8. > > > > The first set of patches from Neil Williams fixes the build issues. > > The second set of patches from Anil Singhar fixes functionalities. > > pleasse come up with a single patchset for the architecture as it > is not merged, with signed-offs by both of you guys.Yes, we can do that. Do you prefer a patch to the mailing list or a git repo from which you can pull? Anil's git repo is the combined set of patches. I made some initial changes to get klibc to build for Aarch64, Anil started from that position and fixed that code to actually get it working.> > usr/klibc/arch/aarch64/Kbuild > > usr/klibc/arch/aarch64/MCONFIG > > usr/klibc/arch/aarch64/crt0.S > > usr/klibc/arch/aarch64/link.c > > usr/klibc/arch/aarch64/mknod.c > > usr/klibc/arch/aarch64/select.c > > usr/klibc/arch/aarch64/setjmp.S > > usr/klibc/arch/aarch64/symlink.c > > usr/klibc/arch/aarch64/syscall.S > > usr/klibc/arch/aarch64/sysstub.ph > > usr/klibc/arch/aarch64/vfork.S > > This looks very fishy! > No other arch bothers to do such a rework > of those standard calls, what happens here?ARM took the chance with a brand new architecture to drop a range of deprecated calls. As well as dropping a range of 32bit support (like Thumb), ARM took the opportunity of having a clean start without support for deprecated calls. e.g. one part of the patch is: -int _newselect,select::select(int, fd_set *, fd_set *, fd_set *, struct timeval *); +<!aarch64> int _newselect,select::select(int, fd_set *, fd_set *, fd_set *, struct timeval *); Others include: dup2, lchown32, chown32, stat64, lstat64, readlink, symlink, rmdir, mkdir, mknod ... There was a talk at FOSDEM 2013 which covered these changes. There is also documentation available from ARM, if you would like it. http://people.linaro.org/~rikuvoipio/aarch64-talk/#/ http://people.linaro.org/~rikuvoipio/aarch64-talk/#/18/1 http://people.linaro.org/~rikuvoipio/aarch64-talk/#/18/2 Anil & I are working with Riku (the author of that paper) in Linaro. (I'm using my debian.org email address because I started working on klibc support for Aarch64 before I started working at Linaro.)> I do have slight sympathies for vfork, but > symlink, link, mknod and select!?Yes. The system calls are already deprecated, so the new architecture simply doesn't implement what is already deprecated. pre-at system calls are also removed and calls like pipe have been removed in favour of only providing pipe2. etc. http://people.linaro.org/~rikuvoipio/aarch64-talk/#/18/3 -- Neil Williams ============http://www.linux.codehelp.co.uk/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://www.zytor.com/pipermail/klibc/attachments/20131009/89fba67f/attachment.sig>