kubernetes: building unstripped binaries

Specify GOLDFLAGS as an empty string for building unstripped binaries, which allows
you to use code debugging tools like delve. When GOLDFLAGS is unspecified, it defaults
to "-s -w" which strips debug information. Other flags that can be used for GOLDFLAGS
are documented at https://golang.org/cmd/link/ [1]

[1] https://github.com/kubernetes/kubernetes/blob/master/build/root/Makefile#L82

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Hongxu Jia 2019-09-02 16:36:48 +08:00 committed by Bruce Ashfield
parent ac0b214d5f
commit f8568abe01

View File

@ -53,7 +53,7 @@ do_compile() {
export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
# to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet
make cross KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} make cross KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS=""
} }
do_install() { do_install() {