Closed coremedic closed 9 months ago
Resolved my own issue. I had a comment on the same line as my #include
Still if it builds with go and not garble we should fix it. Can you send in your code so we can reproduce?
Sorry for the late response, I cant provide the whole context but here is how you could recreate the issue:
Assembly in go program
#include "textflag.h" // THIS COMMENT BREAKS GARBLE
// func ReadByteAtOffset(start uintptr, offset uint32) uint8
TEXT ·readByteAtOffset(SB), NOSPLIT, $0-24
MOVQ start+0(FP), AX // Load start into AX
MOVL offset+8(FP), CX // Load offset into CX
ADDQ CX, AX // Add offset to start
MOVB (AX), CL // Read byte from the address in AX
MOVB CL, ret+16(FP) // Store the byte in return value
RET
Comments on the same line as #include will cause an invalid syntax error when building with garble, but is fine with go build
Thanks @coremedic - that is enough for me to reproduce.
What version of Garble and Go are you using?
What environment are you running Garble on?
go env
OutputWhat did you do?
I have some go assembly code that I am trying to obfuscate, getting an "invalid syntax" error when building. When I build with "go build" my build works fine. Here are some relevant parts of the debug output: