From patchwork Mon Jun 11 07:25:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 927517 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-479426-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=prevas.dk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Ov4O+E3w"; 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 4144M60s2vz9rvt for ; Mon, 11 Jun 2018 17:26:24 +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:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=gKx4O3oVFkKstLfo qcWWq+t3SvGhMl9jpD7JY6uWyN+wr9VjftHqfXvKoBP7OW/hczBA2DHSZlfNjVlF aaKxjZl/bOPqjy7ycwhFE7f2gQB3f2C8uMG29/QJNDe5u2hVZx4vRw8/Jox3//kT Aj1A32IobA4RD0ixm/0XbXdOJfQ= 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:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=CoaV572H6ks5M+8kL2zSvP I81so=; b=Ov4O+E3w2VOK2a614ixrONHcKQjORhCCkkE+b+UtfL9/qlHsNDgFKu 6U0O9DPlH9H3xBM8+CmSlW8S/8XJjj3BYdcxMVMQ8AvO4fSjGqPGaFxp2EmvLEcE u7DJgaFWjQ2Pc+qsYhmTukqxUzjBafffdW56XAgAFgsVVjgbJCkus= Received: (qmail 2182 invoked by alias); 11 Jun 2018 07:26:16 -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 894 invoked by uid 89); 11 Jun 2018 07:26:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=5.5, disabling, Hx-spam-relays-external:sk:mail-eo, H*r:sk:mail-eo X-HELO: EUR04-HE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr70128.outbound.protection.outlook.com (HELO EUR04-HE1-obe.outbound.protection.outlook.com) (40.107.7.128) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Jun 2018 07:26:05 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Rasmus.Villemoes@prevas.se; Received: from prevas-ravi.vestasvisitor.net (193.47.71.171) by DB6PR1001MB1335.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:b4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.17; Mon, 11 Jun 2018 07:26:02 +0000 From: Rasmus Villemoes To: gcc-patches@gcc.gnu.org Cc: Joseph Myers , Rasmus Villemoes Subject: [PATCH v3] add support for --disable-gcov Date: Mon, 11 Jun 2018 09:25:53 +0200 Message-Id: <20180611072553.26334-1-rasmus.villemoes@prevas.dk> In-Reply-To: <99e19880-9cd6-8895-5e26-21825a8f6021@prevas.dk> References: <99e19880-9cd6-8895-5e26-21825a8f6021@prevas.dk> MIME-Version: 1.0 X-ClientProxiedBy: AM6P193CA0005.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:3e::18) To DB6PR1001MB1335.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:b4::22) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB6PR1001MB1335: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Forefront-PRVS: 070092A9D3 Received-SPF: None (protection.outlook.com: prevas.se does not designate permitted sender hosts) SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Office365-Filtering-Correlation-Id: 140cd181-e09d-4ab3-3773-08d5cf6c9615 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2018 07:26:02.1527 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 140cd181-e09d-4ab3-3773-08d5cf6c9615 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR1001MB1335 For some targets (in my case VxWorks 5.5), libgcov does not compile due to missing functions and macros such as getpid() and F_OK. Incidentally, gcc/Makefile.in already contains comments such as # Install gcov if it was compiled. but there is no logic in place to actually allow gcov to not be compiled. So add an option for disabling build and install of libgcov and the related host tools. 2018-06-10 Rasmus Villemoes gcc/ * configure.ac: Add --disable-gcov option. * configure: Regenerate. * Makefile.in: Honour @enable_gcov@. * doc/install.texi: Document --disable-gcov. libgcc/ * configure.ac: Add --disable-gcov option. * configure: Regenerate. * Makefile.in: Honour @enable_gcov@. --- gcc/Makefile.in | 6 ++++-- gcc/configure.ac | 5 +++++ gcc/doc/install.texi | 4 ++++ libgcc/Makefile.in | 8 +++++++- libgcc/configure.ac | 5 +++++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index d8f3e886118..1f38cacde7a 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -137,8 +137,10 @@ SUBDIRS =@subdirs@ build # Selection of languages to be made. CONFIG_LANGUAGES = @all_selected_languages@ -LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) gcov-tool$(exeext) \ - $(CONFIG_LANGUAGES) +LANGUAGES = c $(CONFIG_LANGUAGES) +ifeq (@enable_gcov@,yes) +LANGUAGES += gcov$(exeext) gcov-dump$(exeext) gcov-tool$(exeext) +endif # Default values for variables overridden in Makefile fragments. # CFLAGS is for the user to override to, e.g., do a cross build with -O2. diff --git a/gcc/configure.ac b/gcc/configure.ac index 010ecd2ccf6..4fc851c644e 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -921,6 +921,11 @@ AC_ARG_ENABLE(shared, ], [enable_shared=yes]) AC_SUBST(enable_shared) +AC_ARG_ENABLE(gcov, +[ --disable-gcov don't provide libgcov and related host tools], +[], [enable_gcov=yes]) +AC_SUBST(enable_gcov) + AC_ARG_WITH(specs, [AS_HELP_STRING([--with-specs=SPECS], [add SPECS to driver command-line processing])], diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 7c5cdc762d3..03eaeed4e87 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1044,6 +1044,10 @@ virtual calls in verifiable mode at all. However the libvtv library will still be built (see @option{--disable-libvtv} to turn off building libvtv). @option{--disable-vtable-verify} is the default. +@item --disable-gcov +Specify that the run-time library used for coverage analysis +and associated host tools should not be built. + @item --disable-multilib Specify that multiple target libraries to support different target variants, calling diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index dd8cee99fd3..b7f20557214 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -36,6 +36,7 @@ SHELL = @SHELL@ cpu_type = @cpu_type@ enable_shared = @enable_shared@ +enable_gcov = @enable_gcov@ double_type_size = @double_type_size@ long_double_type_size = @long_double_type_size@ decimal_float = @decimal_float@ @@ -941,7 +942,10 @@ libgcc.a libgcov.a libunwind.a libgcc_eh.a: $(RANLIB) $@ -all: libgcc.a libgcov.a +all: libgcc.a +ifeq ($(enable_gcov),yes) +all: libgcov.a +endif ifneq ($(LIBUNWIND),) all: libunwind.a @@ -1164,9 +1168,11 @@ install-leaf: $(install-shared) $(install-libunwind) $(INSTALL_DATA) libgcc.a $(DESTDIR)$(inst_libdir)/ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc.a $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc.a +ifeq ($(enable_libgcov),yes) $(INSTALL_DATA) libgcov.a $(DESTDIR)$(inst_libdir)/ chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a +endif parts="$(INSTALL_PARTS)"; \ for file in $$parts; do \ diff --git a/libgcc/configure.ac b/libgcc/configure.ac index b59aa746afc..9d0bbcaba86 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -68,6 +68,11 @@ AC_ARG_ENABLE(shared, ], [enable_shared=yes]) AC_SUBST(enable_shared) +AC_ARG_ENABLE(gcov, +[ --disable-gcov don't provide libgcov and related host tools], +[], [enable_gcov=yes]) +AC_SUBST(enable_gcov) + AC_ARG_ENABLE(vtable-verify, [ --enable-vtable-verify Enable vtable verification feature ], [case "$enableval" in