Linux SNPS ARC Archive on lore.kernel.org
 help / color / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org, libc-alpha@sourceware.org
Subject: Re: [PATCH v4 02/15] ARC: ABI Implementation
Date: Thu, 26 Mar 2020 01:52:49 +0000
Message-ID: <alpine.DEB.2.21.2003260138130.31593@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20200313030419.15843-3-vgupta@synopsys.com>

On Thu, 12 Mar 2020, Vineet Gupta via Libc-alpha wrote:

> diff --git a/sysdeps/arc/bits/endianness.h b/sysdeps/arc/bits/endianness.h
> new file mode 100644
> index 000000000000..8f17ca84b485
> --- /dev/null
> +++ b/sysdeps/arc/bits/endianness.h
> @@ -0,0 +1,15 @@
> +#ifndef _BITS_ENDIANNESS_H
> +#define _BITS_ENDIANNESS_H 1
> +
> +#ifndef _BITS_ENDIAN_H
> +# error "Never use <bits/endian.h> directly; include <endian.h> instead."
> +#endif
> +
> +/* ARC has selectable endianness.  */
> +#ifdef __BIG_ENDIAN__
> +# define __BYTE_ORDER __BIG_ENDIAN
> +#else
> +# define __BYTE_ORDER __LITTLE_ENDIAN
> +#endif

Elsewhere you say the port is little-endian only.  In such cases we 
generally have an error somewhere if you attempt to build glibc for the 
other endianness, to avoid an other-endian configuration accidentally 
building but not working and having a broken ABI.  For example, see what 
Nios II does: sysdeps/nios2/bits/endianness.h handles both endiannesses, 
but sysdeps/nios2/configure.ac produces an error for big-endian.

> +/* PLT jump into resolver passes PC of PLTn, while _dl_fixup expects the
> +   address of corresponding .rela.plt entry.  */
> +
> +#ifdef __A7__
> +# define ARC_PLT_SIZE	12
> +#else
> +# define ARC_PLT_SIZE	16
> +#endif

Is this some sort of ABI difference between two incompatible ABIs?  (The 
ABI document you pointed to only seems to mention 12-byte PLT entries.)

