<div dir="ltr"><span id="gmail-docs-internal-guid-fe637d5d-7fff-60e0-bece-06038779352e"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Hi all,</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Is it possible to compile assembler source code to llvm bitcode? And if yes, then how?</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">I’m trying to compile a project to llvm bitcode. The project has both C (.c) sources and some assembly(.S) sources. The </span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-style:italic;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">make </span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">compiles all sources to object (.o) files and then links them together. What I’m trying to do is replace all commands compiling to .o with ‘clang -c -emit-llvm ...’ to get bitcodes and then use “llvm-link” to link them together in one .bc. However the llvm-link fails as the bitcodes I got from .s files are not recognized as llvm bitcodes (the header does not correspond to llvm bitcode header).</span></p></span><br class="gmail-Apple-interchange-newline"><div>Best,</div><div>Anahit.</div></div>