> On Dec 19, 2015, at 6:53 PM, Chaitanya Mannem via swift-users > <swift-us...@swift.org> wrote: > > Hi, > > > I wanted to know if it is possible to compile swift code for bare metal. I > know there is a runtime but does swift depend on it to execute even if I > don't use those features?, can I disable them somehow. I was hoping that > since you can produce LLVM Bytecode that you can cross compile using the > arm-none-eabi toolchain for an embedded use-case > (http://www.ti.com/tool/ek-tm4c123gxl) > <http://www.ti.com/tool/ek-tm4c123gxl)>. Please tell me there's hope, I don't > want to use C++ :(
The code that emits runtime calls in IRGen is fairly well-factored. One thing you might experiment with is adding an `-fstandalone` flag that causes the compiler to diagnose any time it has to generate code with a runtime call. If you're willing to forgo the standard library and build from LLVM primitives up and always use -Ounchecked, you might be able to generate standalone binaries without a runtime dependency. You're on your own if you go that road though. -Joe
_______________________________________________ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev