Patchwork [RFC,V2,08/10] C-SKY: Build Infastructure

login
register
mail settings
Submitter Han Mao
Date April 8, 2018, 7:02 a.m.
Message ID <72254e2f0ac4f7abb71d6cf3e1c0ac6b5ea4cbef.1523169833.git.han_mao@c-sky.com>
Download mbox | patch
Permalink /patch/26649/
State New
Headers show

Comments

Han Mao - April 8, 2018, 7:02 a.m.
This patch contains all the implile, makefile and configure needed in
C-SKY porting.

        * scripts/config.sub: Add C-SKY arch
        * sysdeps/csky/Implies: New file
        * sysdeps/csky/Makefile: New file
        * sysdeps/csky/configure: New file
        * sysdeps/csky/configure.ac: New file
        * sysdeps/csky/tst-audit.h: New file
        * sysdeps/csky/nptl/Makefile: New file
        * sysdeps/csky/preconfigure: New file
        * sysdeps/unix/sysv/linux/csky/configure: New file
        * sysdeps/unix/sysv/linux/csky/configure.ac: New file
        * sysdeps/unix/sysv/linux/csky/Implies: New file
        * sysdeps/unix/sysv/linux/csky/Makefile: New file
---
 scripts/config.sub                        |  4 ++--
 sysdeps/csky/Implies                      |  4 ++++
 sysdeps/csky/Makefile                     | 13 +++++++++++++
 sysdeps/csky/configure                    |  4 ++++
 sysdeps/csky/configure.ac                 |  4 ++++
 sysdeps/csky/nptl/Makefile                | 20 ++++++++++++++++++++
 sysdeps/csky/preconfigure                 |  4 ++++
 sysdeps/csky/tst-audit.h                  | 23 +++++++++++++++++++++++
 sysdeps/unix/sysv/linux/csky/Implies      |  4 ++++
 sysdeps/unix/sysv/linux/csky/Makefile     | 26 ++++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/csky/configure    |  5 +++++
 sysdeps/unix/sysv/linux/csky/configure.ac |  6 ++++++
 12 files changed, 115 insertions(+), 2 deletions(-)
 create mode 100644 sysdeps/csky/Implies
 create mode 100644 sysdeps/csky/Makefile
 create mode 100644 sysdeps/csky/configure
 create mode 100644 sysdeps/csky/configure.ac
 create mode 100644 sysdeps/csky/nptl/Makefile
 create mode 100644 sysdeps/csky/preconfigure
 create mode 100644 sysdeps/csky/tst-audit.h
 create mode 100644 sysdeps/unix/sysv/linux/csky/Implies
 create mode 100644 sysdeps/unix/sysv/linux/csky/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/csky/configure
 create mode 100644 sysdeps/unix/sysv/linux/csky/configure.ac
Andreas Schwab - April 8, 2018, 7:40 a.m.
On Apr 08 2018, Mao Han <han_mao@c-sky.com> wrote:

> diff --git a/scripts/config.sub b/scripts/config.sub
> index f2632cd..9550e57 100755
> --- a/scripts/config.sub
> +++ b/scripts/config.sub
> @@ -254,7 +254,7 @@ case $basic_machine in
>  	| ba \
>  	| be32 | be64 \
>  	| bfin \
> -	| c4x | c8051 | clipper \
> +	| c4x | c8051 | clipper | csky \
>  	| d10v | d30v | dlx | dsp16xx \
>  	| e2k | epiphany \
>  	| fido | fr30 | frv | ft32 \
> @@ -378,7 +378,7 @@ case $basic_machine in
>  	| be32-* | be64-* \
>  	| bfin-* | bs2000-* \
>  	| c[123]* | c30-* | [cjt]90-* | c4x-* \
> -	| c8051-* | clipper-* | craynv-* | cydra-* \
> +	| c8051-* | clipper-* | craynv-* | csky-* | cydra-* \
>  	| d10v-* | d30v-* | dlx-* \
>  	| e2k-* | elxsi-* \
>  	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \

