How to use cflag -flto?

27 views
Skip to first unread message

alex....@gmail.com

unread,
Feb 20, 2018, 2:59:59 AM2/20/18
to golang-nuts
So I'm trying to compile a test program with the cflag -flto and it failed to build with the message:
cannot load DWARF output from $WORK/b001//_cgo_.o: decoding dwarf section info at offset 0x0: too short

I feel like I'm doing something wrong so I posed here instead of on github. Even tried building with -ldflags "-linkmode=external"

package main

/*
   #cgo CFLAGS: -flto
   #cgo CXXFLAGS: -flto
*/
import "C"
import "fmt"

func main() {
   fmt.Println("Hello World", C.int(0))
}



Reply all
Reply to author
Forward
0 new messages