thx :) 在2021年6月24日星期四 UTC+8 下午11:35:05<th...@google.com> 写道:
> Hello, > > What you're talking about is not something that's currently supported by > gollvm. > > The way that the gollvm driver code is structured, each input file is > placed into one of three categories: Go source files, assembly files, and > "everything else". Files that fall into the third category are passed > directly to the linker, which is why you are seeing linker errors above. > > It seems possible that someone could write driver code that could read and > parse the *.ll file (converting it into LLVM IR) and then pass that on to > the back end (along with the IR from compile Go files), but this feature > doesn't currently exist at the moment. > > Thanks, Than > > > > On Thu, Jun 24, 2021 at 10:33 AM cy lee <190121...@gmail.com> wrote: > >> Hi, >> >> I get the .ll files from gollvm, and I know there is no way to get >> executable file by lli, but whether there are other ways can do this? >> >> here is the simple go code, *hello.go* >> >> >> >> *package mainimport "fmt"func main() { * >> * fmt.Println("hello world") * >> *}* >> >> Using commands as following, we can get .ll file >> >> *llvm-goc -S -emit-llvm hello.go -o hello.ll* >> >> and I try *llvm-goc hello.ll -o hello* , getting error >> >> */usr/bin/ld.gold:错误: hello.ll:1:14: invalid character* >> */usr/bin/ld.gold:错误: hello.ll:1:14: syntax error, unexpected $end* >> */usr/bin/ld.gold:错误: hello.ll: not an object or archive* >> >> Best wishes >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/4e480562-549c-496b-961c-589b7ee22b8fn%40googlegroups.com >> >> <https://groups.google.com/d/msgid/golang-nuts/4e480562-549c-496b-961c-589b7ee22b8fn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/d45fa06f-b4c5-4a37-bf73-c0a6cf576f02n%40googlegroups.com.