Please submit this to <config-patches@gnu.org>.  The latest version of
the file will then be imported here.

Andreas.
Han Mao - April 16, 2018, 5:59 a.m.
On Sun, Apr 08, 2018 at 09:40:58AM +0200, Andreas Schwab wrote:
> > diff --git a/scripts/config.sub b/scripts/config.sub
> > index f2632cd..9550e57 100755
> > --- a/scripts/config.sub
> > +++ b/scripts/config.sub
> > @@ -254,7 +254,7 @@ case $basic_machine in
> >  	| ba \
> >  	| be32 | be64 \
> >  	| bfin \
> > -	| c4x | c8051 | clipper \
> > +	| c4x | c8051 | clipper | csky \
> >  	| d10v | d30v | dlx | dsp16xx \
> >  	| e2k | epiphany \
> >  	| fido | fr30 | frv | ft32 \
> > @@ -378,7 +378,7 @@ case $basic_machine in
> >  	| be32-* | be64-* \
> >  	| bfin-* | bs2000-* \
> >  	| c[123]* | c30-* | [cjt]90-* | c4x-* \
> > -	| c8051-* | clipper-* | craynv-* | cydra-* \
> > +	| c8051-* | clipper-* | craynv-* | csky-* | cydra-* \
> >  	| d10v-* | d30v-* | dlx-* \
> >  	| e2k-* | elxsi-* \
> >  	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
> 
> Please submit this to <config-patches@gnu.org>.  The latest version of
> the file will then be imported here.
> 
> Andreas.
Thanks for the suggestion. I've send the patch to config-patches@gnu.org, 
and will remove the modification in this patchset.
 
Best Regards
Mao Han
Joseph Myers - April 17, 2018, 8:54 p.m.
On Sun, 8 Apr 2018, Mao Han wrote:

> diff --git a/sysdeps/csky/configure.ac b/sysdeps/csky/configure.ac
> new file mode 100644
> index 0000000..34f62d4
> --- /dev/null
> +++ b/sysdeps/csky/configure.ac
> @@ -0,0 +1,4 @@
> +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
> +# Local configure fragment for sysdeps/riscv/elf.

This certainly isn't riscv (and there haven't been elf/ sysdeps 
directories for many years).

Patch

diff --git a/scripts/config.sub b/scripts/config.sub
index f2632cd..9550e57 100755
--- a/scripts/config.sub
+++ b/scripts/config.sub
@@ -254,7 +254,7 @@  case $basic_machine in
 	| ba \
 	| be32 | be64 \
 	| bfin \
-	| c4x | c8051 | clipper \
+	| c4x | c8051 | clipper | csky \
 	| d10v | d30v | dlx | dsp16xx \
 	| e2k | epiphany \
 	| fido | fr30 | frv | ft32 \
