public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Vincent Chen <vincentc@andestech.com>
To: <libc-alpha@sourceware.org>, <joseph@codesourcery.com>
Cc: <deanbo422@gmail.com>, <cnoize@andestech.com>,
	Vincent Chen <vincentc@andestech.com>
Subject: [PATCH v3 01/13] nds32: Build Infastructure
Date: Thu, 14 Jun 2018 07:23:00 -0000	[thread overview]
Message-ID: <1528960976-10934-2-git-send-email-vincentc@andestech.com> (raw)
In-Reply-To: <1528960976-10934-1-git-send-email-vincentc@andestech.com>

This patch contains all needed Implies, configure and Makefile for nds32
port.

2018-05-30  Vincent Chen  <vincentc@andestech.com>

        * sysdeps/nds32/Implies: New file.
        * sysdeps/nds32/Makefile: Likewise.
        * sysdeps/nds32/configure: Likewise.
        * sysdeps/nds32/configure.ac: Likewise.
        * sysdeps/nds32/nofpu/Implies: Likewise.
        * sysdeps/nds32/nptl/Makefile: Likewise.
        * sysdeps/nds32/preconfigure: Likewise.
        * sysdeps/unix/sysv/linux/nds32/Implies: Likewise.
        * sysdeps/unix/sysv/linux/nds32/Makefile: Likewise.
        * sysdeps/unix/sysv/linux/nds32/Versions: Likewise.
        * sysdeps/unix/sysv/linux/nds32/configure: Likewise.
        * sysdeps/unix/sysv/linux/nds32/configure.ac: Likewise.
        * sysdeps/unix/sysv/linux/nds32/shlib-versions: Likewise.
---
 sysdeps/nds32/Implies                        |  3 +++
 sysdeps/nds32/Makefile                       |  9 +++++++++
 sysdeps/nds32/configure                      | 10 ++++++++++
 sysdeps/nds32/configure.ac                   | 10 ++++++++++
 sysdeps/nds32/nofpu/Implies                  |  1 +
 sysdeps/nds32/nptl/Makefile                  |  4 ++++
 sysdeps/nds32/preconfigure                   | 30 ++++++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/nds32/Implies        |  3 +++
 sysdeps/unix/sysv/linux/nds32/Makefile       | 17 ++++++++++++++++
 sysdeps/unix/sysv/linux/nds32/Versions       | 11 ++++++++++
 sysdeps/unix/sysv/linux/nds32/configure      |  4 ++++
 sysdeps/unix/sysv/linux/nds32/configure.ac   |  4 ++++
 sysdeps/unix/sysv/linux/nds32/shlib-versions |  7 +++++++
 13 files changed, 113 insertions(+)
 create mode 100644 sysdeps/nds32/Implies
 create mode 100644 sysdeps/nds32/Makefile
 create mode 100755 sysdeps/nds32/configure
 create mode 100644 sysdeps/nds32/configure.ac
 create mode 100644 sysdeps/nds32/nofpu/Implies
 create mode 100644 sysdeps/nds32/nptl/Makefile
 create mode 100644 sysdeps/nds32/preconfigure
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Implies
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Versions
 create mode 100755 sysdeps/unix/sysv/linux/nds32/configure
 create mode 100644 sysdeps/unix/sysv/linux/nds32/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/nds32/shlib-versions

