Re: [go-nuts] [gollvm] Are there any plans to sync with LLVM16 or above?

2024-02-26 Thread 'Than McIntosh' via golang-nuts
Hi Sophie, Thanks for the question. The chief blocker for updating gollvm to later versions of LLVM trunk is dealing with LLVM's opaque pointer migration in the gollvm bridge

Re: [go-nuts] [GOLLVM] Running LLI on LLVM Bitcode Fails with Recommended Setting

2023-08-09 Thread 'Than McIntosh' via golang-nuts
Hi, Looks like things are crashing while trying to read your bitcode, but other than that I am not sure what the issue might be ( I don't think I have seen that failure mode before). Sorry, this is not super helpful. Best regards, Than On Tue, Aug 8, 2023 at 11:10 PM Md. Sakib Anwar wrote: >

Re: [go-nuts] Using LLVM based fuzzing tools (KLEE) on IR produced by gollvm

2023-05-30 Thread 'Than McIntosh' via golang-nuts
Hello, I assume that the fuzzing works by running the LLVM bitcode through the interpreter? If so then these threads here are related: https://groups.google.com/g/golang-nuts/c/raheTfR_Syk/m/-9FaVnKqAwAJ https://groups.google.com/g/golang-nuts/c/9lSni3jhXhA/m/KQzlRJtoBAAJ As you can see from htt

Re: [go-nuts] gollvm build fails

2023-02-01 Thread 'Than McIntosh' via golang-nuts
Hello, The gollvm build with LLVM tip is currently broken; there have been some upstream LLVM changes that aren't compatible with the Gollvm bridge code (notably the opaque pointer migration), which causes build failures. This is a known problem, I haven't had enough free time to fix it recently.

Re: [go-nuts] GoLLVM: using the result of `go build -x . ` to rebuild the program got failed

2022-10-27 Thread 'Than McIntosh' via golang-nuts
>/data/mygo/gollvm_workarea/install/bin/llvm-goc: error: unrecognized command line option '-fgo-importcfg=/dev/null' The Go command only passes this option to the compiler if it thinks that the compiler is the main go compiler ("gc") as opposed to gollvm. What output do you get when you run "go ve

Re: [go-nuts] gollvm build fails

2022-10-25 Thread 'Than McIntosh' via golang-nuts
Weird. I am scratching my head. At this point if I was debugging it myself on your system I would rerun cmake passing it the "--trace-expand" flag (which will generate giant volumes of output), then look in the trace to see what is happening when the cmake rules in question fire. You should see so

Re: [go-nuts] gollvm build fails

2022-10-20 Thread 'Than McIntosh' via golang-nuts
>There is no zgoarch.go file in the build area. It seems that it was not created by the build system. I've oversimplified things a bit -- what cmake does is write out tools/gollvm/libgo/zgoarch.go.tmp, and then add a build rule for zgoarch.go that copies the *.tmp file to the *.go file if they are

Re: [go-nuts] gollvm build fails

2022-10-19 Thread 'Than McIntosh' via golang-nuts
Hi, Those constants are supposed to be defined in the generated file /tools/gollvm/libgo/zgoarch.go, which is written as out part of the gollvm build process, e.g. here https://go.googlesource.com/gollvm/+/253c122ed62d5e9a32a9806e83c47a389a6435bf/cmake/modules/AutoGenGo.cmake#63 What does the zg

Re: [go-nuts] [gollvm] build fail

2022-05-16 Thread 'Than McIntosh' via golang-nuts
Apologies, looks like I picked the wrong LLVM hash. Please try llvm-project commit 09629215c272f09e3ebde6cc7eac9625d28910ff Cheers Than On Mon, May 16, 2022 at 10:38 AM Than McIntosh wrote: > Hi, > > Thanks for your interest in Gollvm. > > The gollvm build is broken at tip at the moment; due

Re: [go-nuts] [gollvm] build fail

2022-05-16 Thread 'Than McIntosh' via golang-nuts
Hi, Thanks for your interest in Gollvm. The gollvm build is broken at tip at the moment; due to competing demands on my time, I haven't been able to work on this problem. Your patience is abbreviated. For now I suggest building with slightly older versions of the LLVM and related repos. For exa

Re: [go-nuts] [gollvm] Test for GoLLVM?

2022-04-13 Thread 'Than McIntosh' via golang-nuts
>Any ideas about running the tests under go/test directory Yes, as you surmise it would be mainly about developing the appropriate test harness. We haven't done anything in that direction for gollvm, but it seems doable overall. Than On Tue, Apr 12, 2022 at 3:20 AM Lanzhiguan Huang wrote: > H

Re: [go-nuts] Dynamically loading custom passes with gollvm?

2022-04-12 Thread 'Than McIntosh' via golang-nuts
It would not be too hard to add this though. Want to send a patch? >>Ohh! Yes please, that'll be very helpful for our experiments. >>Thank you so much. I think you misunderstood my comment. I was asking if you would like to send a patch yourself. Thanks, Than On Mon, Apr 11, 2022 at 1

Re: [go-nuts] Dynamically loading custom passes with gollvm?

2022-04-11 Thread 'Than McIntosh' via golang-nuts
Hello, At the moment gollvm doesn't support anything like the "-Xclang -load -Xclang ...". It would not be too hard to add this though. Want to send a patch? Thanks, Than On Sun, Apr 10, 2022 at 3:47 PM Balamurugan Marimuthu wrote: > Yes, something like that! I basically want to run my custo

Re: [go-nuts] gollvm build failed

2022-02-28 Thread 'Than McIntosh' via golang-nuts
Hello, Normally the definition of __morestack is drawn from libgcc.a, so I would look to see what the story is with libgcc.a on your system. Here are some things to try: // Ask clang where it's picking up libgcc.a $ clang --print-libgcc-file-name /usr/bin/../lib/gcc/x86_64-linux-gnu/11/libgcc.a

Re: [go-nuts] [gollvm]: Build failed: error: undefined reference to 'runtime_1internal_1syscall.setErrno'

2022-02-24 Thread 'Than McIntosh' via golang-nuts
OK, I have checked in a fix for this issue (gollvm commit 9bc0905a2f6697eff106b159120030a0e81bd113). Regards, Than On Thu, Feb 24, 2022 at 10:35 AM Than McIntosh wrote: > Greetings, > > Thanks for reporting this problem. I'll send a patch shortly. > > Thanks, Than > > > On Wed, Feb 23, 2022 at

Re: [go-nuts] [gollvm]: Build failed: error: undefined reference to 'runtime_1internal_1syscall.setErrno'

2022-02-24 Thread 'Than McIntosh' via golang-nuts
Greetings, Thanks for reporting this problem. I'll send a patch shortly. Thanks, Than On Wed, Feb 23, 2022 at 8:54 AM Richiise Nugraha wrote: > Hi, tried to build gollvm but encountered this error: > > libbacktrace commit: 2446c66076480ce07a6bd868badcbceb3eeecc2e > libffi commit: ab1677106605

Re: [go-nuts] Re: gollvm compilation issue

2022-02-09 Thread 'Than McIntosh' via golang-nuts
OK, I checked in another CL to resolve this new issue. Give it a try again please and let me know if you are able to build. Thanks, Than On Wed, Feb 9, 2022 at 2:35 PM Than McIntosh wrote: > Thanks for the report. I'll take a look... > > Than > > On Wed, Feb 9, 2022 at 2:33 PM Zhen Huang > wr

Re: [go-nuts] Re: gollvm compilation issue

2022-02-09 Thread 'Than McIntosh' via golang-nuts
Thanks for the report. I'll take a look... Than On Wed, Feb 9, 2022 at 2:33 PM Zhen Huang wrote: > Thank you for the prompt response! I checked out the updated code and the > previous compilation error is gone. However, another compilation error came > up: > > [183/1626] Building CXX object > t

Re: [go-nuts] decoding DWARF data

2022-02-07 Thread 'Than McIntosh' via golang-nuts
For general information on DWARF and inlining, you might look at this design doc: https://github.com/golang/proposal/blob/master/design/22080-dwarf-inlining.md#example which describes the changes made to the compiler to add DWARF inlining support. HTH. Thanks, Than On Sat, Feb 5, 2022 at 4:44

Re: [go-nuts] gollvm build failed

2022-01-27 Thread 'Than McIntosh' via golang-nuts
Hello, As I understand it FreeBSD doesn't have any concept of a build essentials package, so in theory /usr/include/malloc.h should always be installed. Are you saying that this file doesn't exist on your system? Thanks, Than On Thu, Jan 27, 2022 at 5:38 AM T Odin wrote: > I'm trying to build

Re: [go-nuts] Help with GOLLVM

2022-01-04 Thread 'Than McIntosh' via golang-nuts
Hi, >>The whole point of my poc was to be able to get the LLVMIR of GO then put it into an iOS app with bitcode enable. What are you saying is that it is not possible to achieve this? It's definitely outside the normal/expected use of gollvm, but it seems at least possible to do this. The key th

Re: [go-nuts] Help with GOLLVM

2021-12-16 Thread 'Than McIntosh' via golang-nuts
Greetings, The code that Go compilers emit is closely tied to the Go runtime-- any compiled Go code (including *.ll files) will have references to symbols that it needs from the runtime. When you try to convert your LLVM-produced bitcode into a binary via clang helloworld.ll -o helloworldLLVM yo

Re: [go-nuts] Unable to build gollvm: missing and no known rule to make it

2021-11-22 Thread 'Than McIntosh' via golang-nuts
Hi, Sorry for the misunderstanding-- When I said "from build area root" I am talking about the directory where you are running "ninja", not the directory that contains the source code for gollvm. Within your gollvm git repo, you will definitely still need the "libgo" subdir. So let's say that yo

[go-nuts] [security] Go 1.17.3 and Go 1.16.10 are released

2021-11-04 Thread 'Than McIntosh' via golang-nuts
Hi gophers, We have just released Go versions 1.17.3 and 1.16.10, minor point releases. These minor releases include two security fixes following the security policy : - archive/zip: don't panic on (*Reader).Open Reader.Open (the API implementing io/fs.FS int

Re: [go-nuts] gollvm for LLVM13

2021-09-22 Thread 'Than McIntosh' via golang-nuts
Hi, I've been in the process of updating gollvm to sync with the recently submitted Go 1.17 changes in gofrontend. I just checked in a couple of CLs that should help. Please sync your gollvm client ; if you build with 0f0479aa582cfa3bd9c17bd7d41d2e2bc9991958 for gollvm (plus tip of gofrontend and

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

2021-09-13 Thread 'Than McIntosh' via golang-nuts
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 wrote: > > > > Also, from what I understand, if noone imports my package, I can also > remove

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

2021-09-10 Thread 'Than McIntosh' via golang-nuts
Hi, The "module asm" at the start of your bitcode dump is actually the export data for the package, so it plays a pretty crucial role. Deleting the export data from the "main" package may work in some cases (since nobody imports main), but it will certainly cause problems if you delete the export

[go-nuts] [security] Go 1.17.1 and Go 1.16.8 are released

2021-09-09 Thread 'Than McIntosh' via golang-nuts
Hello gophers, We have just released Go versions 1.17.1 and 1.16.8 minor point releases. These minor releases include a security fix according to the new security policy (#44918 ). The fix for CVE-2021-33196 can be bypassed by crafted inputs. As a result, the NewR

Re: [go-nuts] Understanding gollvm garbage collection

2021-07-12 Thread 'Than McIntosh' via golang-nuts
>Also does gollvm create a new stack map? I think it does not use the stack map created by LLVM. gollvm does not use stack maps of the format used by LLVM, correct. Than On Fri, Jul 9, 2021 at 11:17 AM Kavindu Gimhan Zoysa wrote: > Also does gollvm create a new stack map? I think it does not

Re: [go-nuts] Understanding gollvm garbage collection

2021-07-09 Thread 'Than McIntosh' via golang-nuts
>1. If we do not enable the gc (-enable-gc=1), GC assumes all the stack memory blocks are pointed to the heap. >2. If gc is enabled, it inserts statepoints and generates the stack map (by LLVM). Using that stack map, GC can find where the actual heap references are located. Yes, this is basically

Re: [go-nuts] Reason to use different address space in gollvm

2021-07-07 Thread 'Than McIntosh' via golang-nuts
Hi again, Sorry for the delay, I have been offline for a while. You wrote: >Regarding address spaces, I saw that there is a pass to remove address space casts. But if I generate IR using `llvm-goc -dump-ir -enable-gc=1 test.go` for the following go file, I still can see the addrspacecast instruct

Re: [go-nuts] Re: Reason to add a pass to remote address space

2021-07-02 Thread 'Than McIntosh' via golang-nuts
The commit message for https://go-review.googlesource.com/c/152001 describes the motivation for this pass. Thanks, Than On Fri, Jul 2, 2021 at 4:51 AM Kavindu Gimhan Zoysa wrote: > Hi all, > > The subject of the above mail should be corrected as " > *Reason to add a pass to remove address spa

Re: [go-nuts] Hi all,

2021-06-29 Thread 'Than McIntosh' via golang-nuts
OK, fix https://go-review.googlesource.com/c/gollvm/+/331729 submitted. Thanks for reporting. Than On Tue, Jun 29, 2021 at 1:30 PM Than McIntosh wrote: > I sent a CL to fix this, please stay tuned. > https://go-review.googlesource.com/c/gollvm/+/331729 > > Thanks, Than > > > On Sun, Jun 27, 20

Re: [go-nuts] Re: Error when running llvm-goc

2021-06-29 Thread 'Than McIntosh' via golang-nuts
You wrote: >If I run `go build test.go`, when does llvm-goc executable start to run? Does go build command replace its' existing compiler with llvm-goc? The "go" command, the program that orchestrates the building of Go programs, runs 'llvm-goc' at each point where it needs to compile a Go package

Re: [go-nuts] Hi all,

2021-06-29 Thread 'Than McIntosh' via golang-nuts
I sent a CL to fix this, please stay tuned. https://go-review.googlesource.com/c/gollvm/+/331729 Thanks, Than On Sun, Jun 27, 2021 at 12:22 AM Kavindu Gimhan Zoysa wrote: > Hi, > > *cmake -DCMAKE_INSTALL_PREFIX=/my/install/dir -DCMAKE_BUILD_TYPE=Release > -DLLVM_USE_LINKER=gold -G Ninja ../llv

Re: [go-nuts] Reason to use different address space in gollvm

2021-06-29 Thread 'Than McIntosh' via golang-nuts
See https://llvm.org/docs/Statepoints.html for more on this. Thanks, Than On Mon, Jun 28, 2021 at 5:40 AM Kavindu Gimhan Zoysa wrote: > Hi all, > > Can you please explain the reason to use different address space when GC > is enabled as shown in the below line? > > > https://go.googlesource.co

Re: [go-nuts] How to verify whether gollvm is picked

2021-06-29 Thread 'Than McIntosh' via golang-nuts
If would help if you could share your exact cmake invocation I think. If your cmake invocation looks like cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX=/tmp/myinstall \ -DCMAKE_C_COMPILER=/usr/bin/clang-10 \ -DCMAKE_ASM_COMPILER=/usr/bin/clang-10 \ -DCMAKE_CXX_

Re: [go-nuts] Re: Error when running llvm-goc

2021-06-25 Thread 'Than McIntosh' via golang-nuts
Hello again, Couple of things. First, it is important to keep in mind that the "llvm-goc" binary is not intended to be used as a top level go compiler, in the same way that the "gcc" or "clang" commands are used as top-level C/C++ compilers. The normal use case is to use "go build" as opposed to

Re: [go-nuts] Re: Error when running llvm-goc

2021-06-24 Thread 'Than McIntosh' via golang-nuts
Could you please post the complete "go build" command? Thanks, Than On Thu, Jun 24, 2021 at 2:05 PM Kavindu Gimhan Zoysa wrote: > Hi all, > > Still, I was unable to figure out the reason for the above error. Really > appreciate your help. > > Thank you, > Kavindu > > On Thursday, 24 June 2021 a

Re: [go-nuts] Hi all,

2021-06-24 Thread 'Than McIntosh' via golang-nuts
This change has been submitted; if you update your gollvmn repo you should be able to build cleanly now. Thanks, Than On Thu, Jun 24, 2021 at 9:22 AM Than McIntosh wrote: > Hello, > > I sent a CL to fix this problem: > https://go-review.googlesource.com/c/gollvm/+/330609. I'll let you know > w

Re: [go-nuts] How to get the executable file from LLVM IR generated by gollvm

2021-06-24 Thread 'Than McIntosh' via golang-nuts
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 p

Re: [go-nuts] How does stack overflow handles in gollvm

2021-06-24 Thread 'Than McIntosh' via golang-nuts
Hello, If you go into your LLVM IR dump and look at the place where the function is defined, you'll see a reference to an attribute set, e.g. define void @main.foo(i8* nest %nest.1) #0 !dbg !16 { Here "#0" refers to this attribute set (appearing later in the dump): attributes #0 = { "disable-

Re: [go-nuts] Hi all,

2021-06-24 Thread 'Than McIntosh' via golang-nuts
Hello, I sent a CL to fix this problem: https://go-review.googlesource.com/c/gollvm/+/330609. I'll let you know when it is submitted. Thanks, Than On Wed, Jun 23, 2021 at 5:30 PM Than McIntosh wrote: > Hi, > > I'll take a look -- stay tuned. > > Than > > > On Wed, Jun 23, 2021 at 3:04 PM Kavi

Re: [go-nuts] Hi all,

2021-06-23 Thread 'Than McIntosh' via golang-nuts
Hi, I'll take a look -- stay tuned. Than On Wed, Jun 23, 2021 at 3:04 PM Kavindu Gimhan Zoysa wrote: > By following `gollvm` document I started to build it. But I got this error > in the middle of the build process. > > */home/kavindu/GIT/llvm-project/llvm/tools/gollvm/passes/GC.cpp:20:10: >

Re: [go-nuts] How to compile a go program which uses cgo to llvm IR?

2021-06-10 Thread 'Than McIntosh' via golang-nuts
Hello, As described in https://go.googlesource.com/gollvm/#seetheir, you will generally want to run "go build" in order to see the correct invocation of llvm-goc for your use case. In your case (building a Go file that uses CGO), there is a lot happening "under the hood" when you do the build --

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

2021-05-13 Thread 'Than McIntosh' via golang-nuts
Try this config for LLVM 11: LLVM: 43ff75f2c3feef64f9d73328230d34dac8832a91 gollvm: 44a7a475cfd3b871b7a5a0941b8ab1ea9d489adc gofrontend: be0d2cc2df9f98d967c242594838f86362dae2e7 libbacktrace: 5a99ff7fed66b8ea8f09c9805c138524a7035ece libffi: 737d4faa00d681b4c758057f67e1a02d813d01c2 That seems to w

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

2021-05-13 Thread 'Than McIntosh' via golang-nuts
What is the SHA in LLVM git corresponding to the official LLVM 11 release? Than On Thu, May 13, 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! > > Reg

Re: [go-nuts] how gollvm produces a project llvm-ir

2021-05-10 Thread 'Than McIntosh' via golang-nuts
Hi, I looked over the gllvm sources, looks interesting. There is no equivalent for gollvm, someone would need to contribute it. I don't see any fundamental reason why it would not work, but I am sure there would be challenges and wrinkles. One thing to note is that gllvm is emitteding bitcode (*.

Re: [go-nuts] how gollvm produces a project llvm-ir

2021-05-10 Thread 'Than McIntosh' via golang-nuts
Hi, It wasn't clear from your email exactly what you are doing or what the error was you encountered (grepping in the gollvm/LLVM sources didn't turn up any error code similar to "unable to locate ParamAttr enum"), but I think it is safe to say that this isn't a supported use case for gollvm, at l

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

2021-05-05 Thread 'Than McIntosh' via golang-nuts
Hi, I think what you are seeing is basically a consequence of building an older version of gollvm -- the version you are building doesn't include newer bug fixes in the gofrontend version of the go command. The fix you need is in a gofrontend commit ( c948c2d770122932a05b62f653efa2c51f72d3ae ) th

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

2021-04-14 Thread 'Than McIntosh' via golang-nuts
Hi again, Not quite sure what you are asking-- If you want to generated LLVM bitcode and then use that with your version 10 llvm tools, then you'll either need to build a version-10 compatible gollvm, or you'll need to upgrade the LLVM used by your tools/project. You can try building a V10-compa

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

2021-04-14 Thread 'Than McIntosh' via golang-nuts
OK, I checked in https://go-review.googlesource.com/c/gollvm/+/310069, should be resolved now. Thanks for reporting. 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: >

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

2021-04-13 Thread 'Than McIntosh' via golang-nuts
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 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:

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

2021-04-12 Thread 'Than McIntosh' via golang-nuts
Hi, At the moment gollvm does not put out releases per se, meaning that really the only thing that is advertised as working is the current LLVM tip plus the current gollvm tip at a given moment in time. If you wanted to create a version of gollvm for an older LLVM release (ex: LLVM 10), you would

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

2021-04-08 Thread 'Than McIntosh' via golang-nuts
>It outputs a hello.ll file. LLVM11 can process it but 10.0.1 and 13git cannot >Would love to hear your feedback. Maybe I need the exact LLVM version that gollvm is targeting? Yes, that is correct. The LLVM IR dump format (*.ll files) tends to change over time and from release to release, it isn't

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

2021-04-08 Thread 'Than McIntosh' via golang-nuts
Hi, Can you be a bit more specific, e.g. what Go code you compiler and what error you saw? It would also be helpful 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

Re: [go-nuts] gollvm hasn't a good support to reflect and pthread?

2021-03-30 Thread 'Than McIntosh' via golang-nuts
Thank you @Ugorji Nwoke , I appreciate your going the extra mile to include gollvm in your testing. Cheers, Than On Tue, Mar 30, 2021 at 11:17 AM Ugorji Nwoke wrote: > Ugorji here - author of the github.com/ugorji/go/codec > package. > > The no

Re: [go-nuts] gollvm hasn't a good support to reflect and pthread?

2021-03-29 Thread 'Than McIntosh' via golang-nuts
Hi, *>Thanks for your attention, but I tried to write a demo with go:linkname.* *>In fact, it works well with gollvm...So maybe it is not the exact cause for the problem* The problem is not that gollvm fails to implement go:linkname-- the problem is the way that this package (http://github.com/ug

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

2021-03-09 Thread 'Than McIntosh' via golang-nuts
Thanks Ian, yes, that seems likely. I will look into sending a patch. Than On Tue, Mar 9, 2021 at 1:23 PM Ian Lance Taylor wrote: > On Tue, Mar 9, 2021 at 9:21 AM Khanh TN wrote: > > > > Hi, I'm a newbie. > > I built and installed gollvm with instructions from > https://go.googlesource.com/go

Re: [go-nuts] Incompatibility of reflection libraries (reflect versus go-reflect), on json-iterator (Go 1.15.8)

2021-02-26 Thread 'Than McIntosh' via golang-nuts
My sense is that developers are using packages like reflect2 for performance reasons, very often to try to improve JSON marshalling/unmarshalling speed. These packages tend to bypass the Go type system using "unsafe" in order to provide reflect-like operations without the overhead (e.g. allocation)

Re: [go-nuts] Questions Regarding Go 1.15 Dwarf generation

2021-02-23 Thread 'Than McIntosh' via golang-nuts
I would second Ian's recommendation to look at the 1.16 code -- a lot has changed since 1.15. >>There is a LoadFull function in loader with works with payloads but I have no idea what function and in what phase the raw data for each symbols being created and added to payloads. I would appreciate i

Re: [go-nuts] gollvm: meaningless "unsupported llvm::CallingConv::ID"

2021-01-14 Thread 'Than McIntosh' via golang-nuts
On Thu, Jan 14, 2021 at 8:38 AM Ivan Serdyuk wrote: > Hi. > > I caught the following error: > > https://go.googlesource.com/gollvm/+/refs/heads/master/bridge/go-llvm-cabi-oracle.cpp#162 > Would it help to share the actual error message and compiler invocation? > Among other things: people has n

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread 'Than McIntosh' via golang-nuts
You can of course run capture-fcn-attributes with an explicit set of triples, e.g. $ ./capture-fcn-attributes -o ../driver/ArchCpusAttrs.h -triples i686-pc-linux-gnu which will get you off the ground... but you would not want to check in the resulting header. The values in ArchCpusAttrs.h have t

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread 'Than McIntosh' via golang-nuts
Right, that would be expected. The easiest thing to do is make sure that you're running cmake in your build area with -DLLVM_TARGETS_TO_BUILD="all" then you can build "llc" and "clang" , then update your path so that the freshly built llc/clang are picked up first. Once you have that set up,

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread 'Than McIntosh' via golang-nuts
Thanks. The error you're seeing "unable to determine target CPU features for target i686-pc-linux-gnu" looks as though it's because i686-pc-linux-gnu isn't listed as a target in driver/ArchCpusAttrs.h. >From the root of your repo, try $ cd tools $ go build capture-fcn-attributes.go $ ./

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread 'Than McIntosh' via golang-nuts
Diff is fine. No need for the entire folder. Than On Wed, Jan 6, 2021 at 10:18 AM Ivan Serdyuk wrote: > Than, > I could perform "git diff" and provide the generated file. > I could also compress & share the build folder. > What else would be required? > > Ivan > > On Wednesday, January 6, 2021

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread 'Than McIntosh' via golang-nuts
It would be helpful if you could put up a CL that includes all of the changes you're testing -- at this point do you have any modifications to driver/ArchCpusAttrs.h ? Thanks On Wed, Jan 6, 2021 at 10:00 AM Ivan Serdyuk wrote: > Ping > > On Friday, January 1, 2021 at 5:45:02 AM UTC+2 Ivan Ser

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2020-12-08 Thread 'Than McIntosh' via golang-nuts
Hello, Thanks for the note. I am still not completely sure what the problem is. You wrote: | I found | | // triple: i686-pc-linux-gnu | static const CpuAttrs attrs1[] = { | // first entry is default cpu | { "i686", "+cx8,+x87"}, | | and (inside the hashmap) | | { "yonah", "+cx8,+fxsr,

Re: [go-nuts] Does it support using external package in gollvm?

2020-11-19 Thread 'Than McIntosh' via golang-nuts
Can you please post the exact commands you're using? The recipe in https://go.googlesource.com/gollvm#seetheir is meant to give you an idea as to how to do this, but without seeing exactly what you typed it's hard to tell what the problem s. Thanks. On Thu, Nov 19, 2020 at 8:57 AM jw jiang wrot

Re: [go-nuts] gollvm: Issues on Alpine linux. Tentative definition has type 'struct sigstack' that is never completed, in sysinfo.c

2020-11-17 Thread 'Than McIntosh' via golang-nuts
> /home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/gofrontend/libgo/sysinfo.c:462:1: error: tentative definition has type 'struct sigstack' that is never completed > SREF(sigstack); > ^ I don't know why sysinfo.c has the line "SREF(sigstack)". What happens if you just remove it? I agree

Re: [go-nuts] New linker

2020-08-19 Thread 'Than McIntosh' via golang-nuts
eration from linker to compiler) for 1.17, or is the > project considered done for now? > > Best, > Misha. > > On 18 Aug 2020, at 19:22, 'Than McIntosh' via golang-nuts wrote: > > > To add to what Ian mentioned: > > Many of the measures outlined in https://gola

Re: [go-nuts] New linker

2020-08-18 Thread 'Than McIntosh' via golang-nuts
To add to what Ian mentioned: Many of the measures outlined in https://golang.org/s/better-linker have been implemented at this point. It was a multi-person effort, several members of the Go compiler/runtime team were involved (Jeremy, Cherry, Austin, and myself). The new indexed object file for

Re: [go-nuts] Why gollvm not support race detector?

2020-08-11 Thread 'Than McIntosh' via golang-nuts
>>Could I simply add race.go to gofrontend then link the target programs by the TSAN shared library to make the race detector enabled? The race detector implementation also includes a compiler component (look for flag_race in the cmd/compile source code), so that would have to be ported to gccgo a

Re: [go-nuts] Gollvm failed to build hugo

2020-08-10 Thread 'Than McIntosh' via golang-nuts
Hello, >># github.com/gohugoio/hugo >>/usr/bin/ld.gold: error: $WORK/b029/_pkg_.a(gccgo_c.o): failed to match split-stack sequence at section 1 offset 0 This issue is https://github.com/golang/go/issues/38728, which should be fixed at this point at tip. Thanks, Than On Mon, Jul 20, 2020 at 2:3

Re: [go-nuts] Problems compiling gollvm macos

2020-06-19 Thread 'Than McIntosh' via golang-nuts
Hello, Gollvm is not support for MacOS at the moment-- the runtime (shared with gccgo) doesn't target MacOS. Cheers, Than On Fri, Jun 19, 2020 at 2:19 PM Guido Chari wrote: > Hi, > > I am having problems to compile gollvm. > I am following the instructions in https://go.googlesource.com/gollvm/

Re: [go-nuts] Failed to build gollvm in a docker container

2020-05-27 Thread 'Than McIntosh' via golang-nuts
>> I can successfully compile and link gollvm by setting CMAKE_C_FLAGS="-fcf-protection=none". The manual override of CMAKE_C_FLAGS shouldn't be needed, if you rerun cmake from a clean slate (removing the CMakeCache.txt, etc) it should detect that "-fcf-protection=branch" is hard-wired on, and wi

Re: [go-nuts] Failed to build gollvm in a docker container

2020-05-26 Thread 'Than McIntosh' via golang-nuts
This looks exactly like the bug in https://github.com/golang/go/issues/38728. The prolog of the function contains 0: f3 0f 1e fa endbr64 which is confusing the gold linker. This instruction doesn't get added unless the host compiler has "-fcf-protection=branch" turned on. I would su

Re: [go-nuts] Failed to build gollvm in a docker container

2020-05-26 Thread 'Than McIntosh' via golang-nuts
OK. Just to confirm, what do you see from objdump -dr ./tools/gollvm/libgo/CMakeFiles/libgo_c_piclib.dir/__/gofrontend/libgo/go/syscall/errno.c.o for the prolog of syscall.Geterrno. Should be something like Disassembly of section .text.syscall.GetErrno: : 0: 64 48 3b 24 25

Re: [go-nuts] Failed to build gollvm in a docker container

2020-05-26 Thread 'Than McIntosh' via golang-nuts
OK. I'm wondering if for some reason the fix I put in is not effective. Could you please try this in your build area: rm ./tools/gollvm/libgo/CMakeFiles/libgo_c_piclib.dir/__/gofrontend/libgo/go/syscall/errno.c.o ninja -v libgo_all and post the compile line for errno.c? Thanks, Than On Tue

Re: [go-nuts] Failed to build gollvm in a docker container

2020-05-26 Thread 'Than McIntosh' via golang-nuts
Hello, The ld.gold error message looks a lot like one reported in a previous bug, https://github.com/golang/go/issues/38728. Can you please check to make sure that your client is sync'd past the CLs that fix this issue, e.g. 0edc44a02852dd0d56cac35163a45634b497d6cd. Thanks, Than On Mon, May 25

Re: [go-nuts] Build fails when following build instructions

2020-05-06 Thread 'Than McIntosh' via golang-nuts
>This seems to be the synchronization problem of gollvm and llvm, I am fixing it today, if you have not done it, I can help. Thanks, I have started a CL for this -- it is at https://go-review.googlesource.com/c/gollvm/+/232497 if you want to look it over. Not quite done yet, still a few things to

Re: [go-nuts] Build fails when following build instructions

2020-05-04 Thread 'Than McIntosh' via golang-nuts
OK, thanks, that explains it. When I compile the test file in question I get a prolog of 0: 64 48 3b 24 25 70 00 cmp%fs:0x70,%rsp 7: 00 00 9: 73 12 jae1d Your prolog on the other hand looks like 0: f3 0f 1e fa *endbr64* 4: 64 48 3b 24 25 7

Re: [go-nuts] Build fails when following build instructions

2020-05-04 Thread 'Than McIntosh' via golang-nuts
Thanks! Could you also please run objdump -tldr /tmp/CheckSymbolExists.o and send me the output of that? Cheers, Than On Mon, May 4, 2020 at 7:37 AM Martins Eglitis wrote: > Hi, > > I am getting output like this: > > /tmp/CheckSymbolExists.c: In function 'main': > /tmp/CheckSymbolExists.c:7

Re: [go-nuts] Build fails when following build instructions

2020-05-01 Thread 'Than McIntosh' via golang-nuts
Sorry, I wasn't clear on that last email. What I'm asking is if you could rerun the compilation by hand, e.g. $ cat > /tmp/CheckSymbolExists.c << EOF #include int main(int argc, char** argv) { (void)argv; #ifndef mmap return ((int*)(&mmap))[argc]; #else (void)argc; return 0; #endif } EO

Re: [go-nuts] Build fails when following build instructions

2020-05-01 Thread &#x27;Than McIntosh&#x27; via golang-nuts
A little more detail on the error in question. This is a very obscure error, so please bear with me. >>/usr/bin/ld.gold: error: CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o: failed to match split-stack sequence at section 4 offset 0 What's happening here is that the linker (ld.gold) is linking

Re: [go-nuts] Build fails when following build instructions

2020-04-30 Thread &#x27;Than McIntosh&#x27; via golang-nuts
OK, that looks like a gcc as opposed to a clang. Can you please run /usr/bin/cc -v and show output? That will say how the gcc was configured. There is a related LLVM bug https://bugs.llvm.org/show_bug.cgi?id=37807, but it doesn't look as though this is a clang compiler. Thanks On Thu, Apr 30

Re: [go-nuts] Build fails when following build instructions

2020-04-30 Thread &#x27;Than McIntosh&#x27; via golang-nuts
>>/usr/bin/ld.gold: error: CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o: failed to match split-stack sequence at section 4 offset 0 OK, now I think we're getting somewhere, this looks suspicious. For reference, could you please send me the output of "/usr/bin/cc --version"? Thanks, Than O

Re: [go-nuts] Build fails when following build instructions

2020-04-30 Thread &#x27;Than McIntosh&#x27; via golang-nuts
Thanks for the email. Sorry for the delay in responding, this is a very busy time right now for our team (release freeze is happening at the end of this week). Just in general, the gollvm build procedure uses "cmake", and as part of this process cmake is running various tests to make sure that th

Re: [go-nuts] Gollvm, some questions

2020-04-22 Thread &#x27;Than McIntosh&#x27; via golang-nuts
Hi, Thanks for your note. The big picture is that gollvm is still very much an experimental version of Go; we take care of it and keep it operating at a basic level, but it can be unstable at times. Worth adding that development activity on Gollvm is mostly paused at the moment while Cherry and I

Re: [go-nuts] go1.14/go1.14.1 missing some debug information

2020-04-01 Thread &#x27;Than McIntosh&#x27; via golang-nuts
Thanks for filing the issue (https://github.com/golang/go/issues/38192). I added some comments. On Wed, Apr 1, 2020 at 12:46 AM Ian Lance Taylor wrote: > On Tue, Mar 31, 2020 at 5:19 PM sanye wrote: > > > > Hello gophers, > > I have a problem when debugging with gdb using go1.14/1.14.1, set a

Re: [go-nuts] [gollvm] Cannot build project : no type named 'CompositeType' in namespace 'llvm'

2020-03-31 Thread &#x27;Than McIntosh&#x27; via golang-nuts
CL submitted. If you can please update your client and try your build again, it should go through. Thanks, Than On Tue, Mar 31, 2020 at 2:56 PM Than McIntosh wrote: > Hello again, > > The gollvm sources were indeed out of date with LLVM tip. I sent > > https://go-review.googlesource.com/c/gollv

Re: [go-nuts] [gollvm] Cannot build project : no type named 'CompositeType' in namespace 'llvm'

2020-03-31 Thread &#x27;Than McIntosh&#x27; via golang-nuts
Hello again, The gollvm sources were indeed out of date with LLVM tip. I sent https://go-review.googlesource.com/c/gollvm/+/226637 to resolve the problem. I'll let you know when this is checked in. Thanks, Than On Tue, Mar 31, 2020 at 12:40 PM Than McIntosh wrote: > Hi, > > I'll take a look

Re: [go-nuts] [gollvm] Cannot build project : no type named 'CompositeType' in namespace 'llvm'

2020-03-31 Thread &#x27;Than McIntosh&#x27; via golang-nuts
Hi, I'll take a look to see if I can reproduce the problem. Gollvm is "out of tree", meaning that when LLVM headers and data structures change things can get out of sync, but I'll need to confirm. Thanks, Than On Tue, Mar 31, 2020 at 12:16 PM Ian Lance Taylor wrote: > [ + thanm, cherryyz ]

Re: [go-nuts] gollvm: Interpret llvm-goc LLVM-IR with lli

2020-02-04 Thread &#x27;Than McIntosh&#x27; via golang-nuts
>>in this case is Only GOLLVM does not allow to go direct to .ll or it is general issue It's a general issue. Hypothetically if someone were to write another LLVM-IR-producing Go compiler (not gollvm), you would no doubt have the same problem. Than On Tue, Feb 4, 2020 at 9:55 AM wrote: > in t

Re: [go-nuts] gollvm: Interpret llvm-goc LLVM-IR with lli

2020-02-04 Thread &#x27;Than McIntosh&#x27; via golang-nuts
Hello, You wrote: >> .. . result that I get can not exec the .ll file by lli command Go programs depend on the Go runtime and standard library -- you can't really do anything interesting in Go without involving these packages. Consider a toy program like this: https://play.golang.org/p/MAohLsrz7

Re: [go-nuts] [gollvm] Can't exec LLVM IR from go code

2019-12-02 Thread &#x27;Than McIntosh&#x27; via golang-nuts
Greetings, What you are seeing is expected behavior. In your "hello.go" file, you've defined a "main.main" function, however in order to run that function you need a copy of the Go runtime and standard libraries. When a Go program runs, the "main" function is in fact part of the runtime -- the run

Re: [go-nuts] How to build gollvm on arm platform

2019-10-25 Thread &#x27;Than McIntosh&#x27; via golang-nuts
Hi Eric, Yes, this is a problem that is pretty much guaranteed to happen given the way the C ABI works in LLVM. All of the test results in BackendCABIOracleTests.cpp are specific to the details of the amd64 ABI. The way that I had imagined this working was that either each testpoint has a loop o

Re: [go-nuts] pprof not showing call hierarchy for time.now and time.Until

2019-10-21 Thread &#x27;Than McIntosh&#x27; via golang-nuts
The "tree" output format is modeled approximately after the output of the ancient unix tool "gprof" (see https://ftp.gnu.org/old-gnu/Manuals/gprof-2.9.1/html_chapter/gprof_5.html). For tree output, you'll see entries of the form Caller(s) Function

Re: [go-nuts] pprof not showing call hierarchy for time.now and time.Until

2019-10-21 Thread &#x27;Than McIntosh&#x27; via golang-nuts
It can sometimes be useful in such situations to look at the pprof "tree" output style (as opposed to graph). Than On Sat, Oct 19, 2019 at 4:14 AM Piers Powlesland wrote: > Kind of, but due to the sheer number of nodes and edged the edges end up > lying on top of each other so in certain cases

Re: [go-nuts] How to build gollvm on arm platform

2019-09-18 Thread &#x27;Than McIntosh&#x27; via golang-nuts
Thanks for the update. BlockLIRBuilder sounds like the right way to go, and your plan to add unit tests SGTM. Agree that we'll need to thread through the arch/callingConv into the unit testing framework, let me know if I can help with that. Cheers, Than On Wed, Sep 18, 2019 at 3:46 AM eric f

  1   2   >