@@ -378,7 +378,7 @@  case $basic_machine in
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| c8051-* | clipper-* | craynv-* | cydra-* \
+	| c8051-* | clipper-* | craynv-* | csky-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| e2k-* | elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
diff --git a/sysdeps/csky/Implies b/sysdeps/csky/Implies
new file mode 100644
index 0000000..781a016
--- /dev/null
+++ b/sysdeps/csky/Implies
@@ -0,0 +1,4 @@ 
+wordsize-32
+# CSKY uses IEEE 754 floating point.
+ieee754/flt-32
+ieee754/dbl-64
diff --git a/sysdeps/csky/Makefile b/sysdeps/csky/Makefile
new file mode 100644
index 0000000..4fa84bc
--- /dev/null
+++ b/sysdeps/csky/Makefile
@@ -0,0 +1,13 @@ 
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
+
+ifeq ($(subdir),debug)
+CFLAGS-backtrace.c += -funwind-tables
+endif
+
+ASFLAGS-.os += $(pic-ccflag)
+
+ifeq ($(subdir),gmon)
+sysdep_routines += csky-mcount
+endif
diff --git a/sysdeps/csky/configure b/sysdeps/csky/configure
new file mode 100644
index 0000000..53f5f1b
--- /dev/null
+++ b/sysdeps/csky/configure
@@ -0,0 +1,4 @@ 
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/riscv/elf.
+
+$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
diff --git a/sysdeps/csky/configure.ac b/sysdeps/csky/configure.ac
new file mode 100644
index 0000000..34f62d4
--- /dev/null
+++ b/sysdeps/csky/configure.ac
@@ -0,0 +1,4 @@ 
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/riscv/elf.
+
+AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/sysdeps/csky/nptl/Makefile b/sysdeps/csky/nptl/Makefile
new file mode 100644
index 0000000..a80a979
--- /dev/null
+++ b/sysdeps/csky/nptl/Makefile
@@ -0,0 +1,20 @@ 
+# Copyright (C) 2018 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
+# <http://www.gnu.org/licenses/>.
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
diff --git a/sysdeps/csky/preconfigure b/sysdeps/csky/preconfigure
new file mode 100644
index 0000000..d95f0ab
--- /dev/null
+++ b/sysdeps/csky/preconfigure
@@ -0,0 +1,4 @@ 
+case "$machine" in
+csky*)          base_machine=csky
+		machine=csky
+esac
diff --git a/sysdeps/csky/tst-audit.h b/sysdeps/csky/tst-audit.h
new file mode 100644
index 0000000..6c64625
--- /dev/null
+++ b/sysdeps/csky/tst-audit.h
@@ -0,0 +1,23 @@ 
+/* Definitions for testing PLT entry/exit auditing.  C-SKY version.
+   Copyright (C) 2018 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
+   <http://www.gnu.org/licenses/>.  */
+
+#define pltenter la_csky_gnu_pltenter
+#define pltexit la_csky_gnu_pltexit
+#define La_regs La_csky_regs
+#define La_retval La_csky_retval
+#define int_retval lrv_reg[0]
diff --git a/sysdeps/unix/sysv/linux/csky/Implies b/sysdeps/unix/sysv/linux/csky/Implies
new file mode 100644
index 0000000..2b5c256
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/Implies
@@ -0,0 +1,4 @@ 
+unix/sysv/linux/csky
+unix/sysv/linux/generic/wordsize-32
+unix/sysv/linux/generic
+csky/nptl
diff --git a/sysdeps/unix/sysv/linux/csky/Makefile b/sysdeps/unix/sysv/linux/csky/Makefile
new file mode 100644
index 0000000..ebaf5ac
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/Makefile
@@ -0,0 +1,26 @@ 
+ifeq ($(subdir),csu)
+sysdep_routines += read_tp libc-read_tp
+static-only-routines += read_tp
+shared-only-routines += libc-read_tp
+endif
+
+ifeq ($(subdir),elf)
+sysdep-rtld-routines += read_tp
+endif
+
+ifeq ($(subdir),misc)
+sysdep_routines += cacheflush
+sysdep_headers += sys/cachectl.h
+endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
+
+ifeq ($(subdir), csky)
+sysdep_headers += csky_readtp.h
+endif
+
+ifeq ($(subdir), malloc)
+libmemusage-routines += read_tp
+endif
diff --git a/sysdeps/unix/sysv/linux/csky/configure b/sysdeps/unix/sysv/linux/csky/configure
new file mode 100644
index 0000000..a3a7b81
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/configure
@@ -0,0 +1,5 @@ 
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+
+arch_minimum_kernel=2.6.25
+libc_cv_gcc_unwind_find_fde=no
+ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
diff --git a/sysdeps/unix/sysv/linux/csky/configure.ac b/sysdeps/unix/sysv/linux/csky/configure.ac
new file mode 100644
index 0000000..41746f8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/csky/configure.ac
@@ -0,0 +1,6 @@ 
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/sysv/linux/csky
+
+arch_minimum_kernel=2.6.25
+libc_cv_gcc_unwind_find_fde=no
+ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed