Re: [go-nuts] gollvm for LLVM13

2021-09-23 Thread Khanh TN
Hi, Than Thanks a lot! It is working now. go version is "unknown" but it is okay. Khanh On Thursday, September 23, 2021 at 3:30:35 AM UTC+8 Khanh TN wrote: > I will try that. > Thanks for your support! > Khanh > > > On Wednesday, September 22, 2021 at 10:21:41 PM UTC

Re: [go-nuts] gollvm for LLVM13

2021-09-22 Thread Khanh TN
le of CLs > that should help. > > Please sync your gollvm client ; if you build with > 0f0479aa582cfa3bd9c17bd7d41d2e2bc9991958 for gollvm (plus tip of gofrontend > and LLVM llvmorg-13.0.0-rc3) that should work. > > Thanks, Than > > > On Tue, Sep 21, 2021 at 11:24 PM

[go-nuts] gollvm for LLVM13

2021-09-21 Thread Khanh TN
Hi, While running the latest commit of gollvm (with latest commit of gofrontend, libbacktrace, libffi) with LLVM13 (commit llvmorg-13.0.0-rc3), I encountered this error: llvm-project/build13/tools/gollvm/libgo/version.go:9:6: error: redefinition of 'ArchFamilyType' llvm-project/llvm/tools/gol

[go-nuts] gollvm for LLVM13

2021-09-21 Thread Khanh TN
Hi, While running the latest commit of gollvm (with latest commit of gofrontend, libbacktrace, libffi) with LLVM13, I encountered this error: llvm-project/build13/tools/gollvm/libgo/version.go:9:6: error: redefinition of 'ArchFamilyType' llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/runtime

Re: [go-nuts] Simplifying LLVM bitcode from gollvm

2021-09-14 Thread Khanh TN
So, I figured out this inline asm ends with a "checksum" then ".text". I think I can remove inline asm before this ".text" and keep the rest since it might be useful. Please correct me if I'm wrong. Thanks for your support! Khanh On Wednesday, September 15,

Re: [go-nuts] Simplifying LLVM bitcode from gollvm

2021-09-14 Thread Khanh TN
M UTC+8 th...@google.com wrote: > I feel as though we're getting into the realm of "what is the sound of one > hand clapping"... ? > > Than > > > On Mon, Sep 13, 2021 at 1:51 PM Ian Lance Taylor wrote: > >> On Mon, Sep 13, 2021 at 6:03 AM Khanh TN

Re: [go-nuts] Simplifying LLVM bitcode from gollvm

2021-09-13 Thread Khanh TN
Also, from what I understand, if noone imports my package, I can also remove the "module asm" lines at the start. Is that right? Khanh On Monday, September 13, 2021 at 9:18:20 AM UTC+8 Khanh TN wrote: > Hi, > Thanks, Than, for the answer. > So, if the .go file I'm c

Re: [go-nuts] Simplifying LLVM bitcode from gollvm

2021-09-12 Thread Khanh TN
"sync", then "sync" imports "runtime", and so on). > > On the other hand, Go export data is *way* smaller than the volume of > header information that would have to be consumed by a C++ compiler when > building your average C++ source file. > > Than

[go-nuts] Simplifying LLVM bitcode from gollvm

2021-09-09 Thread Khanh TN
A Helloworld written in C++ is around 75 lines in LLVM IR. However, a Helloworld written in Golang compiled with gollvm is around 900/1000 lines of .ll file. I produced the LLVM IR with instructions from https://go.googlesource.com/gollvm/ I'm using LLVM11, so, older compatible commit of gollvm

Re: [go-nuts] gollvm: LLVM11-compatible version

2021-05-13 Thread Khanh TN
> gofrontend: be0d2cc2df9f98d967c242594838f86362dae2e7 > libbacktrace: 5a99ff7fed66b8ea8f09c9805c138524a7035ece > libffi: 737d4faa00d681b4c758057f67e1a02d813d01c2 > > That seems to work for me. > > Than > > > On Thu, May 13, 2021 at 8:38 AM Khanh TN wrote: > >> Hi Than, >> The LLVM

Re: [go-nuts] gollvm: LLVM11-compatible version

2021-05-13 Thread Khanh TN
3, 2021 at 5:54 AM Khanh TN wrote: > >> Hi, I am upgrading to LLVM11, how can I run LLVM11-compatible gollvm? >> What are the commits of LLVM, gollvm and related libs should I checkout? >> >> Thanks! >> >> Regards, >> Khanh >> >> -- &

