[v4,01/11] nds32: Build Infastructure
Commit Message
This patch contains all needed Implies, configure and Makefile for nds32
port.
2019-06-03 Vincent Chen <vincentc@andestech.com>
2019-06-03 CheWei Chuang <cnoize@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 | 4 +++
sysdeps/nds32/Makefile | 12 +++++++++
sysdeps/nds32/configure | 10 ++++++++
sysdeps/nds32/configure.ac | 10 ++++++++
sysdeps/nds32/nofpu/Implies | 1 +
sysdeps/nds32/nptl/Makefile | 4 +++
sysdeps/nds32/preconfigure | 37 ++++++++++++++++++++++++++++
sysdeps/unix/sysv/linux/nds32/Implies | 3 +++
sysdeps/unix/sysv/linux/nds32/Makefile | 16 ++++++++++++
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 | 9 +++++++
13 files changed, 125 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
Comments
On Jun 05 2019, Vincent Chen <vincentc@andestech.com> wrote:
> 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 {
Since the base version is GLIBC_2.30, it doesn't make sense to reference
an earlier version.
Andreas.
On Wed, Jun 05, 2019 at 08:18:10PM +0800, Andreas Schwab wrote:
> On Jun 05 2019, Vincent Chen <vincentc@andestech.com> wrote:
>
> > 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 {
>
> Since the base version is GLIBC_2.30, it doesn't make sense to reference
> an earlier version.
>
I forget to update it. I will modify it in the next version patch.
Thanks for your reminder.
Regards,
Vincent
new file mode 100644
@@ -0,0 +1,4 @@
+init_array
+wordsize-32
+ieee754/dbl-64
+ieee754/flt-32
new file mode 100644
@@ -0,0 +1,12 @@
+
+long-double-fcts = no
+
+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
new file mode 100755
@@ -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"
new file mode 100644
@@ -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"
new file mode 100644
@@ -0,0 +1 @@
+ieee754/soft-fp
new file mode 100644
@@ -0,0 +1,4 @@
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
new file mode 100644
@@ -0,0 +1,37 @@
+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 | grep ^"#define __NDS32_ABI_2FP_PLUS__" | wc -l`
+ case "$float_abi_type" in
+ 0)
+ with_fp_cond=0
+ ;;
+ *)
+ flen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep ^"#define __NDS32_EXT_FPU_DP__" | wc -l`
+ case "$flen" in
+ 0)
+ echo "glibc does not yet support nds32 v3s extension" >&2
+ exit 1
+ ;;
+ 1)
+ float_abi_type=1
+ ;;
+ esac
+ esac
+
+ base_machine=nds32
+ machine=nds32
+
+ $as_echo "#define NDS32_ABI_TYPE 0x$float_abi_type$endian_abi_type" >>confdefs.h
+ ;;
+esac
new file mode 100644
@@ -0,0 +1,3 @@
+nds32/nptl
+unix/sysv/linux/generic/wordsize-32
+unix/sysv/linux/generic
new file mode 100644
@@ -0,0 +1,16 @@
+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
new file mode 100644
@@ -0,0 +1,11 @@
+ld {
+ GLIBC_PRIVATE {
+ # used for loading by static libraries
+ _dl_var_init;
+ }
+}
+libc {
+ GLIBC_2.28 {
+ cacheflush;
+ }
+}
new file mode 100755
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -0,0 +1,9 @@
+DEFAULT GLIBC_2.30
+
+%if NDS32_ABI_TYPE == 0
+ld=ld-linux-nds32le.so.1
+%elif NDS32_ABI_TYPE == 0x10
+ld=ld-linux-nds32lef.so.1
+%else
+%error cannot determine ABI
+%endif