> On Dec 8, 2015, at 8:57 PM, Chris Lattner via swift-dev <swift-dev@swift.org> > wrote: > > On Dec 8, 2015, at 8:50 PM, Zhuowei Z via swift-dev <swift-dev@swift.org > <mailto:swift-dev@swift.org>> wrote: >> I'm currently working on adding support to the Swift compiler to allow it to >> target Android. > > Cool. Responding to one specific issue: > >> - What's the role of the special linker script, and what's the purpose of >> the conformance tables in shared libraries? I've commented the conformance >> table loading code out on Android; is that why 'print("Hello world")' prints >> out "String(" infinity? > > The linker script allows the compiler to be able to enumerate conformance > tables, which are part of reflection information. I’m not an expert in this > area (Joe Groff or John McCall could better respond) but I would completely > believe the are the reason for your print failure. print is defined as > taking an Any, and does a downcast to a protocol, and that is probably > failing.
Yes, this is exactly the problem. You'll need some way for the conformance sections from every .o file to be collected into a section of the final binary that the runtime can consult at runtime in swift_conformsToProtocol. Can the existing swift.ld script be adapted to work on Android? -Joe
_______________________________________________ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev