From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by sourceware.org (Postfix) with ESMTPS id 6D2653858412 for ; Mon, 11 Jul 2022 09:55:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6D2653858412 Received: by mail-qk1-x732.google.com with SMTP id y22so2302423qki.7 for ; Mon, 11 Jul 2022 02:55: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; bh=v75TmPxLdE4/wlumomQeN60ho6ph65bDCYwEiTEI5j0=; b=ZdsJz5J3JXcOm8hQWFpBk5BSNgbjP57yU4fNtF30njXcU3+nSb28P0Nzb2JiR/h7h3 HkyUOl9nMB+ImNPZ3ZwnswrTxP3ZBOJfDZxiwAyEnVas8WdVlFKAB1mHm2aFHQc53Vr9 pDip30Kzfm37jKdfyOym9z8l2RQA261eOHXY76QZR2MNPe+m4cDJ3jJMUl8Qlb3Eeo7j 2vCj3zyVkZV6m8n+8a7UrPXGQsgZGKhZxLU3Yy6zb8qXYiwLGiJf4TXqTlb/CY5t6ORF jBdsiJNY6QPexfEWHfGxhGUV8BOLsDmKV3Ej3dUdwWDQW6tsjHFZBB2UnPl/PY1ZdfNY ztuw== X-Gm-Message-State: AJIora+iYSJ+1egCc59hMiQeYEQtw2YIDIsVqPHlsfqfVDCawIheHSm4 48hfyRbhtMCkh8MlzRluDzATmxJM5oQTlPmY4rI= X-Google-Smtp-Source: AGRyM1tfFxOuwSNLAMs0kYnf+1NSpcLdcYDcNjJxYbXuykWMadTkDfzSPBXN3pNPLR0iGJLNjtWJN2cpsAPUSiFwqMw= X-Received: by 2002:a05:620a:a4c:b0:6b5:978f:2f99 with SMTP id j12-20020a05620a0a4c00b006b5978f2f99mr157298qka.4.1657533331775; Mon, 11 Jul 2022 02:55:31 -0700 (PDT) MIME-Version: 1.0 References: <803a0290-3909-b9c5-2461-b1740a00c63a@suse.cz> <146a46f1-3a56-48c5-386f-c15633cc6781@ispras.ru> <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> In-Reply-To: <862b4381-c377-ac7a-476c-e7ced3c29c2c@ispras.ru> From: Richard Biener Date: Mon, 11 Jul 2022 11:55:20 +0200 Message-ID: Subject: Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION To: Alexander Monakov Cc: Rui Ueyama , =?UTF-8?Q?Martin_Li=C5=A1ka?= , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: Mon, 11 Jul 2022 09:55:35 -0000 On Mon, Jul 11, 2022 at 11:16 AM Alexander Monakov wrote: > > On Mon, 11 Jul 2022, Rui Ueyama wrote: > > > > but ignoring min_api_supported is wrong, and assuming max_api_supported > 0 > > > is also wrong. It really should check how given [min; max] range intersects > > > with its own range of supported versions. > > > > Currently only one version is defined which is LAPI_V1. I don't think > > LAPI_UNSPECIFIED is a version number; rather, it's an unspecified > > value. No ordering should be defined between a defined value and an > > unspecified value. If LAPI_UNSPECIFIED < LAPI_V1, it should be renamed > > LAPI_V0. > > You still cannot rely on API guarantees of LAPI_V1 when the plugin does not > advertise it (thread safety of claim_file in this particular case). So with LAPI_UNSPECIFIED all the plugin gets is the linker name and version. Clarifying the documentation on LAPI_UNSPECIFIED might be nice, also what the expectation is on the linker when the plugin returns LAPI_UNSPECIFIED when it speficied minimal_api_supported == V1. "minimal_api_supported == LAPI_UNSPECIFIED" does not make much sense if using Ruis reading of this value? > And you still should check the intersection of supported API ranges > and give a sane diagnostic when min_api_supported advertised by the plugin > exceeds LAPI_V1 (though, granted, the plugin could error out as well in this > case). > > Alexander