diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2025-07-21 17:26:08 +0800 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2025-08-18 19:01:16 -0400 |
commit | 8f15c45f7d9cf5d6b25ab7c5865496e4ce3eb6d0 (patch) | |
tree | 237af380140fb2503eb3eb6c7b4254a5ece21c96 | |
parent | f707bbe323261f41f69267708d6751c1bb0edd0b (diff) | |
download | meta-virtualization-8f15c45f7d9cf5d6b25ab7c5865496e4ce3eb6d0.tar.gz |
skopeo: avoid overriding GOBUILDFLAGS set in go.bbclass
When MACHINE is riscv64, skopeo fails to build with the following
error message:
ERROR: QA Issue: skopeo: ELF binary /usr/sbin/skopeo has relocations in .text [textrel]
To reproduce the issue, run the following command:
MACHINE=qemuriscv64 bitbake skopeo
In go.bbclass, we have:
"""
export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS} -trimpath"
...
python() {
if 'mips' in d.getVar('TARGET_ARCH') or 'riscv32' in d.getVar('TARGET_ARCH'):
d.appendVar('INSANE_SKIP:%s' % d.getVar('PN'), " textrel")
else:
d.appendVar('GOBUILDFLAGS', ' -buildmode=pie')
}
"""
The '-v -trimpath' and arch depedent '-buildmode=pie' is generally reasonable.
And we can see we'll need to use anonymous python function to handle PIE. So we
should avoid overriding it unless necessary.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | recipes-containers/skopeo/skopeo_git.bb | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/recipes-containers/skopeo/skopeo_git.bb b/recipes-containers/skopeo/skopeo_git.bb index c5518cdc..32938108 100644 --- a/recipes-containers/skopeo/skopeo_git.bb +++ b/recipes-containers/skopeo/skopeo_git.bb | |||
@@ -60,7 +60,6 @@ do_compile() { | |||
60 | export CGO_LDFLAGS="${TARGET_LDFLAGS}" | 60 | export CGO_LDFLAGS="${TARGET_LDFLAGS}" |
61 | 61 | ||
62 | export GO111MODULE=off | 62 | export GO111MODULE=off |
63 | export GOBUILDFLAGS="-trimpath" | ||
64 | export EXTRA_LDFLAGS="-s -w" | 63 | export EXTRA_LDFLAGS="-s -w" |
65 | 64 | ||
66 | oe_runmake bin/skopeo | 65 | oe_runmake bin/skopeo |