From patchwork Thu Jun 13 00:56:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilia Diachkov X-Patchwork-Id: 1114916 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=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-502879-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=optimitech.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="CYmik2dy"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=optimitech.com header.i=@optimitech.com header.b="fhXUrCdV"; 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 45PQLQ6fVMz9s5c for ; Thu, 13 Jun 2019 10:56:58 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:content-type:date:from:to:subject:message-id; q= dns; s=default; b=J7m7wVE3URDnWuqCndQquKMyTsiB7jrktK8Qzna/7GF0Yn 9WOYXiogUZu/M+DPpfTnugccNdDhUfgp+4+20K/nhbOqTUBPDJ06aIF6q83SpzOC CeK+160MAAHN/lJYjkC8wNaUraL+Tz32NOsLXEyEHrs92PHWWTYaiGRtURUF4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:content-type:date:from:to:subject:message-id; s= default; bh=RTuBJGpC5wQs8yz/mq9cQJ7TVZo=; b=CYmik2dyv1tdmg7g2hew cwZjDj2Cpo0zpNzIZdUa2TZcpvR1BwkP8jYg6ePT1aXOOGSk2Uxw8/GluYGp68Nb 3+bEO3grSD6Wspj4OzhxLEoAmDZPYpUnOBoLASJthFJjTy9o+CdO+57i19M7BRc8 /vPLLMOVFRxjPiR5uwEKDGY= Received: (qmail 106462 invoked by alias); 13 Jun 2019 00:56:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 106454 invoked by uid 89); 13 Jun 2019 00:56:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:fno-tre, H*u:1.3.3, H*r:cmsmtp, HX-Spam-Relays-External:cmsmtp X-HELO: gateway9.unifiedlayer.com Received: from gateway9.unifiedlayer.com (HELO gateway9.unifiedlayer.com) (70.40.200.246) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jun 2019 00:56:40 +0000 Received: from cm3.websitewelcome.com (unknown [108.167.139.23]) by gateway9.unifiedlayer.com (Postfix) with ESMTP id 6B4EB2009926B for ; Wed, 12 Jun 2019 19:56:38 -0500 (CDT) Received: from shared76.accountservergroup.com ([162.215.248.60]) by cmsmtp with ESMTP id bE2fhKkhKzc5jbE2ghEpiz; Wed, 12 Jun 2019 19:56:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=optimitech.com; s=default; h=Message-ID:Subject:To:From:Date:Content-Type: MIME-Version:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=iJZN5ygtS68nzBLoLVQSkL4CQMV3wApoCQNtxpui0Vw=; b=fhXUrCdVrc8tPkAP/tBXXIdu4r P8HmX75E7ltDlwAfZyLDPm5TavjXlU5QTQSdeK1HFHLh1hKqnpcIjWOQpdpXYcfjJNk6E9UA7xgVk 6gOqwVjBwcw0vWuvsIMLzJ94bEpZ1gtPmINFndZoAWLlNVHOAn/qFUvySHNlMy99eGt0yA2OB6NvE gN9DTLqLLyzM9CM419EjKYaOb9a7mg6HKKKomWcnRIW0Kg73Zv2AYpS/vrPkLM2M39LT7Ic5gjQBB ZxIAWEDIMCfICzOaM3k7XMR8ruFVQsGn/hL+jQrccvIeh69fkL4xKizVfWNUa/chKwTbdxH6F/7lc JD6CXDVQ==; Received: from shared76.accountservergroup.com ([162.215.248.60]:10997) by shared76.accountservergroup.com with esmtpa (Exim 4.91) (envelope-from ) id 1hbE2f-000taN-RR for gcc-patches@gcc.gnu.org; Wed, 12 Jun 2019 19:56:37 -0500 MIME-Version: 1.0 Date: Wed, 12 Jun 2019 19:56:37 -0500 From: ilia.diachkov@optimitech.com To: gcc-patches@gcc.gnu.org Subject: [PATCH] Add --disable-tm-clone-registry libgcc configure option. Message-ID: <8f106efb5581e875ad121e7e9fe2280a@optimitech.com> X-Sender: ilia.diachkov@optimitech.com User-Agent: Roundcube Webmail/1.3.3 Hello, This patch adds libgcc configuration option to disable TM clone registry. This option helps to reduce code size for embedded targets which do not need transactional memory support. Tested on x86_64 and riscv64-unknown-elf-gcc, the last is with the option enabled. If the change is Ok with you, please commit it since I have no write access to gcc repository. Best regards, Ilia. libgcc/ChangeLog: * Makefile.in: Add @use_tm_clone_registry@. * configure: Regenerate. * configure.ac: Add --disable-tm-clone-registry option. gcc/ChangeLog: * doc/install.texi: Document --disable-tm-clone-registry. diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 29d0470..1a0e8c7 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1284,6 +1284,11 @@ assumptions made by the configure test are incorrect. Specify that the target does not support TLS. This is an alias for @option{--enable-tls=no}. +@item --disable-tm-clone-registry +Disable TM clone registry in libgcc. It is enabled in libgcc by default. +This option helps to reduce code size for embedded targets which do +not use transactional memory. + @item --with-cpu=@var{cpu} @itemx --with-cpu-32=@var{cpu} @itemx --with-cpu-64=@var{cpu} diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index fb77881..189f9ff 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -259,6 +259,8 @@ PICFLAG = @PICFLAG@ CET_FLAGS = @CET_FLAGS@ +USE_TM_CLONE_REGISTRY = @use_tm_clone_registry@ + # Defined in libgcc2.c, included only in the static library. LIB2FUNCS_ST = _eprintf __gcc_bcmp @@ -299,7 +301,7 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ $(NO_PIE_CFLAGS) -finhibit-size-directive -fno-inline -fno-exceptions \ -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ -fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \ - $(INHIBIT_LIBC_CFLAGS) + $(INHIBIT_LIBC_CFLAGS) $(USE_TM_CLONE_REGISTRY) # Extra flags to use when compiling crt{begin,end}.o. CRTSTUFF_T_CFLAGS = diff --git a/libgcc/configure.ac b/libgcc/configure.ac index 5f11455..b1b90d2 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -261,6 +261,16 @@ fi ]) AC_SUBST([force_explicit_eh_registry]) +AC_ARG_ENABLE([tm-clone-registry], +[ --disable-tm-clone-registry disable TM clone registry], +[ +use_tm_clone_registry= +if test "$enable_tm_clone_registry" = no; then + use_tm_clone_registry=-DUSE_TM_CLONE_REGISTRY=0 +fi +]) +AC_SUBST([use_tm_clone_registry]) + AC_LIB_PROG_LD_GNU AC_MSG_CHECKING([for thread model used by GCC])