Error while using -fblocks with clang and mingw

Hello,

i try to compile a small test programm with clang and the command line
option -fblocks.

clang -m32 -march=i686 -D__COCOTRON__ -DWINDOWS -D_GNU_SOURCE
-D__LITTLE_ENDIAN__ -D_FORTIFY_SOURCE=1 -x objective-c -fobjc-exceptions
-fconstant-string-class=NSConstantString -O2 -Wno-unknown-pragmas
-fmessage-length=0 --std=c99 -pipe
-Ic:/devel/tools/mingw64/lib/gcc/x86_64-w64-mingw32/4.7.1/include
-I../Cocotron/headers -fblocks -c main.m
x86_64-w64-mingw32-gcc.exe: error: unrecognized command line option
'-fblocks'
clang: error: assembler (via gcc) command failed with exit code 1 (use
-v to see invocation)
mingw32-make: *** [main.o] Error 1

Is this a mingw problem?

Regards

Stefan Hertenberger

Stefan,

(-llvm-dev, +cfe-dev, better to cfe-users?)

It's known bug.
http://llvm.org/bugs/show_bug.cgi?id=12920

Workaround:

1) Add -integrated-as
2) Don't use clang's gcc-as driver.
  $ clang -S -o xxx.s
  $ gcc -c xxx.s

I have no idea -fblocks would work for mingw.

...Takumi

Hello Takumi,

thank you for the reply :wink: sorry for using the wrong mailing list.

-integreted-as fixed the issue.

Regards Stefan