diff --git a/sysdeps/nds32/Implies b/sysdeps/nds32/Implies
new file mode 100644
index 0000000..387a0ca
--- /dev/null
+++ b/sysdeps/nds32/Implies
@@ -0,0 +1,3 @@
+wordsize-32
+ieee754/dbl-64
+ieee754/flt-32
diff --git a/sysdeps/nds32/Makefile b/sysdeps/nds32/Makefile
new file mode 100644
index 0000000..5651161
--- /dev/null
+++ b/sysdeps/nds32/Makefile
@@ -0,0 +1,9 @@
+ifeq ($(subdir),elf)
+sysdep-dl-routines += tlsdesc dl-tlsdesc
+sysdep_routines += tlsdesc dl-tlsdesc
+sysdep-rtld-routines += tlsdesc dl-tlsdesc
+endif
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tlsdesc.sym
+endif
diff --git a/sysdeps/nds32/configure b/sysdeps/nds32/configure
new file mode 100755
index 0000000..8ece006
--- /dev/null
+++ b/sysdeps/nds32/configure
@@ -0,0 +1,10 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/nds32.
+
+# For nds32 ABI for linux toolchain, the $r15 register is not only an
+# assembler reserved register but also used to passing the sysem call
+# number. In order to ensure the data safety, $r15 is included in
+# clobber list by default. Using the option -minline-asm-r15 can
+# avoid the conflict between asm-specifier for syscall number and
+# clobber list when issuing system call by inline assembly.
+CFLAGS="$CFLAGS -minline-asm-r15"
diff --git a/sysdeps/nds32/configure.ac b/sysdeps/nds32/configure.ac
new file mode 100644
index 0000000..c0e2494
--- /dev/null
+++ b/sysdeps/nds32/configure.ac
@@ -0,0 +1,10 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/nds32.
+
+# For nds32 ABI for linux toolchain, the $r15 register is not only an 
+# assembler reserved register but also used to passing the sysem call
+# number. In order to ensure the data safety, $r15 is included in
+# clobber list by default. Using the option -minline-asm-r15 can
+# avoid the conflict between asm-specifier for syscall number and
+# clobber list when issuing system call by inline assembly.
+CFLAGS="$CFLAGS -minline-asm-r15"
diff --git a/sysdeps/nds32/nofpu/Implies b/sysdeps/nds32/nofpu/Implies
new file mode 100644
index 0000000..abcbadb
--- /dev/null
+++ b/sysdeps/nds32/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/nds32/nptl/Makefile b/sysdeps/nds32/nptl/Makefile
new file mode 100644
index 0000000..6f553d6
--- /dev/null
+++ b/sysdeps/nds32/nptl/Makefile
@@ -0,0 +1,4 @@
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
diff --git a/sysdeps/nds32/preconfigure b/sysdeps/nds32/preconfigure
new file mode 100644
index 0000000..a5faf50
--- /dev/null
+++ b/sysdeps/nds32/preconfigure
@@ -0,0 +1,30 @@
+case "$machine" in
+nds32*)
+    endian_abi_type=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __NDS32_E\([B|L]*\)__ 1/\1/p'`
+    case "$endian_abi_type" in
+    L)
+       endian_abi_type=0
+       ;;
+    B)
+       echo "glibc does not yet support big-endian configuration" >&2
+       exit 1
+       ;;
+    esac
+
+    float_abi_type=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __NDS32_EXT_FPU_\([S|D]P*\) 1/\1/p' | wc -l`
+    case "$float_abi_type" in
+    0)
+       with_fp_cond=0
+       ;;
+    *)
+       echo "glibc does not yet support systems with FP instructions" >&2
+       exit 1
+       ;;
+    esac
+
+    base_machine=nds32
+    machine=nds32
+
+    $as_echo "#define NDS32_ABI_TYPE 0x$float_abi_type$endian_abi_type" >>confdefs.h
+    ;;
+esac
diff --git a/sysdeps/unix/sysv/linux/nds32/Implies b/sysdeps/unix/sysv/linux/nds32/Implies
new file mode 100644
index 0000000..91b4e1e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/Implies
@@ -0,0 +1,3 @@
+nds32/nptl
+unix/sysv/linux/generic/wordsize-32
+unix/sysv/linux/generic
diff --git a/sysdeps/unix/sysv/linux/nds32/Makefile b/sysdeps/unix/sysv/linux/nds32/Makefile
new file mode 100644
index 0000000..2709916
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/Makefile
@@ -0,0 +1,17 @@
+ifeq ($(subdir),misc)
+sysdep_headers += sys/cachectl.h
+sysdep_routines += cacheflush prctl mremap
+endif
+
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
+
+ifeq ($(subdir),elf)
+sysdep_routines += dl-vdso
+ifeq ($(build-shared),yes)
+# This is needed for DSO loading from static binaries.
+sysdep-dl-routines += dl-static
+endif
+endif
diff --git a/sysdeps/unix/sysv/linux/nds32/Versions b/sysdeps/unix/sysv/linux/nds32/Versions
new file mode 100644
index 0000000..abe47ce
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/Versions
@@ -0,0 +1,11 @@
+ld {
+  GLIBC_PRIVATE {
+  # used for loading by static libraries
+    _dl_var_init;
+  }
+}
+libc {
+  GLIBC_2.28 {
+    cacheflush;
+  }
+}
diff --git a/sysdeps/unix/sysv/linux/nds32/configure b/sysdeps/unix/sysv/linux/nds32/configure
new file mode 100755
index 0000000..ceb6c90
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/configure
@@ -0,0 +1,4 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/unix/sysv/linux/nds32.
+
+arch_minimum_kernel=4.17.0
diff --git a/sysdeps/unix/sysv/linux/nds32/configure.ac b/sysdeps/unix/sysv/linux/nds32/configure.ac
new file mode 100644
index 0000000..91bf889
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/configure.ac
@@ -0,0 +1,4 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/sysv/linux/nds32.
+
+arch_minimum_kernel=4.17.0
diff --git a/sysdeps/unix/sysv/linux/nds32/shlib-versions b/sysdeps/unix/sysv/linux/nds32/shlib-versions
new file mode 100644
index 0000000..a94d2a4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/shlib-versions
@@ -0,0 +1,7 @@
+DEFAULT			GLIBC_2.28
+
+%if NDS32_ABI_TYPE == 0
+ld=ld-linux-nds32le.so.1
+%else
+%error cannot determine ABI
+%endif
-- 
2.7.4

  parent reply	other threads:[~2018-06-14  7:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14  7:23 [PATCH v3 00/13] nds32 glibc port, v3 Vincent Chen
2018-06-14  7:23 ` [PATCH v3 03/13] nds32: Thread-Local Storage Support Vincent Chen
2018-06-14  7:23 ` [PATCH v3 02/13] nds32: ABI Implementation Vincent Chen
2018-06-14  7:23 ` Vincent Chen [this message]
2018-06-14 13:27   ` [PATCH v3 01/13] nds32: Build Infastructure Joseph Myers
2018-06-15  7:42     ` Vincent Chen
2018-06-14  7:24 ` [PATCH v3 04/13] nds32: Startup and Dynamic Loader Vincent Chen
2018-06-14  7:24 ` [PATCH v3 08/13] nds32: Linux ABI Vincent Chen
2018-09-13 12:06   ` Arnd Bergmann
2018-09-17  0:50     ` Vincent Chen
2018-06-14  7:24 ` [PATCH v3 06/13] nds32: Atomic and Locking Routines Vincent Chen
2018-06-14  7:24 ` [PATCH v3 05/13] nds32: Generic <math.h> and soft-fp Routines Vincent Chen
2018-06-14  7:24 ` [PATCH v3 07/13] nds32: Linux Syscall Interface Vincent Chen
2018-06-14 13:34   ` Joseph Myers
2018-06-15  7:47     ` Vincent Chen
2018-06-14  7:25 ` [PATCH v3 10/13] Skeleton documentation for the nds32 port Vincent Chen
2018-06-14  7:25 ` [PATCH v3 13/13] Add nds32 port to build-many-glibcs.py Vincent Chen
2018-06-14  7:49 ` [PATCH v3 09/13] nds32: Add ABI list Vincent Chen
2018-06-14  8:34   ` Andreas Schwab
2018-06-14  7:50 ` [PATCH v3 12/13] Add nds32 entries to config.h.in Vincent Chen
2018-06-14  7:50 ` [PATCH v3 11/13] Add Andes nds32 dynamic relocation type to elf/elf.h Vincent Chen

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=1528960976-10934-2-git-send-email-vincentc@andestech.com \
    --to=vincentc@andestech.com \
    --cc=cnoize@andestech.com \
    --cc=deanbo422@gmail.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).