<div dir="ltr">Hey,<div><br></div><div>I&#39;m currently looking at building a portable version of the standard library (for targeting microcontrollers, kernel dev, etc).</div><div><br></div><div>The easiest way to cross compile Swift at the moment (that I can find) is to get swiftc to generate LLVM IR (-emit-ir), and use clang to build and cross compile. This obviously leaves the problem that there won&#39;t be a standard lib to link against on the target.</div><div><br></div><div>I figured that the best way to accomplish this would probably be to implement whatever stubs are necessary for the target (e.g. all the libc calls).</div><div><br></div><div>I am struggling to find the best way to build the standard library though. I&#39;ve got a copy of the stdlib files, have run gyb over all of the templates, and am attempting to get swiftc to compile everything and output a giant IR file.</div><div><br></div><div>I was wondering if there was an easier way to go about building a custom libswiftcore?</div><div><br></div><div>It would obviously be great to be able to use Swift in this way without an OS, as it would open up a lot of opportunities for use of the language (embedded development, etc).</div><div><br></div><div><br></div><div>Thanks,</div><div><br></div><div>Andy</div></div>