Hi Andre

> On 1 Oct 2025, at 15:12, Andre Vehreschild <[email protected]> wrote:
> 

> while debugging a fortran runtime library on a recent MacOS, I tried to use 
> the
> libsanitizer provided with gcc. It compiled, but no asan enabled program could
> start on MacOS Sequoia. I figured from libsanitizers github, that the shared
> cache needs to be consulted from some OS version on.

Right, which is why I’d disabled it until we have support.

> The support present in
> github uses proprietary extensions to C++, that do not compile on gcc.

Well Apple Blocks are publicly specified and available on open source
clang, so I think that they are more “clang-extension” than “proprietary"
the barrier to implementing them in GCC is time only.

> I figured
> how to translate this into pure C++, which what the patch is about. The
> solution is somewhat hacky and I don't know what to do with it. It works,
> address faults are reported correctly at least on
> x86_64-apple-darwin24.something. I am open for suggestions what to do it.
> I do not assume, that upstream libsanitizer will apply the patch, because it 
> is
> GCC specific.

The API that needs to be emulated is “Apple Blocks” (which looks a bit like some
of the Objective-C stuff - but actually has more state).  We do not, yet, 
indeed support - so I think it might be necessary to apply some tweaks to
what you’ve done to make sure that the file-scope structures that the
blocks system requires are present - what works now might not in the future
unless we emulate the whole thing.

That work-around is in my WIP but not quite ready - so perhaps the two patches
can be combined.

> I tried to rebase GCC's libsanitizer to the github's state, but there are more
> locations where now proprietary extensions are used.

Do you mean “proprietary” or “clang” here?
 - AFAIU the sanitizers are still open-sourced.

> To not loose the patch, I
> thought I publish it here, so that at least some one may find it.

thanks, we do want a solution to this,
Iain

> 
> Regards,
> Andre
> -- 
> Andre Vehreschild * Email: vehre ad gmx dot de 
> <libsanitizer_for_macos_v1.patch>

Reply via email to