From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id 3D2E23858C50 for ; Tue, 12 Jul 2022 11:50:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3D2E23858C50 Received: by mail-lf1-x12d.google.com with SMTP id t25so13507090lfg.7 for ; Tue, 12 Jul 2022 04:50:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=HYcT+kDbjyHkWyee+TS8Y7JY34bxji9kbcaoM+idXFU=; b=Fcoj4wQg2g0+rrSXuRh7ZXCPdtYc2XoYFToDf3zxQHyTbslW/WybiT/bHOlkJjiN81 oDXTNNjMJp7jo3jH8LuadgOsfuOulJ1nOLTXAHjYwU9/bxrfcvyavkf8FhTGoMQpt/w0 4GCojKS6nQJM8Ss2oxaIWcGPxbyBRr0XivGPSYUt6tD45Bp4OM8nkw8Vx3X53YWN/83r 7vPsdwiWZafyEqATFIPn03lpdFNJw3eqnRqRjxMHm0QAC/8bwZpOPqKR+puxl9TjUCXm xqOyi83hCommXcQaPx4xKB7aF3sRLDH+43dP0SOYEqJnTzQknHybFhFrMAExZiwr5oRU 6jjA== X-Gm-Message-State: AJIora/gWDRJA472y8WaF0JIY2KSGsMAJmz5O4OiH1QZPo5Sxw5/BrHO kg5OorrMR8vTC2ctgnjk82NkwHXRCSvg67rLu1c= X-Google-Smtp-Source: AGRyM1uvx9JPxAJxYJBk5IWrEi/Y42w6q77wBmC5/mdA2D/j5FxJLl9QCLga0O5e9vuS0FI0n/IUq2+kro/jUVrFaIs= X-Received: by 2002:a05:6512:3d86:b0:47f:9adc:cc27 with SMTP id k6-20020a0565123d8600b0047f9adccc27mr14374184lfv.608.1657626630532; Tue, 12 Jul 2022 04:50:30 -0700 (PDT) MIME-Version: 1.0 References: <803a0290-3909-b9c5-2461-b1740a00c63a@suse.cz> <37b52d36-d1dd-f291-0baa-0cf670493692@suse.cz> <4e3df681-9523-4781-d324-9a6e230f495a@suse.cz> <3dc13790-a22d-c4d6-6cfe-ab9b567968ff@suse.cz> <862b4381-c377-ac7a-476c-e7ced3c29c2c@ispras.ru> <3bde5aa4-f3d7-63e8-8b4f-29b29f00293f@suse.cz> <41751c29-5b9b-671d-de47-e1c13ea78b7@ispras.ru> <461c4c4f-57f1-e689-f41d-fb4f68d638c8@suse.cz> In-Reply-To: <461c4c4f-57f1-e689-f41d-fb4f68d638c8@suse.cz> From: Rui Ueyama Date: Tue, 12 Jul 2022 19:50:19 +0800 Message-ID: Subject: Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: Richard Biener , Alexander Monakov , GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Tue, 12 Jul 2022 11:50:33 -0000 I'm fine, though I don't think I have a right to sign off. On Tue, Jul 12, 2022 at 3:36 PM Martin Li=C5=A1ka wrote: > > On 7/12/22 08:28, Richard Biener wrote: > > On Mon, Jul 11, 2022 at 6:35 PM Alexander Monakov = wrote: > >> > >> On Mon, 11 Jul 2022, Martin Li=C5=A1ka wrote: > >> > >>> I've clarified that linker should return a value that is in range > >>> [minimal_api_supported, maximal_api_supported] and added an abort > >>> if it's not the case. > >> > >> I noticed that we are placing a trap for C++ consumers such as mold > >> by passing min/max_api_supported as enum values. Unlike C, C++ disallo= ws > >> out-of-range enum values, so when mold does > >> > >> enum PluginLinkerAPIVersion { > >> LAPI_V0 =3D 0, > >> LAPI_V1, > >> }; > >> > >> get_api_version(const char *plugin_identifier, > >> unsigned plugin_version, > >> PluginLinkerAPIVersion minimal_api_supported, > >> PluginLinkerAPIVersion maximal_api_supported, > >> const char **linker_identifier, > >> const char **linker_version) { > >> > >> checks such as 'min_api_supported > LAPI_V1' can be optimized out. Als= o, > >> if a future tool passes LAPI_V2, it will trigger Clang's UBSan (GCC > >> -fsanitize-undefined=3Denum instruments loads but not retrieval of fun= ction > >> arguments). > >> > >> I'd suggest to fix this on both sides by changing the arguments to pla= in > >> integer types. > > > > That's a good point - the enum itself is then also somewhat redundant > > if it just specifies symbolic names for 0, 1, ... but we can keep it fo= r > > documentation purposes. > > All right, here we go with the integer types. > > May I install the version now? > > Thanks, > Martin > > > > >> > >> Alexander