From patchwork Fri Jun 29 07:58:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5q+b5pmX?= X-Patchwork-Id: 936676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93790-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=c-sky.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Rc7QWU2/"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41H8Ht0m8Bz9ryk for ; Fri, 29 Jun 2018 18:02:01 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; q=dns; s=default; b=h+Mi/6UB tzmmXl/Ba9zIbKLYi4gmbn4dHV/kL0OjOp8rcGH7AONKJ2XdmPt134AxVYg6hVBG qLbFLTFMlnQOmvKFXZkkL6PJiELQboKhBTpIgKh/+PLvUz5r+FGCTTY7mNMtPMcE q2HhpqQpTy5gvhTwhVmppJ9x73gPIj6PU8Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; s=default; bh=iIWcbUr8gk0t5k WkhDumYdlsIbQ=; b=Rc7QWU2/fhm2whsZmOWcvHweHwflP08p3z3S0Z9slvyzb2 O4jUyQrQ9cDN656nTrDfjINKETJmi9VajdHRiaYkogDqIa6tvotRrm3dqzGMNaz7 c2YkxEfUAsNM5gtXKpE9o46AiZ1AgcUuoyai0yS4y2Ju4zAjJKdZkkH9RSpvc= Received: (qmail 71994 invoked by alias); 29 Jun 2018 08:01:10 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 59341 invoked by uid 89); 29 Jun 2018 08:00:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, FSL_HELO_NON_FQDN_1, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT autolearn=ham version=3.3.2 spammy=EDIT, H*r:Unknown X-HELO: vmh-VirtualBox From: Mao Han To: libc-alpha@sourceware.org Cc: Mao Han , c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com Subject: [RFC PATCH v3 10/12] C-SKY: Build Infastructure Date: Fri, 29 Jun 2018 15:58:55 +0800 Message-Id: In-Reply-To: References: In-Reply-To: References: This patch contains all the implile, makefile and configure needed in C-SKY porting. * sysdeps/csky/Implies: New file. * sysdeps/csky/Makefile: Likewise. * sysdeps/csky/configure: Likewise. * sysdeps/csky/configure.ac: Likewise. * sysdeps/csky/nofpu/Implies: Likewise. * sysdeps/csky/nptl/Makefile: Likewise. * sysdeps/csky/preconfigure: Likewise. * sysdeps/csky/tst-audit.h: Likewise. * sysdeps/unix/sysv/linux/csky/Implies: Likewise. * sysdeps/unix/sysv/linux/csky/Makefile: Likewise. * sysdeps/unix/sysv/linux/csky/configure: Likewise. * sysdeps/unix/sysv/linux/csky/configure.ac: Likewise. --- sysdeps/csky/Implies | 4 ++++ sysdeps/csky/Makefile | 13 +++++++++++ sysdeps/csky/configure | 4 ++++ sysdeps/csky/configure.ac | 4 ++++ sysdeps/csky/nofpu/Implies | 1 + sysdeps/csky/nptl/Makefile | 20 +++++++++++++++++ sysdeps/csky/preconfigure | 37 +++++++++++++++++++++++++++++++ sysdeps/csky/tst-audit.h | 23 +++++++++++++++++++ sysdeps/unix/sysv/linux/csky/Implies | 3 +++ sysdeps/unix/sysv/linux/csky/Makefile | 8 +++++++ sysdeps/unix/sysv/linux/csky/configure | 4 ++++ sysdeps/unix/sysv/linux/csky/configure.ac | 5 +++++ 12 files changed, 126 insertions(+) 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/nofpu/Implies 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 diff --git a/sysdeps/csky/Implies b/sysdeps/csky/Implies new file mode 100644 index 0000000..f8c3a75 --- /dev/null +++ b/sysdeps/csky/Implies @@ -0,0 +1,4 @@ +wordsize-32 +# C-SKY 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..19acb08 --- /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/csky. + +$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..5656b66 --- /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/csky. + +AC_DEFINE(PI_STATIC_AND_HIDDEN) diff --git a/sysdeps/csky/nofpu/Implies b/sysdeps/csky/nofpu/Implies new file mode 100644 index 0000000..abcbadb --- /dev/null +++ b/sysdeps/csky/nofpu/Implies @@ -0,0 +1 @@ +ieee754/soft-fp 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 +# . + +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..99df449 --- /dev/null +++ b/sysdeps/csky/preconfigure @@ -0,0 +1,37 @@ +case "$machine" in +csky*) + abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | + sed -n 's/^#define __CSKYABI__ \(.*\)/\1/p'` + float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | + sed -n 's/^#define __CSKY_HARD_FLOAT__ \(.*\)/\1/p'` + + case "$abi" in + 1) + echo "glibc does not support abiv1 yet" >&2 + exit 1 + ;; + 2) + machine=abiv2 + ;; + *) + echo "Unknow abi" >&2 + exit 1 + ;; + esac + + case "$float_abi" in + 1) + with_fp_cond=1 + ;; + *) + with_fp_cond=0 + ;; + esac + + base_machine=csky + machine=csky/$machine + + $as_echo "#define CSKYABI $abi" >>confdefs.h + $as_echo "#define CSKY_HARD_FLOAT $float_abi" >>confdefs.h + ;; +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 + . */ + +#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..f37776c --- /dev/null +++ b/sysdeps/unix/sysv/linux/csky/Implies @@ -0,0 +1,3 @@ +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..4462bc0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/csky/Makefile @@ -0,0 +1,8 @@ +ifeq ($(subdir),misc) +sysdep_routines += cacheflush +sysdep_headers += sys/cachectl.h +endif + +ifeq ($(subdir),stdlib) +gen-as-const-headers += ucontext_i.sym +endif diff --git a/sysdeps/unix/sysv/linux/csky/configure b/sysdeps/unix/sysv/linux/csky/configure new file mode 100644 index 0000000..4daed57 --- /dev/null +++ b/sysdeps/unix/sysv/linux/csky/configure @@ -0,0 +1,4 @@ +# This file is generated from configure.ac by Autoconf. DO NOT EDIT! + +arch_minimum_kernel=4.1x.0 +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..ae46544 --- /dev/null +++ b/sysdeps/unix/sysv/linux/csky/configure.ac @@ -0,0 +1,5 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/csky + +arch_minimum_kernel=4.1x.0 +ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed