This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix PR sanitizer/55617
On Wed, Feb 06, 2013 at 07:14:07PM +0400, Alexander Potapenko wrote:
> > Alexander,
> > I never claimed full init priority support however FSF gcc on darwin currently
> > has no init priority support at all. Since Mike wanted to sort the destructors as
> > well as the constructors and this achieves usable intra-module init priority support
> > for FSF gcc darwin, I don't see why we don't take advantage of it. Especially
> > considering that the constructors and destructors will now always be sorted anyway.
> > Jack
> > ps We will have one advantage over clang's init priority support as we can use -flto
> > to combine all of the code modules (outside of libraries) into a single one for the
> > sorting of constructors/destructors. This allows the g++.dg/special/conpr-3.C execution
> > test case to operate properly on darwin with -flto. Again, remember that clang currently
> > at least supports init priority on a intra-module level. I am just trying to leverage
> > the sorting of constructors/destructors that we added for asan to achive the same
> > level of functionality in FSF gcc on darwin.
> >
>
> Jack,
> I understand and fully support your desire for intra-module ctor/dtor priority.
> My comment was meant to reply to Mike (sorry for top-posting it,
> again), who, as far as I understood him, wanted to see full
> init_priority support on Darwin, which IIUC can't be implemented
> without the proper linker support. LTO may help as a bandaid, but I
> don't think this solution scales well enough yet.
>
> Alex
Alex,
I have already opened a radr://13149612, "inter module constructor/destructor priority
support needed on darwin", and pinged the darwin linker developer on this issue.
Jack
ps Once we have init priority enabled on darwin in gcc trunk, I plan to open a radar about
the absence of support collating this at -O4 on clang. That should be easier to address and
might get Apple looking at the state of their init priority support again. IHMO, it would
be a start if they at least support inter-module priority support in clang's internal assembler.
I've been lobbying Apple for sometime to provide a stand-alone gas replacement based on
clang's internal assembler so we would eventually get such fixes through that.