From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 7D4EC3858427 for ; Mon, 9 May 2022 09:03:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D4EC3858427 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 882A61F9ED for ; Mon, 9 May 2022 09:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1652087017; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KyVUumtvx/klRbhWRsT8T2rci4B3q0ayE1PqoG1b0u8=; b=uJ5Y4QyVR0g5yJfi33vpSUkdESnPAsoCV9gzZ3iLBGx0o+iK4QmCkta9dTVZmnVd5HhYBs jwhYKHLDWRO8cD2ZcaPpkdNhCCVpbt+eC/CQOigc2nIftcha1izgXY6/Y9C/TZ7HHQb2X8 Xx8SG/+ob3adqozeieiGeUD9JCeoeH0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1652087017; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KyVUumtvx/klRbhWRsT8T2rci4B3q0ayE1PqoG1b0u8=; b=M8aQ8s1kvD/bIfohE7Htx+ipCWRLKW+LRP0JKRPxW+OetOBcM9+W8GQV6dG5iwYOme4rhL AXxhHRKq/FsiHdCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7831613AA5 for ; Mon, 9 May 2022 09:03:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ML5sHOnYeGJyVQAAMHmgww (envelope-from ) for ; Mon, 09 May 2022 09:03:37 +0000 Message-ID: Date: Mon, 9 May 2022 11:03:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] configure: add --disable-fix-includes To: gcc-patches@gcc.gnu.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2022 09:03:43 -0000 Right now, fixinclude takes about 11 seconds on my machine, where it reads 130MB of header files. The number of fixed headers is negligible without any significant change. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin fixincludes/ChangeLog: * fixinc.in: Add early exit. gcc/ChangeLog: * Makefile.in: Support disable_fix_includes. * configure.ac: Add --disable-fix-includes. * configure: Regenerate. --- fixincludes/fixinc.in | 6 ++++++ gcc/Makefile.in | 6 ++++-- gcc/configure | 21 +++++++++++++++++++-- gcc/configure.ac | 6 ++++++ 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in index 0c3066452c6..3ebcd346d41 100755 --- a/fixincludes/fixinc.in +++ b/fixincludes/fixinc.in @@ -63,6 +63,12 @@ else esac fi +if test "x$DISABLE_FIX_INCLUDES" = "xyes" +then + echo "Skipping fixincludes" + exit 0 +fi + # Define what target system we're fixing. # if test -r ./Makefile; then diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 31ff95500c9..c77f1cc644d 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -401,6 +401,8 @@ PLUGINLIBS = @pluginlibs@ enable_plugin = @enable_plugin@ +disable_fix_includes = @disable_fix_includes@ + # On MinGW plugin installation involves installing import libraries. ifeq ($(enable_plugin),yes) plugin_implib := $(if $(strip $(filter mingw%,$(host_os))),yes,no) @@ -3248,8 +3250,8 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \ chmod a+rx $${fix_dir} || true; \ (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \ SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \ - gcc_dir=`${PWD_COMMAND}` ; \ - export TARGET_MACHINE srcdir SHELL MACRO_LIST && \ + gcc_dir=`${PWD_COMMAND}` ; DISABLE_FIX_INCLUDES=${disable_fix_includes} \ + export TARGET_MACHINE srcdir SHELL MACRO_LIST DISABLE_FIX_INCLUDES && \ cd $(build_objdir)/fixincludes && \ $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \ $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \ diff --git a/gcc/configure b/gcc/configure index bd4d4721868..843ab02bfa3 100755 --- a/gcc/configure +++ b/gcc/configure @@ -839,6 +839,7 @@ with_float with_cpu enable_multiarch enable_multilib +disable_fix_includes coverage_flags valgrind_command valgrind_path_defines @@ -958,6 +959,7 @@ enable_werror_always enable_checking enable_coverage enable_gather_detailed_mem_stats +enable_disable_fix_includes enable_valgrind_annotations enable_multilib enable_multiarch @@ -1688,6 +1690,7 @@ Optional Features: Values are opt, noopt, default is noopt --enable-gather-detailed-mem-stats enable detailed memory allocation stats gathering + --disable-fix-includes skip fixing of includes --enable-valgrind-annotations enable valgrind runtime interaction --enable-multilib enable library support for multiple ABIs @@ -7780,6 +7783,20 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# Check whether --enable-disable-fix-includes was given. +if test "${enable_disable_fix_includes+set}" = set; then : + enableval=$enable_disable_fix_includes; +else + disable_fix_includes=yes +fi + + +cat >>confdefs.h <<_ACEOF +#define FIX_INCLUDES $disable_fix_includes +_ACEOF + + + # Check whether --enable-valgrind-annotations was given. if test "${enable_valgrind_annotations+set}" = set; then : enableval=$enable_valgrind_annotations; @@ -19659,7 +19676,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19662 "configure" +#line 19679 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19765,7 +19782,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19768 "configure" +#line 19785 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 1171c946e6e..6015e403aa9 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -842,6 +842,12 @@ gather_stats=`if test $enable_gather_detailed_mem_stats != no; then echo 1; else AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats, [Define to enable detailed memory allocation stats gathering.]) +AC_ARG_ENABLE(disable-fix-includes, +[AS_HELP_STRING([--disable-fix-includes], + [skip fixing of includes])], [], +[disable_fix_includes=yes]) +AC_SUBST(disable_fix_includes) + AC_ARG_ENABLE(valgrind-annotations, [AS_HELP_STRING([--enable-valgrind-annotations], [enable valgrind runtime interaction])], [], -- 2.36.0