Closed mwoodpatrick closed 2 weeks ago
You have to set CGO_CFLAGS to something, otherwise delve will set it to "-O0 -g"
, which your library doesn't like.
Recommendations as to what a suitable value should be would be greatly appreciated
Anything that isn't the empty string, -g
for example.
That worked, many thanks, much appreciated
What version of Delve are you using (
dlv version
)? Version: 1.22.1 Build: $Id: 0c3470054da6feac5f6dcf3e3e5144a64f7a9a48 $What version of Go are you using? (
go version
)? go version go1.22.3 linux/amd64What operating system and processor architecture are you using? Debian GNU/Linux 12 (bookworm)
What did you do? In jetify/devbox env I ran: dlv debug ./main.go
What did you expect to see? Delve should launch
What did you see instead?
runtime/cgo
In file included from /nix/store/x8lqlydsxbrwvf6p7v18gws8kn1xl37f-glibc-2.38-23-dev/include/bits/libc-header-start.h:33, from /nix/store/x8lqlydsxbrwvf6p7v18gws8kn1xl37f-glibc-2.38-23-dev/include/stdlib.h:26, from _cgo_export.c:3: /nix/store/x8lqlydsxbrwvf6p7v18gws8kn1xl37f-glibc-2.38-23-dev/include/features.h:414:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] 414 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O) | ^
~~ cc1: all warnings being treated as errors exit status 1