Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-16 Thread Jakub Jelinek via Gcc-patches
On Sat, Nov 13, 2021 at 08:32:41PM +, Iain Sandoe wrote: > IMO both this series > - which restores the ability to work with PIE exes but requires a known > address for the PCH > and the series I posted > - which allows a configuration to opt out of PCH anyway > > could be useful - for

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-13 Thread Iain Sandoe
Hi Folks, IMO both this series - which restores the ability to work with PIE exes but requires a known address for the PCH and the series I posted - which allows a configuration to opt out of PCH anyway could be useful - for Darwin I prefer this series. of course, it would be very nice to

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-10 Thread Iain Sandoe
Hi Folks, > On 10 Nov 2021, at 08:14, Iain Sandoe wrote: >> On 9 Nov 2021, at 12:18, Jakub Jelinek via Gcc-patches >> wrote: >> >> On Tue, Nov 09, 2021 at 11:40:08AM +, Iain Sandoe wrote: >>> There were two issues, of which one remains and probably affects all >>> targets. >>> 2. This

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-10 Thread Iain Sandoe
> On 9 Nov 2021, at 12:18, Jakub Jelinek via Gcc-patches > wrote: > > On Tue, Nov 09, 2021 at 11:40:08AM +, Iain Sandoe wrote: >> There were two issues, of which one remains and probably affects all targets. >> >> 1. The Darwin PCH memory allocation scheme used a system that works

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 09, 2021 at 10:23:19AM -0500, Andrew MacLeod wrote: > yeah, that doesnt work because range_query is a pure virtual. However, there > also does not seem to be any reason why we need to jump thru hoops since > get_range_query() doesn't need to be in function.h..   If I relocate it to >

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Andrew MacLeod via Gcc-patches
On 11/9/21 9:58 AM, Jakub Jelinek wrote: On Tue, Nov 09, 2021 at 09:41:08AM -0500, Andrew MacLeod wrote: Yeah, Im not particular about how we do this...  I think thats perfectly reasonable.   Would something like the following solve this issue? Yes, but see below. commit

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 09, 2021 at 09:41:08AM -0500, Andrew MacLeod wrote: > Yeah, Im not particular about how we do this...  I think thats perfectly > reasonable.   Would something like the following solve this issue? Yes, but see below. > commit 17a5b03c95549b5488bc8dd2af4f6e2cc9ddf098 > Author: Andrew

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Andrew MacLeod via Gcc-patches
On 11/9/21 7:29 AM, Jakub Jelinek wrote: On Tue, Nov 09, 2021 at 01:03:38PM +0100, Richard Biener wrote: Apparently the range_of_expr can handle some tree cases through range_query::get_tree_range, like INTEGER_CSTs, ADDR_EXPRs, and some binary and unary ops. But that shouldn't need a range

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 09, 2021 at 01:03:38PM +0100, Richard Biener wrote: > > Apparently the range_of_expr can handle some tree cases through > > range_query::get_tree_range, like INTEGER_CSTs, ADDR_EXPRs, > > and some binary and unary ops. > > But that shouldn't need a range query object ... this was all

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 09, 2021 at 11:40:08AM +, Iain Sandoe wrote: > There were two issues, of which one remains and probably affects all targets. > > 1. The Darwin PCH memory allocation scheme used a system that works reliably > for no-PIE but not for PIE > > .. I hacked in a similar scheme to

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Richard Biener via Gcc-patches
On Tue, 9 Nov 2021, Jakub Jelinek wrote: > On Tue, Nov 09, 2021 at 10:44:45AM +0100, Jakub Jelinek via Gcc-patches wrote: > > On Tue, Nov 09, 2021 at 08:12:05AM +0100, Richard Biener wrote: > > > > So, here is 1), 2), 3) implemented. With this patch alone, > > > > g++.dg/pch/system-2.C test

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Iain Sandoe
> On 9 Nov 2021, at 08:07, Iain Sandoe wrote: > > > >> On 9 Nov 2021, at 07:12, Richard Biener wrote: >> >> On Mon, 8 Nov 2021, Jakub Jelinek wrote: >> >>> On Mon, Nov 08, 2021 at 12:46:04PM +0100, Jakub Jelinek via Gcc-patches >>> wrote: So, if we want to make PCH work for PIEs,

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 09, 2021 at 10:44:45AM +0100, Jakub Jelinek via Gcc-patches wrote: > On Tue, Nov 09, 2021 at 08:12:05AM +0100, Richard Biener wrote: > > > So, here is 1), 2), 3) implemented. With this patch alone, > > > g++.dg/pch/system-2.C test ICEs. This is because GCC 12 has added > > >

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 08, 2021 at 04:03:09PM -0500, John David Anglin wrote: > On 2021-11-08 2:48 p.m., Jakub Jelinek wrote: > > Not really sure about PA or IA-64 function descriptors, are any of those > > allocated by the dynamic linker rather than created by the static linker? > On PA, the static linker

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 09, 2021 at 08:12:05AM +0100, Richard Biener wrote: > > So, here is 1), 2), 3) implemented. With this patch alone, > > g++.dg/pch/system-2.C test ICEs. This is because GCC 12 has added > > function::x_range_query member, which is set to _ranges on > > cfun creation and is: > >

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-09 Thread Iain Sandoe
> On 9 Nov 2021, at 07:12, Richard Biener wrote: > > On Mon, 8 Nov 2021, Jakub Jelinek wrote: > >> On Mon, Nov 08, 2021 at 12:46:04PM +0100, Jakub Jelinek via Gcc-patches >> wrote: >>> So, if we want to make PCH work for PIEs, I'd say we can: >>> 1) add a new GTY option, say callback, which

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-08 Thread Richard Biener via Gcc-patches
On Mon, 8 Nov 2021, Jakub Jelinek wrote: > On Mon, Nov 08, 2021 at 12:46:04PM +0100, Jakub Jelinek via Gcc-patches wrote: > > So, if we want to make PCH work for PIEs, I'd say we can: > > 1) add a new GTY option, say callback, which would act like > >skip for non-PCH and for PCH would make us

Re: [PATCH] pch: Add support for PCH for relocatable executables

2021-11-08 Thread John David Anglin
On 2021-11-08 2:48 p.m., Jakub Jelinek wrote: Not really sure about PA or IA-64 function descriptors, are any of those allocated by the dynamic linker rather than created by the static linker? On PA, the static linker creates all function descriptors.  The dynamic linker is responsible for

[PATCH] pch: Add support for PCH for relocatable executables

2021-11-08 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 08, 2021 at 12:46:04PM +0100, Jakub Jelinek via Gcc-patches wrote: > So, if we want to make PCH work for PIEs, I'd say we can: > 1) add a new GTY option, say callback, which would act like >skip for non-PCH and for PCH would make us skip it but >remember for address bias