> +#define reloc_index						\
> +({								\
> +  unsigned long int plt0 = D_PTR (l, l_info[DT_PLTGOT]);	\
> +  unsigned long int pltn = reloc_arg;				\
> +  /* Exclude PL0 and PLT1.  */					\

Should PL0 be PLT0 here?

> +  unsigned long int idx = (pltn - plt0)/ARC_PLT_SIZE - 2;	\

Missing spaces around '/'.

> diff --git a/sysdeps/arc/gmp-mparam.h b/sysdeps/arc/gmp-mparam.h
> new file mode 100644
> index 000000000000..5580551483c8
> --- /dev/null
> +++ b/sysdeps/arc/gmp-mparam.h
> @@ -0,0 +1,23 @@
> +/* gmp-mparam.h -- Compiler/machine parameter header file.
> +
> +Copyright (C) 2017-2020 Free Software Foundation, Inc.
> +
> +This file is part of the GNU MP Library.
> +
> +The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB.  If not, see
> +<https://www.gnu.org/licenses/>.  */
> +
> +#include <sysdeps/generic/gmp-mparam.h>
> +
> +#define IEEE_DOUBLE_BIG_ENDIAN 0

Plenty of architectures that have, or support, little-endian floating 
point do not have gmp-mparam.h at all.  IEEE_DOUBLE_BIG_ENDIAN is only 
used to define union ieee_double_extract, which is nowhere used in glibc.  
So I don't think you need this header at all (and it shows up the scope 
for a more general cleanup possible for other ports, I suspect only the 
x32 and mips64 versions of this header, the ones that define 
_LONG_LONG_LIMB for ILP32 configurations with 64-bit registers, are the 
only non-generic ones that do anything useful - but you don't need to do 
that cleanup).

-- 
Joseph S. Myers
joseph@codesourcery.com

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

  reply index

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13  3:04 [PATCH v4 00/15] glibc port to ARC processors Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 01/15] ARC: add definitions to elf/elf.h Vineet Gupta
2020-03-26  1:37   ` Joseph Myers
2020-03-26  1:52     ` Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 02/15] ARC: ABI Implementation Vineet Gupta
2020-03-26  1:52   ` Joseph Myers [this message]
2020-03-26  2:39     ` Vineet Gupta
2020-03-26 18:48       ` Joseph Myers
2020-03-27  0:37         ` Vineet Gupta
2020-03-27 23:33         ` Vineet Gupta
2020-03-27 23:35           ` Joseph Myers
2020-03-27 23:47             ` Vineet Gupta
2020-03-31 21:08         ` Big Endian support as multi-ABI (was Re: [PATCH v4 02/15] ARC: ABI Implementation) Vineet Gupta
2020-03-31 21:27           ` Joseph Myers
2020-03-31 21:35             ` Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 03/15] ARC: startup and dynamic linking code Vineet Gupta
2020-03-26  1:55   ` Joseph Myers
2020-03-26  2:45     ` Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 04/15] ARC: Thread Local Storage support Vineet Gupta
2020-03-26  1:57   ` Joseph Myers
2020-03-26  2:47     ` Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 05/15] ARC: Atomics and Locking primitives Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 06/15] ARC: math soft float support Vineet Gupta
2020-03-26  1:59   ` Joseph Myers
2020-03-26  2:48     ` Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 07/15] ARC: hardware floating point support Vineet Gupta
2020-03-26  2:06   ` Joseph Myers
2020-03-26  3:19     ` Vineet Gupta
2020-03-26 23:22   ` Joseph Myers
2020-03-27  1:50     ` Vineet Gupta
2020-03-27 18:37       ` Joseph Myers
2020-03-27 18:53         ` Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 08/15] ARC: Linux Syscall Interface Vineet Gupta
2020-03-26 23:52   ` Joseph Myers
2020-03-27  4:34     ` Vineet Gupta
2020-03-27 18:38       ` Joseph Myers
2020-03-13  3:04 ` [PATCH v4 09/15] ARC: Linux ABI Vineet Gupta
2020-03-27  0:38   ` Joseph Myers
2020-03-27  4:45     ` Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 10/15] ARC: Linux Startup and Dynamic Loading Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 11/15] ARC: ABI lists Vineet Gupta
2020-03-27  0:40   ` Joseph Myers
2020-03-27  4:36     ` Vineet Gupta
2020-03-27 18:39       ` Joseph Myers
2020-03-27 19:09         ` Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 12/15] ARC: Update syscall-names.list for ARC specific syscalls Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 13/15] ARC: Build Infrastructure Vineet Gupta
2020-03-27 22:47   ` Joseph Myers
2020-03-28  6:42     ` Vineet Gupta
2020-03-31 22:02       ` Vineet Gupta
2020-03-31 22:48         ` Joseph Myers
2020-04-01  0:44           ` __syscall_error (was Re: [PATCH v4 13/15] ARC: Build Infrastructure) Vineet Gupta
2020-04-01  7:58             ` Andreas Schwab
2020-04-01 21:38               ` Vineet Gupta
2020-04-01 17:06             ` Joseph Myers
2020-04-02  0:00               ` Vineet Gupta
2020-04-02  8:50               ` Florian Weimer
2020-04-02 20:22                 ` Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 14/15] build-many-glibcs.py: Enable ARC builds Vineet Gupta
2020-03-13  3:04 ` [PATCH v4 15/15] Documentation for ARC port Vineet Gupta
2020-03-27 22:49   ` Joseph Myers
2020-03-27 23:56     ` Vineet Gupta
2020-03-28  0:01       ` Joseph Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.2003260138130.31593@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-snps-arc@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux SNPS ARC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-snps-arc/0 linux-snps-arc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-snps-arc linux-snps-arc/ https://lore.kernel.org/linux-snps-arc \
		linux-snps-arc@lists.infradead.org
	public-inbox-index linux-snps-arc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-snps-arc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git