Comments (8)
Hi @nirmannarang! golang seems te be tricky on qemu-user, and several bugs have been fixed in the last months:
It might be interesting trying this without Docker (using qemu-user on the host) and opening a bug report in QEMU.
from qemu-user-static.
@umarcor Docker requirement is necessary actually. This is part of CI which builds this s390x go-build image on x86 and is then published on docker hub. And this fails only for s390x, other architectures like ppc64le, arm64, etc. are running successfully through this process.
Let me still give it a try without Docker(using qemu-user on the host).
Thanks.
from qemu-user-static.
@umarcor GOARCH=s390x go install -v std
command is successful if I run it directly on x86 host. The same command gives error if ran inside s390x docker container on x86 host.
from qemu-user-static.
@umarcor Docker requirement is necessary actually. This is part of CI which builds this s390x go-build image on x86 and is then published on docker hub. And this fails only for s390x, other architectures like ppc64le, arm64, etc. are running successfully through this process.
Yes, I understand that. However, I think that this might be an issue with "qemu-user allowing s390x targets on x86_64 hosts". Because you seem to have access to an s390x host (you wrote "When I build the same Dockerfile.s390x on an s390x machine, it is built successfully"), I'm suggesting you to take Docker out of the equation FOR TESTING PURPOSES ONLY. Once you find/fix the issue, you can go back to using the container, as you expect.
GOARCH=s390x go install -v std command is successful if I run it directly on x86 host.
This is cross-compilation; qemu-user is not being used. I suggest to download a go installation for s390x into your host. If you try to execute it straightaway, it should fail. If you run qemu-user go install -v std
, it should theoretically produce a packages/libraries for s390x. But, in this case, I'd expect it to fail with the same error that you are seeing in the container. This would mean that the issue is, indeed, with golang and qemu-user, but unrelated to docker.
from qemu-user-static.
I installed qemu on x86 Ubuntu host. Extracted s390x go 1.14.2 binaries on the same. Ran the following commands:
root:~ wget -q https://storage.googleapis.com/golang/go1.14.2.linux-s390x.tar.gz
root@:~# chmod ugo+r go1.14.2.linux-s390x.tar.gz
root@:~# rm -rf /usr/local/go /usr/bin/go
root@:~# tar -C /usr/local -xzf go1.14.2.linux-s390x.tar.gz
root@:~# ln -sf /usr/local/go/bin/go /usr/bin/
root@:~# ln -sf /usr/local/go/bin/gofmt /usr/bin/
root@:~# ln -sf /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc
root@:~# go version
/lib/ld64.so.1: No such file or directory
root@:~# qemu-s390x /usr/bin/go version
/lib/ld64.so.1: No such file or directory
from qemu-user-static.
Another note, on x86 host, I ran the following commands:
docker run --rm --privileged multiarch/qemu-user-static:4.2.0-7 --reset -p yes
Ran an s390x golang 1.14.2 alpine container on x86 host
root@:~# docker run -it -v /usr/bin/qemu-s390x-static:/usr/bin/qemu-s390x-static s390x/golang:1.14.2-alpine3.11
Inside s390x container, ran following go commands:
/go # go version
go version go1.14.2 linux/s390x
/go # go install -v -x std
WORK=/tmp/go-build090332422
/go #
Strange that this is successful but docker build fails using same command inside Dockerfile.s390x.
from qemu-user-static.
That seems to confirm that this is an issue upstream with allowing s390x targets on x86_64 hosts. I suggest to open a bug report as commented in #114 (comment).
from qemu-user-static.
The issue has been fixed with the latest release 6.1.0-8
. Hence closing the issue.
from qemu-user-static.
Related Issues (20)
- ldd fails with qemu-aarch64 HOT 6
- Need support for run x86_64 on linux/arm64 HOT 13
- Intermittent exec format error when building linux/arm64 (alpine 3.15+) on amd64 host HOT 1
- speed is slow when use as cross-compile solution HOT 5
- qemu: uncaught target signal 11 (Segmentation fault) - core dumped HOT 1
- Does loong64 and mips/mipsle will be support?
- Where is qemu-$to_arch-static binary files when container whose arch isn't equal to host's one is run? HOT 8
- Undocumented convention: The `--reset` flag must be the first argument
- Mirror docker image to ghcr.io HOT 3
- node.js 16 build on UBI8 is very slow and fails in GH Actions with ECONNRESET and too many open files errors.
- argv[0] can now be automatically fixed
- need to upgrade to support loongarch64 HOT 8
- [Problem] Can I use it in gitlab runner? HOT 4
- iptables-nft not supported in qemu-aarch64-static HOT 6
- Need pinned Alpine Linux versions, e.g., v3.17 HOT 1
- mount: permission denied (are you root?)
- Is this project still active? HOT 1
- armv7 and a page size of 32K
- Have trouble running quemu-static on arm64 with exec format error
- Publish new image with latest busybox
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qemu-user-static.