[cfe-dev] Clang-cl and C Blocks extension
Shoaib Meenai via cfe-dev
cfe-dev at lists.llvm.org
Mon Jul 9 12:57:34 PDT 2018
(adding back cfe-dev)
You'll need to link against a blocks runtime library. compiler-rt provides one (under lib/BlocksRuntime). I haven't tried building that under Windows, but I do see some _WIN32 defines in the source code, so hopefully it should work?
From: Thorben Hasenpusch <t.hasenpusch at icloud.com>
Date: Monday, July 9, 2018 at 12:40 PM
To: Shoaib Meenai <smeenai at fb.com>
Subject: Re: [cfe-dev] Clang-cl and C Blocks extension
But sadly, when trying to link I get this error: LNK2001: unresolved external symbol __imp__NSConcreteStackBlock.
Do I have to link against something specific?
On 9. Jul 2018, at 21:32, Thorben Hasenpusch <t.hasenpusch at icloud.com<mailto:t.hasenpusch at icloud.com>> wrote:
Thank you! That did the trick.
On 9. Jul 2018, at 21:11, Shoaib Meenai <smeenai at fb.com<mailto:smeenai at fb.com>> wrote:
You can pass "-Xclang -fblocks" on the command line to pass the option to cc1 directly.
From: cfe-dev <cfe-dev-bounces at lists.llvm.org<mailto:cfe-dev-bounces at lists.llvm.org>> on behalf of cfe-dev <cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>>
Reply-To: Thorben Hasenpusch <t.hasenpusch at icloud.com<mailto:t.hasenpusch at icloud.com>>
Date: Monday, July 9, 2018 at 12:06 PM
To: cfe-dev <cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>>
Subject: [cfe-dev] Clang-cl and C Blocks extension
I’m trying to compile C code that uses the Blocks extension using clang-cl on Windows, via CMake’s LLVM-vs2014 toolset.
The compilation errors out, telling me I’d need to enable blocks by passing “-fblocks” to clang, however clang-cl doesn’t recognize that flag.
Anything I can do?
cfe-dev mailing list
cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev