<div dir="ltr">Thanks a lot, Jordan!<div><br></div><div>I have filed a bug <a href="https://bugs.swift.org/browse/SR-5962">here</a>. </div><div><br></div><div>Jeffrey</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-09-21 19:05 GMT-04:00 Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hm, I don’t see any inherent problems with splitting compilation like this, although it’s not something we test. The only thing I could think of is that Swift uses a custom calling convention on some platforms, but I would expect clang++ to refuse to compile the bc file at all if that were the issue. Mind filing a bug at <a href="https://bugs.swift.org" target="_blank">https://bugs.swift.org</a> ?</div><div><br></div><div>Thanks,</div><div>Jordan</div><div><br></div><br><div><blockquote type="cite"><div><div class="h5"><div>On Sep 21, 2017, at 13:42, Jeffrey W via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:</div><br class="m_4596004918809071942Apple-interchange-newline"></div></div><div><div><div class="h5"><div dir="ltr">Hi swift team,<div><br></div><div>I download the prebuilt swift 4.0 from <a href="https://swift.org/builds/swift-4.0-release/ubuntu1404/swift-4.0-RELEASE/swift-4.0-RELEASE-ubuntu14.04.tar.gz" target="_blank">here</a> and try to do some work on the generated LLVM BC. However, I got a seg fault when running the binary executable compiled from bitcode as shown below:</div><div><br></div><div><font color="#0000ff" face="monospace, monospace">$ cat hello.swift<br></font></div><div><div><font color="#0000ff" face="monospace, monospace">print("Hello World")</font></div><div><font color="#0000ff" face="monospace, monospace">$ swiftc hello.swift -emit-bc -o hello.bc</font></div><div><font color="#0000ff" face="monospace, monospace">$ clang++ hello.bc -c -o hello.o</font></div><div><font color="#0000ff" face="monospace, monospace">$ swiftc hello.o -o hello</font></div><div><font color="#0000ff" face="monospace, monospace">$ ./hello</font></div><div><font color="#0000ff" face="monospace, monospace">Segmentation fault (core dumped)</font></div><div><br></div><div>It works fine if no bitcode file is involved here.</div><div><br></div><div><font color="#0000ff" face="monospace, monospace">$ swiftc hello.swift -c -o hello.o</font></div><div><font color="#0000ff" face="monospace, monospace">$ swiftc hello.o -o hello</font></div><div><font color="#0000ff" face="monospace, monospace">$ ./hello</font></div><div><font color="#0000ff" face="monospace, monospace">Hello World</font></div><div><br></div><div>I am running Ubuntu 14.04.3 (kernel 4.8.0). I also encountered the same seg fault if I use the prebuilt swift 3.1.1</div></div><div><br></div><div>Is it the right way to compile the bitcode generated from swift? Or is it a bug in swift ?</div><div><br></div><div>Thanks a lot in advance!</div><div><br></div><div>Best regards,</div><div>Jeffrey</div><div><br></div></div></div></div>
______________________________<wbr>_________________<br>swift-users mailing list<br><a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br></div></blockquote></div><br></div></blockquote></div><br></div>