go-exprtk icon indicating copy to clipboard operation
go-exprtk copied to clipboard

Build with MinGW?

Open FF-AntiK opened this issue 7 months ago • 0 comments

Is it possible to build go-exprtk with MinGW? I've tried: CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_ENABLED=1 GOOS=windows go build which results in:

96.25 # github.com/Pramod-Devireddy/go-exprtk
96.25 /usr/bin/x86_64-w64-mingw32-as: $WORK/b179/_x003.o: too many sections (72935)
96.25 /tmp/ccIq6ph4.s: Assembler messages:
96.25 /tmp/ccIq6ph4.s: Fatal error: can't write 19 bytes to section .text of $WORK/b179/_x003.o: 'file too big'
96.25 /usr/bin/x86_64-w64-mingw32-as: $WORK/b179/_x003.o: too many sections (72935)
96.25 /tmp/ccIq6ph4.s: Fatal error: $WORK/b179/_x003.o: file too big

So I tried to use the big-obj format: CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_CFLAGS="-Wa,-mbig-obj" CGO_ENABLED=1 GOOS=windows go build which results in:

0.842 # github.com/Pramod-Devireddy/go-exprtk
0.842 cgo: cannot parse gcc output $WORK/b179//_cgo_.o as ELF, Mach-O, PE, XCOFF object
0.883 # github.com/mattn/go-sqlite3
0.883 cgo: cannot parse gcc output $WORK/b181//_cgo_.o as ELF, Mach-O, PE, XCOFF object

After a little research, I found out that actually cgo's debug/pe doesn't support the big-obj format: https://github.com/golang/go/issues/24341

Is there any other way to build this for Windows? All I want is an executable which runs on Windows.

FF-AntiK avatar Jul 10 '24 09:07 FF-AntiK