Add build option "GODEBUG=1"#2647
Conversation
There was a problem hiding this comment.
how about removing the -s -w from the GO_LDFLAGS and SHIM_GO_LDFLAGS and reusing the env EXTRA_LDFLAGS, since it has provided the ability to pass the gcflags?
There was a problem hiding this comment.
@fuweid Make a new version that put -s -w to EXTRA_LDFLAGS.
Make will generate GDB friendly binary with this build option. Signed-off-by: Hui Zhu <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #2647 +/- ##
==========================================
- Coverage 47.54% 43.87% -3.68%
==========================================
Files 87 94 +7
Lines 8211 10310 +2099
==========================================
+ Hits 3904 4523 +619
- Misses 3590 5070 +1480
Partials 717 717
Continue to review full report at Codecov.
|
| GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG) $(EXTRA_LDFLAGS)' | ||
| SHIM_GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG) -extldflags "-static"' | ||
| GO_BUILDTAGS ?= seccomp apparmor | ||
| GO_BUILDTAGS += ${DEBUG_TAGS} |
There was a problem hiding this comment.
I think that part of your change is good to build binary with debug info, like
make GO_BUILDTAGS="seccomp apparmor static_build" \
EXTRA_LDFLAGS="" \
EXTRA_FLAGS='-gcflags=all="-N -l"'
I'm not sure that it is good to add the specific debug info in the common Makefile.
ping @AkihiroSuda and @crosbymichael
There was a problem hiding this comment.
would a separate make debug work better or no?
There was a problem hiding this comment.
@crosbymichael I think let debug as an option is better than set it as a special target.
Because the option can work with each target.
|
LGTM |
1 similar comment
|
LGTM |
Make will generate GDB friendly binary with this build option.
Signed-off-by: Hui Zhu [email protected]