Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-13 Thread Rui Ueyama via Gcc-patches
On Tue, Jul 12, 2022 at 9:31 PM Martin Liška wrote: > > On 7/12/22 13:50, Rui Ueyama wrote: > > I'm fine, though I don't think I have a right to sign off. > > I've just pushed that. > > @Rui: Can you please merge the mold counter-part? I merged the mold counter-part as https://github.com/rui314/m

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-12 Thread Martin Liška
On 7/12/22 13:50, Rui Ueyama wrote: > I'm fine, though I don't think I have a right to sign off. I've just pushed that. @Rui: Can you please merge the mold counter-part? Thanks, Martin

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-12 Thread Richard Biener via Gcc-patches
On Tue, Jul 12, 2022 at 1:50 PM Rui Ueyama wrote: > > 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ška wrote: > > > > On 7/12/22 08:28, Richard Biener wrote: > > > On Mon, Jul 11, 2022 at 6:35 PM Alexander Monakov > > > wrote: > > >> >

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-12 Thread Rui Ueyama via Gcc-patches
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ška 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ška wrote: > >> > >>> I've clarifie

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-12 Thread Martin Liška
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ška 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

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Richard Biener via Gcc-patches
On Mon, Jul 11, 2022 at 6:35 PM Alexander Monakov wrote: > > On Mon, 11 Jul 2022, Martin Liška 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 pl

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Rui Ueyama via Gcc-patches
I updated my code so that it now acquires a lock before calling claim_file if v0. https://github.com/rui314/mold/commit/54fedf005fb35acdcb0408395aa403f94262190a On Mon, Jul 11, 2022 at 8:51 PM Martin Liška wrote: > > On 7/11/22 14:24, Rui Ueyama wrote: > > I updated my patch to support the propos

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Alexander Monakov via Gcc-patches
On Mon, 11 Jul 2022, Martin Liška 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_suppo

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Martin Liška
On 7/11/22 14:24, Rui Ueyama wrote: > I updated my patch to support the proposed API: > https://github.com/rui314/mold/commit/22bbfa9bba9beeaf40b76481d175939ee2c62ec8 > > Martin, > > I think you want to apply this patch. Currently, your API always > passes LAPI_V0 as the maximum API version. Are

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Alexander Monakov via Gcc-patches
On Mon, 11 Jul 2022, Rui Ueyama wrote: > I updated my patch to support the proposed API: > https://github.com/rui314/mold/commit/22bbfa9bba9beeaf40b76481d175939ee2c62ec8 This still seems to ignore the thread safety aspect. Alexander

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Rui Ueyama via Gcc-patches
I updated my patch to support the proposed API: https://github.com/rui314/mold/commit/22bbfa9bba9beeaf40b76481d175939ee2c62ec8 Martin, I think you want to apply this patch. Currently, your API always passes LAPI_V0 as the maximum API version. diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Martin Liška
On 7/11/22 11:55, Richard Biener wrote: > 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

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Richard Biener via Gcc-patches
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

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Alexander Monakov via Gcc-patches
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 L

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-11 Thread Rui Ueyama via Gcc-patches
On Fri, Jul 8, 2022 at 8:41 PM Alexander Monakov wrote: > > > On Fri, 8 Jul 2022, Martin Liška wrote: > > > Hi. > > > > All right, there's updated version of the patch that reflects the following > > suggestions: > > > > 1) strings are used for version identification > > 2) thread-safe API versio

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-08 Thread Alexander Monakov via Gcc-patches
On Fri, 8 Jul 2022, Martin Liška wrote: > Hi. > > All right, there's updated version of the patch that reflects the following > suggestions: > > 1) strings are used for version identification > 2) thread-safe API version (1) is not used if target does not support locking > via pthreads > >

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-08 Thread Martin Liška
Hi. All right, there's updated version of the patch that reflects the following suggestions: 1) strings are used for version identification 2) thread-safe API version (1) is not used if target does not support locking via pthreads Patch can bootstrap on x86_64-linux-gnu and survives regression

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-06 Thread Rui Ueyama via Gcc-patches
On Mon, Jul 4, 2022 at 10:17 PM Martin Liška wrote: > On 7/1/22 08:36, Richard Biener wrote: > > On Thu, Jun 30, 2022 at 10:42 AM Martin Liška wrote: > >> > >> On 6/30/22 08:43, Rui Ueyama wrote: > >>> Thanks Martin for creating this patch. > >> > >> You're welcome. > >> > >>> > >>> Here is a pr

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-04 Thread Martin Liška
On 7/1/22 08:36, Richard Biener wrote: > On Thu, Jun 30, 2022 at 10:42 AM Martin Liška wrote: >> >> On 6/30/22 08:43, Rui Ueyama wrote: >>> Thanks Martin for creating this patch. >> >> You're welcome. >> >>> >>> Here is a preliminary change for the mold side: >>> https://github.com/rui314/mold/co

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-30 Thread Richard Biener via Gcc-patches
On Thu, Jun 30, 2022 at 10:42 AM Martin Liška wrote: > > On 6/30/22 08:43, Rui Ueyama wrote: > > Thanks Martin for creating this patch. > > You're welcome. > > > > > Here is a preliminary change for the mold side: > > https://github.com/rui314/mold/commit/9ad49d1c556bc963d06cca8233535183490de605

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-30 Thread Martin Liška
On 6/30/22 08:43, Rui Ueyama wrote: > Thanks Martin for creating this patch. You're welcome. > > Here is a preliminary change for the mold side: > https://github.com/rui314/mold/commit/9ad49d1c556bc963d06cca8233535183490de605 > >

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-29 Thread Rui Ueyama via Gcc-patches
Thanks Martin for creating this patch. Here is a preliminary change for the mold side: https://github.com/rui314/mold/commit/9ad49d1c556bc963d06cca8233535183490de605 Overall the API is looking fine, though it is not clear what kind of value is expected as a linker version. A linker version is not

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-20 Thread Martin Liška
On 6/20/22 11:35, Richard Biener wrote: > I think this is OK. Can we get buy-in from mold people? Sure, I've just pinged Rui: https://github.com/rui314/mold/issues/454#issuecomment-1160419030 Martin

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-20 Thread Richard Biener via Gcc-patches
On Thu, Jun 16, 2022 at 2:25 PM Martin Liška wrote: > > On 6/16/22 10:00, Alexander Monakov wrote: > > On Thu, 16 Jun 2022, Martin Liška wrote: > > > >> Hi. > >> > >> I'm sending updated version of the patch where I addressed the comments. > >> > >> Patch can bootstrap on x86_64-linux-gnu and surv

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-16 Thread Martin Liška
On 6/16/22 10:00, Alexander Monakov wrote: > On Thu, 16 Jun 2022, Martin Liška wrote: > >> Hi. >> >> I'm sending updated version of the patch where I addressed the comments. >> >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >> >> Ready to be installed? > > I noticed a t

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-16 Thread Alexander Monakov via Gcc-patches
On Thu, 16 Jun 2022, Martin Liška wrote: > Hi. > > I'm sending updated version of the patch where I addressed the comments. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? I noticed a typo (no objection on the substance on the patch from me

[PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-06-16 Thread Martin Liška
Hi. I'm sending updated version of the patch where I addressed the comments. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin include/ChangeLog: * plugin-api.h (enum linker_api_version): New enum. (ld_plugin_get_api_ve