From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127277 invoked by alias); 29 Aug 2019 15:18:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 127268 invoked by uid 89); 29 Aug 2019 15:18:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 spammy= X-HELO: aserp2120.oracle.com Received: from aserp2120.oracle.com (HELO aserp2120.oracle.com) (141.146.126.78) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Aug 2019 15:18:46 +0000 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7TFFTf3192732 for ; Thu, 29 Aug 2019 15:18:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2019-08-05; bh=tAKseyz5o5Z/terxIfXEP55wASI+Vz2RzhHBTgJxX58=; b=gCAOb2eKuUealR5X8lYNMuxhwNoSql6XRkNnDDBhmoz5lkcCmh/P1W1Ezcrlm78hJtau UAZ/ltoXmHcU79YEcpAflE9E7de40x7uLGLxfqGeo28EIXXyVepyQn2SyQHokLHeNMLF rGyz58uzLFyygnLkpKRNTOtqi3KwOh2iuR80dOIg3tPtRK2Hxjlm7k2xC0+T+Bg2Hrj2 mo5V+L5ZKTlrI26GI9F6vTbIj3LLh7iGkZ+qd5aCbbGFJbeE6F2nhPvDTdTQuJXYB7tu 6DKYbbMA32qLd9J1qn4/2dgqnTE3l0qYsvo3N8dHgl5FEmiQdwqkXaRpYyyTAhGpzwpA Rg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2uph30g37q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 29 Aug 2019 15:18:44 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7TF9fTI024760 for ; Thu, 29 Aug 2019 15:13:59 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2upc8utguh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 29 Aug 2019 15:13:58 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x7TFDwd4000614 for ; Thu, 29 Aug 2019 15:13:58 GMT Received: from termi.localdomain (/10.175.22.100) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 29 Aug 2019 08:13:58 -0700 From: "Jose E. Marchesi" To: gcc-patches@gcc.gnu.org Subject: [PATCH V6 06/11] bpf: new libgcc port Date: Thu, 29 Aug 2019 15:21:00 -0000 Message-Id: <20190829151347.13536-7-jose.marchesi@oracle.com> In-Reply-To: <20190829151347.13536-1-jose.marchesi@oracle.com> References: <20190829151347.13536-1-jose.marchesi@oracle.com> X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg01990.txt.bz2 This patch adds an eBPF port to libgcc. As of today, compiled eBPF programs do not support a single-entry point schema. Instead, a BPF "executable" is a relocatable ELF object file containing multiple entry points, in certain named sections. Also, the BPF loaders in the kernel do not execute .ini/.fini constructors/destructors. Therefore, this patch provides empty crtn.S and cri.S files. libgcc/ChangeLog: * config.host: Set cpu_type for bpf-*-* targets. * config/bpf/t-bpf: Likewise. * config/bpf/crtn.S: Likewise. * config/bpf/crti.S: New file. --- libgcc/ChangeLog | 7 +++++++ libgcc/config.host | 7 +++++++ libgcc/config/bpf/crti.S | 0 libgcc/config/bpf/crtn.S | 0 libgcc/config/bpf/t-bpf | 23 +++++++++++++++++++++++ 5 files changed, 37 insertions(+) create mode 100644 libgcc/config/bpf/crti.S create mode 100644 libgcc/config/bpf/crtn.S create mode 100644 libgcc/config/bpf/t-bpf diff --git a/libgcc/config.host b/libgcc/config.host index 503ebb6be20..2e9fbc35482 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -107,6 +107,9 @@ avr-*-*) bfin*-*) cpu_type=bfin ;; +bpf-*-*) + cpu_type=bpf + ;; cr16-*-*) ;; crisv32-*-*) @@ -526,6 +529,10 @@ bfin*-*) tmake_file="$tmake_file bfin/t-bfin t-fdpbit" extra_parts="crtbegin.o crtend.o crti.o crtn.o" ;; +bpf-*-*) + tmake_file="$tmake_file ${cpu_type}/t-${cpu_type}" + extra_parts="crti.o crtn.o" + ;; cr16-*-elf) tmake_file="${tmake_file} cr16/t-cr16 cr16/t-crtlibid t-fdpbit" extra_parts="$extra_parts crti.o crtn.o crtlibid.o" diff --git a/libgcc/config/bpf/crti.S b/libgcc/config/bpf/crti.S new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libgcc/config/bpf/crtn.S b/libgcc/config/bpf/crtn.S new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libgcc/config/bpf/t-bpf b/libgcc/config/bpf/t-bpf new file mode 100644 index 00000000000..88129a78f61 --- /dev/null +++ b/libgcc/config/bpf/t-bpf @@ -0,0 +1,23 @@ +LIB2ADDEH = + +crti.o: $(srcdir)/config/bpf/crti.S + $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< + +crtn.o: $(srcdir)/config/bpf/crtn.S + $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< + +# Some of the functions defined in libgcc2 exceed the eBPF stack +# limit, or other restrictions imposed by this peculiar target. +# Therefore we have to exclude them here. +# +# Patterns in bpf.md must guarantee that no calls to the excluded +# functions are ever generated, and compiler tests should make sure +# this holds. +# +# Note that the modes in the function names below are misleading: di +# means TImode. +LIB2FUNCS_EXCLUDE = _mulvdi3 _divdi3 _moddi3 _divmoddi4 _udivdi3 _umoddi3 \ + _udivmoddi4 + +# Prevent building "advanced" stuff (for example, gcov support). +INHIBIT_LIBC_CFLAGS = -Dinhibit_libc -- 2.11.0