[go-nuts] gollvm: LLVM11-compatible version

2021-05-13 Thread Khanh TN
Hi, I am upgrading to LLVM11, how can I run LLVM11-compatible gollvm? What are the commits of LLVM, gollvm and related libs should I checkout? Thanks! Regards, Khanh -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this grou

Re: [go-nuts] gollvm: sys/unix error with LLVM10

2021-05-05 Thread Khanh TN
fix. > > Not sure if there is an easy workaround here-- when building older > versions of the tools you have to be prepared for this sort of thing. I am > sure that there are LLVM bugs fixed in version 11 that are still present in > V10, for example. > > Thanks, Than > &

[go-nuts] gollvm: sys/unix error with LLVM10

2021-05-05 Thread Khanh TN
Hi, I'm building a tool to analyze the LLVM bitcode of some Go code with gollvm. We are currently running LLVM10. We will migrate to LLVM11/12 but not sure when. I followed Than's instruction to build LLVM10-compatible gollvm from https://groups.google.com/g/golang-nuts/c/dMZ7vk_Rjzw/m/b1zYDOxLA

Re: [go-nuts] Building gollvm fails on the latest commit

2021-04-14 Thread Khanh TN
67e1a02d813d01c2 > > libbacktrace: 5a99ff7fed66b8ea8f09c9805c138524a7035ece > > > Cheers, Than > > On Wed, Apr 14, 2021 at 11:42 AM Khanh TN wrote: > >> Hi Ian, >> My project is currently running on LLVM10. >> If I want to use gollvm, do I just have to upg

Re: [go-nuts] Building gollvm fails on the latest commit

2021-04-14 Thread Khanh TN
Hi Ian, My project is currently running on LLVM10. If I want to use gollvm, do I just have to upgrade to the latest commits? Thanks Khanh On Wednesday, April 14, 2021 at 11:08:36 PM UTC+8 Khanh TN wrote: > Thanks, > I see it's hard to keep syncing with LLVM. They have new commits ever

Re: [go-nuts] Building gollvm fails on the latest commit

2021-04-14 Thread Khanh TN
ing. > > On Tue, Apr 13, 2021 at 7:30 PM Than McIntosh wrote: > >> Thanks for reporting. I'll look into sending a CL. >> >> Cheers, Than >> >> >> On Tue, Apr 13, 2021 at 6:09 PM Khanh TN wrote: >> >>> Hi, I'm building gollvm

[go-nuts] Building gollvm fails on the latest commit

2021-04-13 Thread Khanh TN
Hi, I'm building gollvm with both gollvm and LLVM on the latest commit. It fails and the error reads: [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23: error: ‘NoAlias’ was not declared in this scope if (AAResult != NoAlias) ^~~ [..]/llvm-project/

Re: [go-nuts] Gollvm produces bad LLVM IR

2021-04-12 Thread Khanh TN
if I still need help. Khanh On Tuesday, April 13, 2021 at 1:10:16 AM UTC+8 Khanh TN wrote: > Hi, > Thanks for your reply. > I'm trying to extract the LLVM bitcode from Go code for analysis. > I did build from the tip of both LLVM and gollvm. I believe it is LLVM 13 > on gith

Re: [go-nuts] Gollvm produces bad LLVM IR

2021-04-12 Thread Khanh TN
libgo/libffi, /gofrontend) you'd need to locate a git > commit close to that date. Or something to this effect. > > Can you tell me a bit more about your use case? Why not just use the most > recent version of gollvm (e.g. tip)? > > Thanks, Than > > > On Mon, Apr 12

Re: [go-nuts] Gollvm produces bad LLVM IR

2021-04-12 Thread Khanh TN
ere a manual on which version of LLVM should I build gollvm with and which version is the bitcode that -emit-llvm produces? Thanks, Khanh On Thursday, April 8, 2021 at 10:55:16 PM UTC+8 Khanh TN wrote: > Thanks. Looks like I need everything, including llc at LLVM11. I will > stick with

Re: [go-nuts] Gollvm produces bad LLVM IR

