From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4D4631F55B for ; Fri, 22 May 2020 22:00:05 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 77DD7383F853; Fri, 22 May 2020 22:00:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77DD7383F853 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1590184803; bh=C9n0FvqjSP5T7ulXfM85Lod6ldGmTYvIUDWGCp6Y5zM=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=jcqkYDHvOycxrGd6e0RxuDe2Y/8Yn9r9cIZgAo2hHfazfCc9xJtj8fcnflt8lJrnq ho2SnyL1JXic+JZpbo6sDSVUvnQT6JqsPmw4NsfnqKffsMbE9KhsirBt8ndknzwIV2 nJ3zdpNjStEtXOC9ODaasRLiQSZBwIe1uP3iUC6w= Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id DF9BE383F843 for ; Fri, 22 May 2020 21:59:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DF9BE383F843 Received: by mail-pj1-x1029.google.com with SMTP id l73so2551509pjb.1 for ; Fri, 22 May 2020 14:59:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=C9n0FvqjSP5T7ulXfM85Lod6ldGmTYvIUDWGCp6Y5zM=; b=bTFfOq3dQCaM+nMsumqKn5l8RD2sCQ0M927miJKJLtq23fw0M+wXVIrKfk8qQTC2G3 Rhr7tKFncm8Zi7sTeoq9CPKGrYzV746QiWDDgYh7RPb+/AJHFMksv3tG8WDTOwAlQaNJ GzExPBlgzgbqm9QCoxXA3v6U3T6c16ciixgEPztIspzmLZz8VjPvN8W99wV7Z+1TmKBH doKUQZKhyBOeJ0WjLUIEOeRlKNC2u2g8zw5fSdHkF5CrkWFDnNhGXfrNUSRVjCNmJOQr 6MOQqcB4PQ4ITxr6Uvvf2k6rjZmz5C3omHMidX5+UwPsPhyhOtfY5S2fkbCOLWDzUaHV 1geA== X-Gm-Message-State: AOAM532pdo1pghr4h74c3VlVBE+XsIkzvMSfJEexzxZA0RDHF+qAbA8O PuZQGwpZqLucapE4wfdXY/A= X-Google-Smtp-Source: ABdhPJy5CIpIK88P7ktIBEGceYubkkDng+99/dzfqNNxJLS+uCUYCC0leCAw0Ud3oZqrOMsVhqVXSg== X-Received: by 2002:a17:90b:1081:: with SMTP id gj1mr6867274pjb.6.1590184797683; Fri, 22 May 2020 14:59:57 -0700 (PDT) Received: from localhost (g228.115-65-196.ppp.wakwak.ne.jp. [115.65.196.228]) by smtp.gmail.com with ESMTPSA id z20sm6220056pjn.53.2020.05.22.14.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 14:59:56 -0700 (PDT) Date: Sat, 23 May 2020 06:59:53 +0900 To: Florian Weimer Subject: Re: [PATCH 1/1] Initial support for OpenRISC Message-ID: <20200522215953.GC75760@lianli.shorne-pla.net> References: <20200522113633.209664-1-shorne@gmail.com> <20200522113633.209664-2-shorne@gmail.com> <87eerc3z7b.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87eerc3z7b.fsf@oldenburg2.str.redhat.com> X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Stafford Horne via Libc-alpha Reply-To: Stafford Horne Cc: Openrisc , Stafford Horne via Libc-alpha , Christian Svensson Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Hi Florian, Thanks for the review. On Fri, May 22, 2020 at 02:56:40PM +0200, Florian Weimer wrote: > * Stafford Horne via Libc-alpha: > > > diff --git a/elf/elf.h b/elf/elf.h > > index 51e9968405..1e8a8e74c4 100644 > > --- a/elf/elf.h > > +++ b/elf/elf.h > > @@ -4096,6 +4096,43 @@ enum > > #define R_ARC_TLS_LE_S9 0x4a > > #define R_ARC_TLS_LE_32 0x4b > > > > +/* OpenRISC 1000 specific relocs. */ > > +#define R_OR1K_NONE 0 > > +#define R_OR1K_32 1 > > +#define R_OR1K_16 2 > > +#define R_OR1K_8 3 > > +#define R_OR1K_LO_16_IN_INSN 4 > > +#define R_OR1K_HI_16_IN_INSN 5 > > +#define R_OR1K_INSN_REL_26 6 > > +#define R_OR1K_GNU_VTENTRY 7 > > +#define R_OR1K_GNU_VTINHERIT 8 > > +#define R_OR1K_32_PCREL 9 > > +#define R_OR1K_16_PCREL 10 > > +#define R_OR1K_8_PCREL 11 > > +#define R_OR1K_GOTPC_HI16 12 > > +#define R_OR1K_GOTPC_LO16 13 > > +#define R_OR1K_GOT16 14 > > +#define R_OR1K_PLT26 15 > > +#define R_OR1K_GOTOFF_HI16 16 > > +#define R_OR1K_GOTOFF_LO16 17 > > +#define R_OR1K_COPY 18 > > +#define R_OR1K_GLOB_DAT 19 > > +#define R_OR1K_JMP_SLOT 20 > > +#define R_OR1K_RELATIVE 21 > > +#define R_OR1K_TLS_GD_HI16 22 > > +#define R_OR1K_TLS_GD_LO16 23 > > +#define R_OR1K_TLS_LDM_HI16 24 > > +#define R_OR1K_TLS_LDM_LO16 25 > > +#define R_OR1K_TLS_LDO_HI16 26 > > +#define R_OR1K_TLS_LDO_LO16 27 > > +#define R_OR1K_TLS_IE_HI16 28 > > +#define R_OR1K_TLS_IE_LO16 29 > > +#define R_OR1K_TLS_LE_HI16 30 > > +#define R_OR1K_TLS_LE_LO16 31 > > +#define R_OR1K_TLS_TPOFF 32 > > +#define R_OR1K_TLS_DTPOFF 33 > > +#define R_OR1K_TLS_DTPMOD 34 > > + > > __END_DECLS > > Please post this separately, it can be reviewed and go in before the > actual port goes in. OK, I will split it out. > > diff --git a/sysdeps/or1k/Implies b/sysdeps/or1k/Implies > > new file mode 100644 > > index 0000000000..ff699c7dd5 > > --- /dev/null > > +++ b/sysdeps/or1k/Implies > > @@ -0,0 +1,4 @@ > > +init_array > > +wordsize-32 > > +ieee754/dbl-64 > > +ieee754/flt-32 > > The init_array subdirectory does not exist anymore. OK. I missed this I started forward porting this old port around 2019 November and must have missed that this was removed. > > diff --git a/sysdeps/or1k/bits/endianness.h b/sysdeps/or1k/bits/endianness.h > > new file mode 100644 > > index 0000000000..96fd5ae5ef > > --- /dev/null > > +++ b/sysdeps/or1k/bits/endianness.h > > @@ -0,0 +1,11 @@ > > +#ifndef _BITS_ENDIANNESS_H > > +#define _BITS_ENDIANNESS_H 1 > > + > > +#ifndef _BITS_ENDIAN_H > > +# error "Never use directly; include instead." > > +#endif > > + > > +/* HP-PA is big-endian. */ > > +#define __BYTE_ORDER __BIG_ENDIAN > > + > > +#endif /* bits/endianness.h */ > > HP-PA? OK. Copy paste, during forward porting I thought I removed a lot of these, I will clean it up and grep for similar patterns. > > diff --git a/sysdeps/or1k/bits/setjmp.h b/sysdeps/or1k/bits/setjmp.h > > new file mode 100644 > > index 0000000000..dd07fce68c > > --- /dev/null > > +++ b/sysdeps/or1k/bits/setjmp.h > > @@ -0,0 +1,36 @@ > > +/* Define the machine-dependent type `jmp_buf'. OpenRISC version. > > + Copyright (C) 2020 Free Software Foundation, Inc. > > + This file is part of the GNU C Library. > > + > > + The GNU C Library is free software; you can redistribute it and/or > > + modify it under the terms of the GNU Lesser General Public > > + License as published by the Free Software Foundation; either > > + version 2.1 of the License, or (at your option) any later version. > > + > > + The GNU C Library is distributed in the hope that it will be useful, > > + but WITHOUT ANY WARRANTY; without even the implied warranty of > > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > > + Lesser General Public License for more details. > > + > > + You should have received a copy of the GNU Lesser General Public > > + License along with the GNU C Library; if not, write to the Free > > + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA > > + 02111-1307 USA. */ > > + > > + > > +#ifndef _OR1K_BITS_SETJMP_H > > +#define _OR1K_BITS_SETJMP_H 1 > > + > > +#if !defined _SETJMP_H && !defined _PTHREAD_H > > +# error "Never include directly; use instead." > > +#endif > > + > > +#if defined __USE_MISC || defined _ASM > > +# define JB_SP 0 /* GPR1 */ > > +#endif > > It's odd to define this in an installed header. I think it's unused > anyway. Looks like yet another hppa remnant. Yes, I'll revisit this file. > > diff --git a/sysdeps/or1k/dl-machine.h b/sysdeps/or1k/dl-machine.h > > new file mode 100644 > > index 0000000000..0bcdc9888c > > --- /dev/null > > +++ b/sysdeps/or1k/dl-machine.h > > @@ -0,0 +1,339 @@ > > > +auto inline void > > +__attribute ((always_inline)) > > +elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, > > + const Elf32_Sym *sym, const struct r_found_version *version, > > + void *const reloc_addr_arg, int skip_ifunc) > > +{ > > + Elf32_Addr *const reloc_addr = reloc_addr_arg; > > + const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); > > + > > + if (__builtin_expect (r_type == R_OR1K_NONE, 0)) > > + return; > > Please use __glibc_likely and __glibc_unlikely. OK, I didn't know about those. Now I do. > > + case R_OR1K_32: > > + { > > + /* Handle mis-aligned offsets */ > > + struct unaligned > > + { > > + Elf32_Addr x; > > + } __attribute__ ((packed, may_alias)); > > + > > + /* Support relocations on mis-aligned offsets. */ > > + ((struct unaligned *) reloc_addr)->x = value + reloc->r_addend; > > + break; > > Would it be clearer to use memcpy here? The generated code is likely > the same. Yes, it should be, I will test it out. > > + default: > > + _dl_fatal_printf("Unhandled reloc: %u\n", r_type); > > + _dl_reloc_bad_type (map, r_type, 0); > > + break; > > _dl_reloc_bad_type is unreachable here. OK. > > +auto inline void > > +__attribute__ ((always_inline)) > > +elf_machine_lazy_rel (struct link_map *map, > > + Elf32_Addr l_addr, const Elf32_Rela *reloc, > > + int skip_ifunc) > > +{ > > + Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset); > > + const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); > > + > > + if (__builtin_expect (r_type == R_OR1K_JMP_SLOT, 1)) > > + *reloc_addr += l_addr; > > + else if (__builtin_expect (r_type == R_OR1K_NONE, 0)) > > + return; > > + else > > + { > > + _dl_fatal_printf("Unhandled lazy reloc: %u\n", r_type); > > + _dl_reloc_bad_type (map, r_type, 1); > > + } > > Likewise. OK. > > diff --git a/sysdeps/or1k/dl-start.S b/sysdeps/or1k/dl-start.S > > new file mode 100644 > > index 0000000000..95cb0f2396 > > --- /dev/null > > +++ b/sysdeps/or1k/dl-start.S > > > @@ -0,0 +1,101 @@ > > + /* Load termination function address. > > + Pass this in r9 to the _start function. > > + start.S will then pass this to __libc_start_main. */ > > + l.lwz r9, got(_dl_fini)(r16) > > The fini argument to __libc_start_main is unused, so this shouldn't be > necessary. OK. I'll look for where this came from and remove it needed. > > diff --git a/sysdeps/or1k/memusage.h b/sysdeps/or1k/memusage.h > > new file mode 100644 > > index 0000000000..cdd33c1b7c > > --- /dev/null > > +++ b/sysdeps/or1k/memusage.h > > > +#define GETSP() ({ register uintptr_t stack_ptr asm ("r1"); stack_ptr; }) > > I think it's more future-proof to use the appropriate compiler builtin. Right, will do. > > diff --git a/sysdeps/or1k/start.S b/sysdeps/or1k/start.S > > new file mode 100644 > > index 0000000000..339e0ddcc2 > > --- /dev/null > > +++ b/sysdeps/or1k/start.S > > @@ -0,0 +1,116 @@ > > > + /* rtld_fini = the dynamic fini address. > > + This is set by dl-start.S or just plain NULL if called directly. */ > > + l.ori r8, r9, 0 > > I think this is outdated, see above. OK. > > diff --git a/sysdeps/unix/sysv/linux/or1k/clone.c b/sysdeps/unix/sysv/linux/or1k/clone.c > > new file mode 100644 > > index 0000000000..f9dc4d2106 > > --- /dev/null > > +++ b/sysdeps/unix/sysv/linux/or1k/clone.c > > @@ -0,0 +1,59 @@ > > +/* Copyright (C) 2020 Free Software Foundation, Inc. > > + This file is part of the GNU C Library. > > + > > + The GNU C Library is free software; you can redistribute it and/or > > + modify it under the terms of the GNU Lesser General Public > > + License as published by the Free Software Foundation; either > > + version 2.1 of the License, or (at your option) any later version. > > + > > + The GNU C Library is distributed in the hope that it will be useful, > > + but WITHOUT ANY WARRANTY; without even the implied warranty of > > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > > + Lesser General Public License for more details. > > + > > + You should have received a copy of the GNU Lesser General Public > > + License along with the GNU C Library; if not, see > > + . */ > > + > > +#include > > +#include > > + > > +extern int __or1k_clone (int (*fn)(void *), void *child_stack, > > + int flags, void *arg, pid_t *ptid, > > + void *tls, pid_t *ctid); > > + > > + > > +/* or1k ABI uses stack for varargs, syscall uses registers. > > + * This function moves from varargs to regs. */ > > +int > > +__clone (int (*fn)(void *), void *child_stack, > > + int flags, void *arg, ... > > + /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ ) > > +{ > > + void *ptid; > > + void *tls; > > + void *ctid; > > + va_list ap; > > + int err; > > + > > + va_start (ap, arg); > > + ptid = va_arg (ap, void *); > > + tls = va_arg (ap, void *); > > + ctid = va_arg (ap, void *); > > + va_end (ap); > > + > > + /* Sanity check the arguments */ > > + err = -EINVAL; > > + if (!fn) > > + goto syscall_error; > > + if (!child_stack) > > + goto syscall_error; > > + > > + return __or1k_clone (fn, child_stack, flags, arg, ptid, tls, ctid); > > + > > +syscall_error: > > + __set_errno (-err); > > + return -1; > > +} > > Would it be possible to make the __clone function not varargs? Or is > this too big a portability hazard? That would mean overriding the definition in sched.h? This is the approach we used in other libc ports. > > diff --git a/sysdeps/unix/sysv/linux/or1k/lowlevellock.h b/sysdeps/unix/sysv/linux/or1k/lowlevellock.h > > new file mode 100644 > > index 0000000000..1ab277ad19 > > --- /dev/null > > +++ b/sysdeps/unix/sysv/linux/or1k/lowlevellock.h > > @@ -0,0 +1,23 @@ > > +/* Copyright (C) 2020 Free Software Foundation, Inc. > > + This file is part of the GNU C Library. > > + > > + The GNU C Library is free software; you can redistribute it and/or > > + modify it under the terms of the GNU Lesser General Public > > + License as published by the Free Software Foundation; either > > + version 2.1 of the License, or (at your option) any later version. > > + > > + The GNU C Library is distributed in the hope that it will be useful, > > + but WITHOUT ANY WARRANTY; without even the implied warranty of > > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > > + Lesser General Public License for more details. > > + > > + You should have received a copy of the GNU Lesser General Public > > + License along with the GNU C Library. If not, see > > + . */ > > + > > +#ifndef _OR1K_LOWLEVELLOCK_H > > +#define _OR1K_LOWLEVELLOCK_H 1 > > + > > +#include > > + > > +#endif /* lowlevellock.h */ > > Is this really necessary? Doesn't the search path take care of that? I think not, I must have added this before I understood about the search path. > > diff --git a/sysdeps/unix/sysv/linux/or1k/mmap_internal.h b/sysdeps/unix/sysv/linux/or1k/mmap_internal.h > > new file mode 100644 > > index 0000000000..79cefe667b > > --- /dev/null > > +++ b/sysdeps/unix/sysv/linux/or1k/mmap_internal.h > > @@ -0,0 +1,29 @@ > > +/* Common mmap definition for Linux implementation. OpenRISC version. > > + Copyright (C) 2020 Free Software Foundation, Inc. > > + This file is part of the GNU C Library. > > + > > + The GNU C Library is free software; you can redistribute it and/or > > + modify it under the terms of the GNU Lesser General Public > > + License as published by the Free Software Foundation; either > > + version 2.1 of the License, or (at your option) any later version. > > + > > + The GNU C Library is distributed in the hope that it will be useful, > > + but WITHOUT ANY WARRANTY; without even the implied warranty of > > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > > + Lesser General Public License for more details. > > + > > + You should have received a copy of the GNU Lesser General Public > > + License along with the GNU C Library; if not, see > > + . */ > > + > > +#ifndef MMAP_OR1K_INTERNAL_LINUX_H > > +#define MMAP_OR1K_INTERNAL_LINUX_H > > + > > +/* Linux allows PAGE_SHIFT in range of [12-16] and expect > > + mmap2 offset to be provided in based on the configured pagesize. > > + Determine the shift dynamically with getpagesize. */ > > +#define MMAP2_PAGE_UNIT -1 > > + > > +#include_next > > + > > +#endif > > Does OpenRISC really have a dynamic page size? > > I do not see any of the required support code for this. Its not dynamic, but the issue I was fixing here was to allow getting the page size from the kernel. The default 4K value was causing issues with clone if I remember. Let me test this again. > > diff --git a/sysdeps/unix/sysv/linux/or1k/prctl.c b/sysdeps/unix/sysv/linux/or1k/prctl.c > > new file mode 100644 > > index 0000000000..fc7e823974 > > --- /dev/null > > +++ b/sysdeps/unix/sysv/linux/or1k/prctl.c > > +/* or1k ABI uses stack for varargs, syscall uses registers. > > + * This function moves from varargs to regs. */ > > +int > > +__prctl (int __option, ...) > > +{ > > + va_list ap; > > + unsigned long arg2; > > + unsigned long arg3; > > + unsigned long arg4; > > + unsigned long arg5; > > + > > + va_start (ap, __option); > > + arg2 = va_arg (ap, unsigned long); > > + arg3 = va_arg (ap, unsigned long); > > + arg4 = va_arg (ap, unsigned long); > > + arg5 = va_arg (ap, unsigned long); > > + va_end (ap); > > + > > + return INLINE_SYSCALL (prctl, 5, __option, arg2, arg3, arg4, arg5); > > +} > > +weak_alias (__prctl, prctl) > > This should use unsigned long int. OK. > > diff --git a/sysdeps/unix/sysv/linux/or1k/pt-vfork.c b/sysdeps/unix/sysv/linux/or1k/pt-vfork.c > > new file mode 100644 > > index 0000000000..0169ec4f60 > > --- /dev/null > > +++ b/sysdeps/unix/sysv/linux/or1k/pt-vfork.c > > @@ -0,0 +1,30 @@ > > +/* Copyright (C) 2020 Free Software Foundation, Inc. > > + This file is part of the GNU C Library. > > + > > + The GNU C Library is free software; you can redistribute it and/or > > + modify it under the terms of the GNU Lesser General Public > > + License as published by the Free Software Foundation; either > > + version 2.1 of the License, or (at your option) any later version. > > + > > + The GNU C Library is distributed in the hope that it will be useful, > > + but WITHOUT ANY WARRANTY; without even the implied warranty of > > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > > + Lesser General Public License for more details. > > + > > + You should have received a copy of the GNU Lesser General Public > > + License along with the GNU C Library; if not, see > > + . */ > > + > > +#include > > +#include > > + > > +/* If we don't have vfork, fork is close enough. */ > > This is no longer true for our posix_spawn implementation. > > But this file should be unused anyway. Can you remove it? OK. > > diff --git a/sysdeps/unix/sysv/linux/or1k/syscall.c b/sysdeps/unix/sysv/linux/or1k/syscall.c > > new file mode 100644 > > index 0000000000..6d491bb4b5 > > --- /dev/null > > +++ b/sysdeps/unix/sysv/linux/or1k/syscall.c > > @@ -0,0 +1,45 @@ > > > +long int > > +syscall (long int syscall_number, ...) > > +{ > > + unsigned long arg1, arg2, arg3, arg4, arg5, arg6; > > + va_list arg; > > + long int ret; > > + > > + va_start (arg, syscall_number); > > + arg1 = va_arg (arg, unsigned long); > > + arg2 = va_arg (arg, unsigned long); > > + arg3 = va_arg (arg, unsigned long); > > + arg4 = va_arg (arg, unsigned long); > > + arg5 = va_arg (arg, unsigned long); > > + arg6 = va_arg (arg, unsigned long); > > + va_end (arg); > > + > > + ret = INTERNAL_SYSCALL_NCS (syscall_number, 6, arg1, arg2, arg3, arg4, > > + arg5, arg6); > > + > > + if (INTERNAL_SYSCALL_ERROR_P (ret)) > > + return __syscall_error (ret); > > + > > + return ret; > > +} > > Likewise, this should use unsigned long int. I suspect you can use > INTERNAL_SYSCALL_CALL directly, too. OK. > > diff --git a/sysdeps/unix/sysv/linux/or1k/sysdep.c b/sysdeps/unix/sysv/linux/or1k/sysdep.c > > new file mode 100644 > > index 0000000000..3b681e14aa > > --- /dev/null > > +++ b/sysdeps/unix/sysv/linux/or1k/sysdep.c > > > +long __syscall_error (long err); > > +hidden_proto (__syscall_error) > > + > > +/* This routine is jumped to by all the syscall handlers, to stash > > + an error number into errno. */ > > +long > > +__syscall_error (long err) > > +{ > > + __set_errno (- err); > > + return -1; > > +} > > +hidden_def (__syscall_error) > > Should use long int throughout. Also applies to sysdep.h below. OK. I will update. > > diff --git a/sysdeps/unix/sysv/linux/syscall-names.list b/sysdeps/unix/sysv/linux/syscall-names.list > > index 21a62a06f4..fa434fd477 100644 > > --- a/sysdeps/unix/sysv/linux/syscall-names.list > > +++ b/sysdeps/unix/sysv/linux/syscall-names.list > > @@ -296,6 +296,7 @@ open_by_handle_at > > open_tree > > openat > > openat2 > > +or1k_atomic > > osf_adjtime > > osf_afs_syscall > > osf_alt_plock > > Please post this separately, it can go in immediately. OK, I will split it out. > This is not a complete review; I can't comment on the > architecture-specific bits, the atomics, and the math interfaces. > > There are a few TODOs/TO-DOs left, please have a look. OK, I will look, must have missed them. > You also need to document which ABIs are supported (in INSTALL, with a > brief entry in NEWS). Are any specific GCC and binutils version > requirements, or kernel header requirements (beyond the already > documented minimums)? OK. For binutils and gcc require patches which are mentioned in the cover letter. I will document. > I see a bunch of ifdef's for hard float, but this appears to be a > hard-float-only port. I should support both hard fliat and soft float, but have not tested soft float yet. Let me test to see what would break. Thanks for the review, I am happy that I can remove a lot of code and clean up the port even more. I am also happy that a lot of the upstream glibc work has been going on to move arch specific parts to generic code, I think you are making great progress. -Stafford