Hello, I have recently started fiddling around with the gollvm compiler with the end goal of being able to fuzz test Go programs with LLVM based tools such as KLEE [1]. Here's what I did:
1.) Compiled gollvm and installed KLEE from the official repositories under the Fedora 37 official docker image 2.) Used llvm-goc to emit llvm IR for a sample Go program (attached below) (adapted from KLEE's get sign example), then llvm-as to convert that to bitcode Running KLEE on the resulting bitcode, it seems that it can't find any of the Go runtime symbols (see screenshot attached). My supposition is that I might need to recompile the Go runtime to LLVM bitcode in order to get this working. Is this correct? If yes, how would I go about doing that? [1]: https://klee.github.io/ -- 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/83933628-8cf9-4927-afab-ead514702ba8n%40googlegroups.com.
package main import ( "os" "strconv" ) func GetSign(x int) int { if x == 0 { return 0 } if x < 0 { return -1 } else { return 1 } } func main() { a, _ := strconv.Atoi(os.Args[1]) os.Exit(GetSign(a)) }