[cfe-dev] Objective-C blocks with a static runtime on Windows

vit9696 via cfe-dev cfe-dev at lists.llvm.org
Mon Jul 3 06:04:38 PDT 2017


Hello,

At this moment it is not possible to use blocks when linking to a static Objective-C runtime on Windows due to a patch applied in r271138 (http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160523/160244.html).

The idea of the patch appears to enforce dynamic linking with NSConcreteStackBlock, but this only results in an undefined reference to `__imp__NSConcreteStackBlock' when linking statically (with e.g. objfw).

There is a TODO in the added code, however, how can it be called a todo, when the added hack simply breaks block support when linking to static runtimes? It worked just fine before.

From what I understand the issue for no static block support is due to detection issues: there seems to be no obvious way to detect the runtime type until the linking step. 

Will it be ok to add an extra argument (e.g. -fblock-static-runtime) to disable the hacked code? Or could there be any other solution?

Vit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170703/bfea1a5f/attachment.html>


More information about the cfe-dev mailing list