[meta-virtualization] [PATCH 1/2] kubernetes: building unstripped binaries

Hongxu Jia hongxu.jia at windriver.com
Mon Sep 2 02:10:01 PDT 2019


On 9/2/19 4:36 PM, Hongxu Jia wrote:
> 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]

Clarify one thing, make the binary *unstripped* at do_compile time,

thus Yocto will split it to stripped + dbg

//Hongxu


> [1] https://github.com/kubernetes/kubernetes/blob/master/build/root/Makefile#L82
>
> Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
> ---
>   recipes-containers/kubernetes/kubernetes_git.bb | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/recipes-containers/kubernetes/kubernetes_git.bb b/recipes-containers/kubernetes/kubernetes_git.bb
> index b7862ec..821f51f 100644
> --- a/recipes-containers/kubernetes/kubernetes_git.bb
> +++ b/recipes-containers/kubernetes/kubernetes_git.bb
> @@ -54,7 +54,7 @@ do_compile() {
>   	export CGO_CFLAGS="${CFLAGS} --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
> -	make cross KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH}
> +	make cross KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} GOLDFLAGS=""
>   }
>   
>   do_install() {




More information about the meta-virtualization mailing list