Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Jan 2014 15:22:17 -0500
From:      Pedro Giffuni <pfg@FreeBSD.org>
To:        David Chisnall <theraven@FreeBSD.org>
Cc:        toolchain@FreeBSD.org
Subject:   Re: Apple's GCC 42 enhancements (was Re: [CFT] Experimental gcc update).
Message-ID:  <52C5CA79.90706@FreeBSD.org>
In-Reply-To: <3826345B-E783-43C7-B4AB-A05C95C1A8A2@FreeBSD.org>
References:  <528A924A.8050904@FreeBSD.org> <529127F8.5080606@FreeBSD.org> <3826345B-E783-43C7-B4AB-A05C95C1A8A2@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Heloo and Happy New Year!

On 24.11.2013 07:54, David Chisnall wrote:
> On 23 Nov 2013, at 22:11, Pedro Giffuni <pfg@freebsd.org> wrote:
>
>> I have particular interest in -fwritable-strings
>> and the block support, mostly with the idea of making our gcc
>> somewhat more compatible to clang.
> I would absolutely love to see our GCC have blocks support.  It would be very nice to be able to use blocks in libc.

It took me a while and I still have to do more review, but I finally 
have a patch for blocks support in gcc

http://people.freebsd.org/~pfg/patches/gcc/gcc-blocks.patch

(this only applies against -current for now)

I have been able to build an example test from wikipedia and 
devel/libdispatch, with a small caveat: You have to #define __block or 
else you get this message:

error: '__block' undeclared (first use in this function)


The behaviour is consistent with llvm-gcc though, as explained here:

https://bugs.launchpad.net/ubuntu/+source/llvm-gcc-4.2/+bug/483679

" looking at the LLVM/Clang documentation 
(http://clang.llvm.org/doxygen/InitPreprocessor_8cpp-source.html 
<http://clang.llvm.org/doxygen/InitPreprocessor_8cpp-source.html>) shows 
that __block is not actually a keyword, but a macro that is defined to 
be __attribute__((__blocks__(byref)))."

Not sure what to do about it, I had added a #define for it in Block.h 
since you have to link with -lBlocksRuntime anyways, but not everything 
includes Block.h (surely not the libdispatch tests).

Anyways, I will be revising the patch some more and will commit it 
somewhen next week.

Enjoy,

Pedro.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52C5CA79.90706>