From patchwork Thu Apr 30 08:44:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1280052 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=VRCBIeSX; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49CTTr2scTz9sPF for ; Thu, 30 Apr 2020 18:45:02 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C6ED73894E7E; Thu, 30 Apr 2020 08:44:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6ED73894E7E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588236296; bh=TNtzbFDFgsCz+sFtPPqM/9D02KGNj80Gp9gX1UpFWnY=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=VRCBIeSXdCRZYhFM/BrwwsbqmjX7OogiSoBErT9b7bDNR0Vuixa6logMmj+Cj+VFe zVIlfRPw7MEORbLvNwQpps7A0+NFlZ3F9CYrVtVkXRLlGfxb75mDGSznwETLHkGUWH 0waSB9gRBNIuzbzuraoYnYbhZfQi0VVWiTB/Sgcg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id 10D77386F021 for ; Thu, 30 Apr 2020 08:44:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 10D77386F021 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-138-eufj-qBHMI2MKZ29iay9FQ-1; Thu, 30 Apr 2020 04:44:43 -0400 X-MC-Unique: eufj-qBHMI2MKZ29iay9FQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5A19545F; Thu, 30 Apr 2020 08:44:42 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-104.ams2.redhat.com [10.36.112.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B493D5D9F1; Thu, 30 Apr 2020 08:44:41 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 03U8icFg006191; Thu, 30 Apr 2020 10:44:38 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 03U8ibqH006190; Thu, 30 Apr 2020 10:44:37 +0200 Date: Thu, 30 Apr 2020 10:44:36 +0200 To: Richard Biener , David Malcolm , "Joseph S. Myers" Subject: [PATCH] --with-{documentation,changes}-root-url tweaks Message-ID: <20200430084436.GR2424@tucnak> References: <20200429124645.GG2424@tucnak> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-16.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi! On Thu, Apr 30, 2020 at 08:42:39AM +0200, Richard Biener wrote: > , CHANGES_URL ("gcc-10/changes.html#empty_base"); > > where the macro would just use preprocessor string concatenation? Ok, the following patch implements it (doesn't introduce a separate macro and just uses CHANGES_ROOT_URL "gcc-10/changes.html#empty_base"), in addition adds the documentation Joseph requested. Tested on x86_64-linux and with crosses to s390x-linux and powerpc64le-linux, ok for trunk? 2020-04-30 Jakub Jelinek * configure.ac (--with-documentation-root-url, --with-changes-root-url): Diagnose URL not ending with /, use AC_DEFINE_UNQUOTED instead of AC_SUBST. * opts.h (get_changes_url): Remove. * opts.c (get_changes_url): Remove. * Makefile.in (CFLAGS-opts.o): Don't add -DDOCUMENTATION_ROOT_URL or -DCHANGES_ROOT_URL. * doc/install.texi (--with-documentation-root-url, --with-changes-root-url): Document. * config/arm/arm.c (aapcs_vfp_is_call_or_return_candidate): Don't call get_changes_url and free, change url variable type to const char * and set it to CHANGES_ROOT_URL "gcc-10/changes.html#empty_base". * config/s390/s390.c (s390_function_arg_vector, s390_function_arg_float): Likewise. * config/aarch64/aarch64.c (aarch64_vfp_is_call_or_return_candidate): Likewise. * config/rs6000/rs6000-call.c (rs6000_discover_homogeneous_aggregate): Likewise. * config.in: Regenerate. * configure: Regenerate. Jakub --- gcc/configure.ac.jj 2020-04-29 22:41:05.086585150 +0200 +++ gcc/configure.ac 2020-04-30 09:35:29.800894085 +0200 @@ -979,12 +979,13 @@ AC_ARG_WITH(documentation-root-url, [case "$withval" in yes) AC_MSG_ERROR([documentation root URL not specified]) ;; no) AC_MSG_ERROR([documentation root URL not specified]) ;; - *) DOCUMENTATION_ROOT_URL="$withval" - ;; + */) DOCUMENTATION_ROOT_URL="$withval" ;; + *) AC_MSG_ERROR([documentation root URL does not end with /]) ;; esac], DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/" ) -AC_SUBST(DOCUMENTATION_ROOT_URL) +AC_DEFINE_UNQUOTED(DOCUMENTATION_ROOT_URL,"$DOCUMENTATION_ROOT_URL", + [Define to the root for documentation URLs.]) # Allow overriding the default URL for GCC changes AC_ARG_WITH(changes-root-url, @@ -993,12 +994,13 @@ AC_ARG_WITH(changes-root-url, [case "$withval" in yes) AC_MSG_ERROR([changes root URL not specified]) ;; no) AC_MSG_ERROR([changes root URL not specified]) ;; - *) CHANGES_ROOT_URL="$withval" - ;; + */) CHANGES_ROOT_URL="$withval" ;; + *) AC_MSG_ERROR([changes root URL does not end with /]) ;; esac], CHANGES_ROOT_URL="https://gcc.gnu.org/" ) -AC_SUBST(CHANGES_ROOT_URL) +AC_DEFINE_UNQUOTED(CHANGES_ROOT_URL,"$CHANGES_ROOT_URL", + [Define to the root for URLs about GCC changes.]) # Sanity check enable_languages in case someone does not run the toplevel # configure # script. --- gcc/opts.h.jj 2020-04-29 22:41:05.089585106 +0200 +++ gcc/opts.h 2020-04-30 09:38:20.110367236 +0200 @@ -464,7 +464,6 @@ extern void parse_options_from_collect_g int *); extern void prepend_xassembler_to_collect_as_options (const char *, obstack *); -extern char *get_changes_url (const char *); /* Set OPTION in OPTS to VALUE if the option is not set in OPTS_SET. */ --- gcc/opts.c.jj 2020-04-29 22:41:05.090585091 +0200 +++ gcc/opts.c 2020-04-30 09:37:17.039303011 +0200 @@ -3190,16 +3190,6 @@ get_option_url (diagnostic_context *, in return NULL; } -/* Given "gcc-10/changes.html#foobar", return that URL under - CHANGES_ROOT_URL (see --with-changes-root-url). - The caller is responsible for freeing the returned string. */ - -char * -get_changes_url (const char *str) -{ - return concat (CHANGES_ROOT_URL, str, NULL); -} - #if CHECKING_P namespace selftest { --- gcc/Makefile.in.jj 2020-04-29 22:41:05.088585120 +0200 +++ gcc/Makefile.in 2020-04-30 09:36:14.201235329 +0200 @@ -2186,9 +2186,6 @@ lto-wrapper$(exeext): $(LTO_WRAPPER_OBJS $(LTO_WRAPPER_OBJS) libcommon-target.a $(LIBS) mv -f T$@ $@ -CFLAGS-opts.o += -DDOCUMENTATION_ROOT_URL=\"@DOCUMENTATION_ROOT_URL@\" -CFLAGS-opts.o += -DCHANGES_ROOT_URL=\"@CHANGES_ROOT_URL@\" - # Files used by all variants of C or by the stand-alone pre-processor. CFLAGS-c-family/c-opts.o += @TARGET_SYSTEM_ROOT_DEFINE@ --- gcc/doc/install.texi.jj 2020-04-23 14:42:07.614123663 +0200 +++ gcc/doc/install.texi 2020-04-30 10:13:09.500365247 +0200 @@ -684,6 +684,19 @@ if you determine that they are not bugs The default value refers to the FSF's GCC bug tracker. +@item --with-documentation-root-url=@var{url} +Specify the URL root that contains GCC option documentation. The @var{url} +should end with a @code{/} character. + +The default value is @uref{https://gcc.gnu.org/onlinedocs/,,https://gcc.gnu.org/onlinedocs/}. + +@item --with-changes-root-url=@var{url} +Specify the URL root that contains information about changes in GCC +releases like @code{gcc-@var{version}/changes.html}. +The @var{url} should end with a @code{/} character. + +The default value is @uref{https://gcc.gnu.org/,,https://gcc.gnu.org/}. + @end table @heading Target specification --- gcc/config/arm/arm.c.jj 2020-04-29 22:41:05.096585003 +0200 +++ gcc/config/arm/arm.c 2020-04-30 09:39:24.493412004 +0200 @@ -6416,7 +6416,8 @@ aapcs_vfp_is_call_or_return_candidate (e && ((alt = aapcs_vfp_sub_candidate (type, &new_mode, NULL)) != ag_count)) { - char *url = get_changes_url ("gcc-10/changes.html#empty_base"); + const char *url + = CHANGES_ROOT_URL "gcc-10/changes.html#empty_base"; gcc_assert (alt == -1); last_reported_type_uid = uid; /* Use TYPE_MAIN_VARIANT to strip any redundant const @@ -6431,7 +6432,6 @@ aapcs_vfp_is_call_or_return_candidate (e "type %qT when C++17 is enabled changed to match " "C++14 %{in GCC 10.1%}", TYPE_MAIN_VARIANT (type), url); - free (url); } *count = ag_count; } --- gcc/config/s390/s390.c.jj 2020-04-29 22:41:05.101584929 +0200 +++ gcc/config/s390/s390.c 2020-04-30 09:41:23.234650255 +0200 @@ -11960,7 +11960,7 @@ s390_function_arg_vector (machine_mode m unsigned uid = TYPE_UID (TYPE_MAIN_VARIANT (orig_type)); if (uid != last_reported_type_uid) { - char *url = get_changes_url ("gcc-10/changes.html#empty_base"); + const char *url = CHANGES_ROOT_URL "gcc-10/changes.html#empty_base"; last_reported_type_uid = uid; if (empty_base_seen & 1) inform (input_location, @@ -11972,7 +11972,6 @@ s390_function_arg_vector (machine_mode m "parameter passing for argument of type %qT with " "%<[[no_unique_address]]%> members changed " "%{in GCC 10.1%}", orig_type, url); - free (url); } } return true; @@ -12038,7 +12037,7 @@ s390_function_arg_float (machine_mode mo unsigned uid = TYPE_UID (TYPE_MAIN_VARIANT (orig_type)); if (uid != last_reported_type_uid) { - char *url = get_changes_url ("gcc-10/changes.html#empty_base"); + const char *url = CHANGES_ROOT_URL "gcc-10/changes.html#empty_base"; last_reported_type_uid = uid; if (empty_base_seen & 1) inform (input_location, @@ -12050,7 +12049,6 @@ s390_function_arg_float (machine_mode mo "parameter passing for argument of type %qT with " "%<[[no_unique_address]]%> members changed " "%{in GCC 10.1%}", orig_type, url); - free (url); } } --- gcc/config/aarch64/aarch64.c.jj 2020-04-29 22:41:05.098584973 +0200 +++ gcc/config/aarch64/aarch64.c 2020-04-30 09:40:07.694771031 +0200 @@ -16883,7 +16883,8 @@ aarch64_vfp_is_call_or_return_candidate && ((alt = aapcs_vfp_sub_candidate (type, &new_mode, NULL)) != ag_count)) { - char *url = get_changes_url ("gcc-10/changes.html#empty_base"); + const char *url + = CHANGES_ROOT_URL "gcc-10/changes.html#empty_base"; gcc_assert (alt == -1); last_reported_type_uid = uid; /* Use TYPE_MAIN_VARIANT to strip any redundant const @@ -16898,7 +16899,6 @@ aarch64_vfp_is_call_or_return_candidate "type %qT when C++17 is enabled changed to match " "C++14 %{in GCC 10.1%}", TYPE_MAIN_VARIANT (type), url); - free (url); } if (is_ha != NULL) *is_ha = true; --- gcc/config/rs6000/rs6000-call.c.jj 2020-04-29 22:41:05.099584959 +0200 +++ gcc/config/rs6000/rs6000-call.c 2020-04-30 09:40:46.140200621 +0200 @@ -5748,8 +5748,8 @@ rs6000_discover_homogeneous_aggregate (m unsigned uid = TYPE_UID (TYPE_MAIN_VARIANT (type)); if (uid != last_reported_type_uid) { - char *url - = get_changes_url ("gcc-10/changes.html#empty_base"); + const char *url + = CHANGES_ROOT_URL "gcc-10/changes.html#empty_base"; if (empty_base_seen & 1) inform (input_location, "parameter passing for argument of type %qT " @@ -5761,7 +5761,6 @@ rs6000_discover_homogeneous_aggregate (m "with %<[[no_unique_address]]%> members " "changed %{in GCC 10.1%}", type, url); last_reported_type_uid = uid; - free (url); } } return true; --- gcc/config.in.jj 2020-02-15 12:51:17.422090432 +0100 +++ gcc/config.in 2020-04-30 09:35:40.289738417 +0200 @@ -24,6 +24,12 @@ #endif +/* Define to the root for URLs about GCC changes. */ +#ifndef USED_FOR_TARGET +#undef CHANGES_ROOT_URL +#endif + + /* Define as the number of bits in a byte, if `limits.h' doesn't. */ #ifndef USED_FOR_TARGET #undef CHAR_BIT @@ -82,6 +88,12 @@ #endif +/* Define to the root for documentation URLs. */ +#ifndef USED_FOR_TARGET +#undef DOCUMENTATION_ROOT_URL +#endif + + /* Define 0/1 if static analyzer feature is enabled. */ #ifndef USED_FOR_TARGET #undef ENABLE_ANALYZER --- gcc/configure.jj 2020-04-29 22:41:05.539578490 +0200 +++ gcc/configure 2020-04-30 09:35:37.772775809 +0200 @@ -819,8 +819,6 @@ accel_dir_suffix real_target_noncanonical enable_as_accelerator gnat_install_lib -CHANGES_ROOT_URL -DOCUMENTATION_ROOT_URL REPORT_BUGS_TEXI REPORT_BUGS_TO PKGVERSION @@ -7851,8 +7849,8 @@ if test "${with_documentation_root_url+s withval=$with_documentation_root_url; case "$withval" in yes) as_fn_error $? "documentation root URL not specified" "$LINENO" 5 ;; no) as_fn_error $? "documentation root URL not specified" "$LINENO" 5 ;; - *) DOCUMENTATION_ROOT_URL="$withval" - ;; + */) DOCUMENTATION_ROOT_URL="$withval" ;; + *) as_fn_error $? "documentation root URL does not end with /" "$LINENO" 5 ;; esac else DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/" @@ -7860,6 +7858,10 @@ else fi +cat >>confdefs.h <<_ACEOF +#define DOCUMENTATION_ROOT_URL "$DOCUMENTATION_ROOT_URL" +_ACEOF + # Allow overriding the default URL for GCC changes @@ -7868,8 +7870,8 @@ if test "${with_changes_root_url+set}" = withval=$with_changes_root_url; case "$withval" in yes) as_fn_error $? "changes root URL not specified" "$LINENO" 5 ;; no) as_fn_error $? "changes root URL not specified" "$LINENO" 5 ;; - *) CHANGES_ROOT_URL="$withval" - ;; + */) CHANGES_ROOT_URL="$withval" ;; + *) as_fn_error $? "changes root URL does not end with /" "$LINENO" 5 ;; esac else CHANGES_ROOT_URL="https://gcc.gnu.org/" @@ -7877,6 +7879,10 @@ else fi +cat >>confdefs.h <<_ACEOF +#define CHANGES_ROOT_URL "$CHANGES_ROOT_URL" +_ACEOF + # Sanity check enable_languages in case someone does not run the toplevel # configure # script. @@ -19009,7 +19015,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19012 "configure" +#line 19018 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19115,7 +19121,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19118 "configure" +#line 19124 "configure" #include "confdefs.h" #if HAVE_DLFCN_H