2021-04-08 Thread Khanh TN
you can then try "ninja llc", then use the > freshly built llc binary (found in ./bin) for your work. > > Thanks, Than > > > > On Thu, Apr 8, 2021 at 10:00 AM Khanh TN wrote: > >> Hi, >> Thanks for your reply. >> It's a bit weird. >>

Re: [go-nuts] Gollvm produces bad LLVM IR

2021-04-08 Thread Khanh TN
lpful to know what version of lli/llc you > were using. > > Thanks, Than > > > On Thu, Apr 8, 2021 at 2:33 AM Khanh TN wrote: > >> Hi, >> I'm following this page https://go.googlesource.com/gollvm to compile Go >> code the LLVM way. >> I'm at

[go-nuts] Gollvm produces bad LLVM IR

2021-04-07 Thread Khanh TN
Hi, I'm following this page https://go.googlesource.com/gollvm to compile Go code the LLVM way. I'm at the step "How do I see the LLVM IR generated by gollvm?" of the page. I'm doing exactly as the instruction. Gollvm produces a .ll file but the file has bad syntax. Running llvm-as (or llc, lli)

Re: [go-nuts] Re: Error running gollvm on Ubuntu 20.04

2021-03-15 Thread Khanh TN
wrote: > On Sat, Mar 13, 2021 at 4:51 PM Khanh TN wrote: > > > > Hi, Ian, > > It does look like importing golang.org/x/sys/unix causes the problem > > A simple go program like > > > > package main > > > > import ( > > "fmt" >

Re: [go-nuts] Re: Error running gollvm on Ubuntu 20.04

2021-03-13 Thread Khanh TN
cause the same error as before. This file builds and runs fine with my normal Go but gives that error with Gollvm. If I do not include unix, Gollvm does work though. What do you suggest? Khanh On Wednesday, March 10, 2021 at 11:14:19 AM UTC+8 Ian Lance Taylor wrote: > On Tue, Mar 9

Re: [go-nuts] Re: Error running gollvm on Ubuntu 20.04

2021-03-13 Thread Khanh TN
Hi Ian, "gold --version" gives me "GNU gold (GNU Binutils for Ubuntu 2.34) 1.16" "go list -m all" does list the module golang.org/x/sys. Does it help with the case? Thanks for your help. Khanh On Wednesday, March 10, 2021 at 11:14:19 AM UTC+8 Ian Lance Taylor wrote: > I'm not sure. What version

Re: [go-nuts] Re: Error running gollvm on Ubuntu 20.04

2021-03-09 Thread Khanh TN
Ah, thanks. I see. Let me investigate my case further. I will report back later, eh, if I remember to. Khanh On Wednesday, March 10, 2021 at 11:14:19 AM UTC+8 Ian Lance Taylor wrote: > On Tue, Mar 9, 2021 at 6:29 PM Khanh TN wrote: > > > > Thanks a lot for the fix! > >

[go-nuts] Re: Error running gollvm on Ubuntu 20.04

2021-03-09 Thread Khanh TN
ng normal Go, not gollvm, it builds just fine. Is there still a bug or is it on my end? Khanh On Wednesday, March 10, 2021 at 1:21:46 AM UTC+8 Khanh TN wrote: > Hi, I'm a newbie. > I built and installed gollvm with instructions from > https://go.googlesource.com/gollvm > The b

[go-nuts] Re: Error running gollvm on Ubuntu 20.04

2021-03-09 Thread Khanh TN
To clarify, I got an error on step "Using an installed copy of gollvm" of page https://go.googlesource.com/gollvm On Wednesday, March 10, 2021 at 1:21:46 AM UTC+8 Khanh TN wrote: > Hi, I'm a newbie. > I built and installed gollvm with instructions from > https://go

[go-nuts] Re: Error running gollvm on Ubuntu 20.04

2021-03-09 Thread Khanh TN
Looks like the same error as this one https://github.com/golang/go/issues/44861 . I'm just looking at their first comment on github, ignoring the lengthy bug report. On Wednesday, March 10, 2021 at 1:21:46 AM UTC+8 Khanh TN wrote: > Hi, I'm a newbie. > I built and insta

[go-nuts] Error running gollvm on Ubuntu 20.04

2021-03-09 Thread Khanh TN
Hi, I'm a newbie. I built and installed gollvm with instructions from https://go.googlesource.com/gollvm The build/installation was successful but it cannot run after installing. The step on the page "Using an installed copy of gollvm" is where the error happens. Running "go" gives me this error: