From owner-freebsd-toolchain@FreeBSD.ORG Thu Jan 2 20:27:53 2014 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CD04762 for ; Thu, 2 Jan 2014 20:27:53 +0000 (UTC) Received: from nm35-vm5.bullet.mail.bf1.yahoo.com (nm35-vm5.bullet.mail.bf1.yahoo.com [72.30.238.77]) by mx1.freebsd.org (Postfix) with SMTP id 1285C1F92 for ; Thu, 2 Jan 2014 20:27:52 +0000 (UTC) Received: from [66.196.81.173] by nm35.bullet.mail.bf1.yahoo.com with NNFMP; 02 Jan 2014 20:22:19 -0000 Received: from [98.139.211.161] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 02 Jan 2014 20:22:19 -0000 Received: from [127.0.0.1] by smtp218.mail.bf1.yahoo.com with NNFMP; 02 Jan 2014 20:22:19 -0000 X-Yahoo-Newman-Id: 49682.48637.bm@smtp218.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: R9RzEoIVM1lQbiDwnTu4MqGLXCyYoDwss8pacTq65H0V6YS WuOn.cOswenDSNtk4qtq6JLeDLf9RnnIdATJFwdDPH29IFu38OBgs8i5Ft3q f9WOGmUP1tS7CzsBo5y9fzlje.77Wos1_diLsgh6E3lRHZbIAWSq1NwvyHxe hc90cH2lhHZ2AuhkDk4HEUUQZF7QqgUp7e8jlpjtlashoWUa6adFTl1.aLqa WcT78g9EOORUOg3kDQdz8eCCcWd1n7Pb0hBN1RjiEtcXQJQXUhnVcgcDrMMp MipioF9BjtdHQhIMhJxG3mcy5aqNDAo4949r435ipkhBfJ32UcGEJ8d9ID7Z p8bXe6MxdxINM_fIBoUQdyamRasaAKIZS3iI0BuPNy9bd0_SP4r3nnVuh_Dk yiF8fYfa2K_CE.YpZ5nZCb9YZUeSDNQkZcMJHDO_x00DGXiqsnrGjyrDzxDt YDXxir0QUIZcXKqqOi9Nm6Wm4pEO_DCbuk8lmYy9yTEugrpUdg_1vFxjkQm. qEr_HSG1.VuFj6i7lZpOOYxY.a5VNYRfZ1e_hHSK48oFOUYNPqKnqG7aKWuw 4r1tezWCgCFBBs0vzM6p1ZNayL6Gqdg1.e0spGUulITwICULlVo.Zn7gb0Kl 4zbUHQolZ5C.znypixF4btxSI73GycWqfvVEy8yaJu9VWYN4kXy5X.7Xg77d YUJ2wvQ24yJv5L9aatfwNQxzolyNk2IwUWnlHGEz4IoCzhGF0Mhn9Bvk6csM xpO7lvZg7Z0bufY5HNGPPrN1pbitxebap X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp218.mail.bf1.yahoo.com with SMTP; 02 Jan 2014 12:22:18 -0800 PST Message-ID: <52C5CA79.90706@FreeBSD.org> Date: Thu, 02 Jan 2014 15:22:17 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: David Chisnall Subject: Re: Apple's GCC 42 enhancements (was Re: [CFT] Experimental gcc update). References: <528A924A.8050904@FreeBSD.org> <529127F8.5080606@FreeBSD.org> <3826345B-E783-43C7-B4AB-A05C95C1A8A2@FreeBSD.org> In-Reply-To: <3826345B-E783-43C7-B4AB-A05C95C1A8A2@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: toolchain@FreeBSD.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jan 2014 20:27:53 -0000 Heloo and Happy New Year! On 24.11.2013 07:54, David Chisnall wrote: > On 23 Nov 2013, at 22:11, Pedro Giffuni 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 ) 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.