Enable Block Support with Clang

Hi, I was wondering, what’s the correct way to enable clock suppot using Clang? Is there a configure switch within LLVM/CLANG/COMPILER-RT?

-Conrad

Hi, I was wondering, what’s the correct way to enable block support using Clang? Is there a configure switch/option within LLVM/CLANG/COMPILER-RT?

Here’s some additional information:

$ clang -v
clang version 1.1 (trunk 94144)
Target: powerpc-apple-darwin9
Thread model: posix

$ clang block.c
block.c:6:6: error: blocks support disabled - compile with -fblocks or pick a deployment target that supports them
int (^myBlock)(int) = ^(int num) {
^
block.c:6:23: error: blocks support disabled - compile with -fblocks or pick a deployment target that supports them
int (^myBlock)(int) = ^(int num) {
^
2 diagnostics generated.

Also, I have tried the following without success:

$ clang -fblocks block.c
Undefined symbols:
“__NSConcreteStackBlock”, referenced from:
__NSConcreteStackBlock$non_lazy_ptr in cc-c9MyZg.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
clang: error: linker command failed with exit code 1 (use -v to see invocation)

-Conrad

Hi Conrad,

This currently isn't as simple as just one configure switch. However,
my recent work on integrating compiler-rt should make this easier.

Note that currently clang doesn't really supporting targeting
PowerPC/Darwin9. It may work, but no one has done the work to make it
ABI compatible, for example.

- Daniel