Gollvm Docker Image for LLVM-IR generation of go programs using go build & llvm-goc
1.1K
v1 is a stable release for the latest gollvm with llvm-trunk at llvm-master tip.
latest is also a stable release but with gollvm and llvm-10 stable branch and not in sync with latest llvm @tip.
Docker Image for gollvm.
This docker was built as per steps here.
This removes the docker image after run is complete.
$ docker pull prodrelworks/gollvm-docker:lastest
$ docker run --rm -it -v $(pwd):/gocodes -it prodrelworks/gollvm-docker:latest
$ cd /gocodes/
This maps the present working directory pwd to a folder gocodes inside the docker and opens a bash terminal inside the image docker. Create a file
main.go and use llvm-goc to generate IR.
You can follow the steps here in this gist as well.
Gist for how to run go build and llvm-goc to generate the IR for a go program. I have used the recommended way from gollvm, ir
Detailed Steps LLVM-IR Steps
$ llvm-goc -emit-llvm -c main.go -o ./gollvm-docker/docker-gollvm-main.bc
$ llvm-goc -S -emit-llvm main.go -o ./gollvm-docker/docker-gollvm-main.ll
$ llvm-goc -S -O3 -emit-llvm main.go -o ./gollvm-docker/docker-gollvm-main.opt.ll
$ llvm-goc -emit-llvm -c -O3 main.go -o ./gollvm-docker/docker-gollvm-main.opt.bc
Content type
Image
Digest
Size
858.3 MB
Last updated
over 6 years ago
docker pull prodrelworks/gollvm-docker