I noticed with importing CoreFoundation into swift-corelibs-foundation that we needed to pass -Xcc -fblocks to switfc to make it import a few things correctly on linux. I wonder if that is the same thing that is happening here too.
···
On Jan 18, 2016, at 8:31 AM, Daniel Eggert via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:
I’ve create a system module for libdispatch, but when I import it, I don’t see anything guarded by __BLOCKS__.
Is there something I need to do when defining the system module to make that work?
Or something when I use it?
/Daniel
% cat Package.swift
import PackageDescription
let package = Package(name: "CDispatch”)
this is very likely as __BLOCKS__ is only defined when you pass -fblocks.
though, I’m told the blocks layout from swift and the one from libblocks-runtime-dev is not the same so it will likely crash (because dispatch as I said in another thread, uses that layout to get to the function pointer stored there). but worth trying.
-Pierre
···
On Jan 18, 2016, at 8:58 AM, Philippe Hausler via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:
I noticed with importing CoreFoundation into swift-corelibs-foundation that we needed to pass -Xcc -fblocks to switfc to make it import a few things correctly on linux. I wonder if that is the same thing that is happening here too.
On Jan 18, 2016, at 8:31 AM, Daniel Eggert via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:
I’ve create a system module for libdispatch, but when I import it, I don’t see anything guarded by __BLOCKS__.
Is there something I need to do when defining the system module to make that work?
Or something when I use it?
/Daniel
% cat Package.swift
import PackageDescription
let package = Package(name: "CDispatch”)
How would I go about passing ‘-fblocks’ when building a module using ‘swift build’?
Should I file a bug to track this?
/Daniel
···
On 18 Jan 2016, at 18:00, Pierre Habouzit <phabouzit@apple.com> wrote:
this is very likely as __BLOCKS__ is only defined when you pass -fblocks.
though, I’m told the blocks layout from swift and the one from libblocks-runtime-dev is not the same so it will likely crash (because dispatch as I said in another thread, uses that layout to get to the function pointer stored there). but worth trying.
-Pierre
On Jan 18, 2016, at 8:58 AM, Philippe Hausler via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:
I noticed with importing CoreFoundation into swift-corelibs-foundation that we needed to pass -Xcc -fblocks to switfc to make it import a few things correctly on linux. I wonder if that is the same thing that is happening here too.
On Jan 18, 2016, at 8:31 AM, Daniel Eggert via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:
I’ve create a system module for libdispatch, but when I import it, I don’t see anything guarded by __BLOCKS__.
Is there something I need to do when defining the system module to make that work?
Or something when I use it?
/Daniel
% cat Package.swift
import PackageDescription
let package = Package(name: "CDispatch”)
I am not certain on `swift build` but for swift and swiftc it is `-Xcc -fblocks`.
My rule of thumb is that if any time there is something that does not meet initial expectations filing a bug is always appreciated (even if it is marked as a dup/not-to-be-fixed/etc)
···
On Jan 18, 2016, at 10:03 AM, Daniel Eggert <danieleggert@me.com> wrote:
How would I go about passing ‘-fblocks’ when building a module using ‘swift build’?
Should I file a bug to track this?
/Daniel
On 18 Jan 2016, at 18:00, Pierre Habouzit <phabouzit@apple.com> wrote:
this is very likely as __BLOCKS__ is only defined when you pass -fblocks.
though, I’m told the blocks layout from swift and the one from libblocks-runtime-dev is not the same so it will likely crash (because dispatch as I said in another thread, uses that layout to get to the function pointer stored there). but worth trying.
-Pierre
On Jan 18, 2016, at 8:58 AM, Philippe Hausler via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:
I noticed with importing CoreFoundation into swift-corelibs-foundation that we needed to pass -Xcc -fblocks to switfc to make it import a few things correctly on linux. I wonder if that is the same thing that is happening here too.
On Jan 18, 2016, at 8:31 AM, Daniel Eggert via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:
I’ve create a system module for libdispatch, but when I import it, I don’t see anything guarded by __BLOCKS__.
Is there something I need to do when defining the system module to make that work?
Or something when I use it?
/Daniel
% cat Package.swift
import PackageDescription
let package = Package(name: "CDispatch”)
On 18 Jan 2016, at 19:06, Philippe Hausler <phausler@apple.com> wrote:
I am not certain on `swift build` but for swift and swiftc it is `-Xcc -fblocks`.
My rule of thumb is that if any time there is something that does not meet initial expectations filing a bug is always appreciated (even if it is marked as a dup/not-to-be-fixed/etc)
On Jan 18, 2016, at 10:03 AM, Daniel Eggert <danieleggert@me.com> wrote:
How would I go about passing ‘-fblocks’ when building a module using ‘swift build’?
Should I file a bug to track this?
/Daniel
On 18 Jan 2016, at 18:00, Pierre Habouzit <phabouzit@apple.com> wrote:
this is very likely as __BLOCKS__ is only defined when you pass -fblocks.
though, I’m told the blocks layout from swift and the one from libblocks-runtime-dev is not the same so it will likely crash (because dispatch as I said in another thread, uses that layout to get to the function pointer stored there). but worth trying.
-Pierre
On Jan 18, 2016, at 8:58 AM, Philippe Hausler via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:
I noticed with importing CoreFoundation into swift-corelibs-foundation that we needed to pass -Xcc -fblocks to switfc to make it import a few things correctly on linux. I wonder if that is the same thing that is happening here too.
On Jan 18, 2016, at 8:31 AM, Daniel Eggert via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:
I’ve create a system module for libdispatch, but when I import it, I don’t see anything guarded by __BLOCKS__.
Is there something I need to do when defining the system module to make that work?
Or something when I use it?
/Daniel
% cat Package.swift
import PackageDescription
let package = Package(name: "CDispatch”)