From: Bruce Ashfield <bruce.ashfield@gmail.com>
To: Qi.Chen@windriver.com
Cc: meta-virtualization@lists.yoctoproject.org
Subject: Re: [meta-virtualization][PATCH] docker-compose: fix textrel QA issue
Date: Mon, 25 Sep 2023 01:17:15 +0000 [thread overview]
Message-ID: <ZRDfmy0es8iFFztx@gmail.com> (raw)
In-Reply-To: <20230918065101.1104194-1-Qi.Chen@windriver.com>
In message: [meta-virtualization][PATCH] docker-compose: fix textrel QA issue
on 17/09/2023 Chen Qi via lists.yoctoproject.org wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> Fix textrel QA issue like below:
>
> ERROR: QA Issue: docker-compose: ELF binary /usr/lib/docker/cli-plugins/
> docker-compose has relocations in .text [textrel]
>
> The problem could be fixed by adding -buildmode=pie, as this option has
> already been in GOBUILDFLAGS except for mips and riscv32, let's make
> use of GOBUILDFLAGS.
I tend to not use (or like) the defaults in the bbclass, but in this
case, it is probably ok.
>
> Also, make use of GO_EXTRA_LDFLAGS to hold our this recipe's specific ldflags.
I much prefer the explicit GO_LDFLAGS on the build line, versus the
internally consumed GO_EXTRA_LDFLAGS. So I'd prefer to keep that
as-is.
Bruce
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
> recipes-containers/docker-compose/docker-compose_git.bb | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/recipes-containers/docker-compose/docker-compose_git.bb b/recipes-containers/docker-compose/docker-compose_git.bb
> index 274fb520..8c0ddccf 100644
> --- a/recipes-containers/docker-compose/docker-compose_git.bb
> +++ b/recipes-containers/docker-compose/docker-compose_git.bb
> @@ -40,6 +40,8 @@ PACKAGECONFIG ?= ""
>
> include relocation.inc
>
> +GOBUILDFLAGS:append = " -mod=vendor"
> +GO_EXTRA_LDFLAGS = "-s -w -X internal.Version=${PV} -X ${COMPOSE_PKG}/internal.Version=${PV}"
> do_compile() {
> cd ${S}/src/import
>
> @@ -52,17 +54,14 @@ do_compile() {
> export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
> export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
>
> - export GOFLAGS="-mod=vendor -trimpath"
> -
> # our copied .go files are to be used for the build
> ln -sf vendor.copy vendor
> # inform go that we know what we are doing
> cp ${WORKDIR}/modules.txt vendor/
>
> - GO_LDFLAGS="-s -w -X internal.Version=${PV} -X ${COMPOSE_PKG}/internal.Version=${PV}"
> GO_BUILDTAGS=""
> mkdir -p ./bin
> - ${GO} build $GOFLAGS -tags "$GO_BUILDTAGS" -ldflags "$GO_LDFLAGS" -o ./bin/docker-compose ./cmd
> + ${GO} build ${GOBUILDFLAGS} -tags "$GO_BUILDTAGS" -o ./bin/docker-compose ./cmd
> }
>
> do_install() {
> --
> 2.40.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#8312): https://lists.yoctoproject.org/g/meta-virtualization/message/8312
> Mute This Topic: https://lists.yoctoproject.org/mt/101428849/1050810
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
next prev parent reply other threads:[~2023-09-25 1:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 6:51 [meta-virtualization][PATCH] docker-compose: fix textrel QA issue Qi.Chen
2023-09-25 1:17 ` Bruce Ashfield [this message]
2023-09-27 5:54 ` ChenQi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZRDfmy0es8iFFztx@gmail.com \
--to=bruce.ashfield@gmail.com \
--cc=Qi.Chen@windriver.com \
--cc=meta-virtualization@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.