| Summary: | [linux] Cannot run musl binaries e.g., from Alpine Linux | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Yonas Yanfa <yonas> | ||||
| Component: | Individual Port(s) | Assignee: | Dmitry Chagin <dchagin> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | CC: | dchagin, kmoore, val | ||||
| Priority: | --- | Keywords: | patch | ||||
| Version: | Latest | Flags: | bugzilla:
maintainer-feedback?
(kmoore) |
||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Yonas Yanfa
2016-10-26 13:59:18 UTC
Created attachment 182934 [details]
Add ELF brand recognition for musl Linux x86_64 binaries
This isn't a Docker problem, you'd get the same if you just extracted Alpine's rootfs and ran `jail -c path=$(pwd) mount.devfs ip4=inherit command=/bin/sh` there.
When a binary isn't recognized, you can run brandelf(1) on it.
However this would be terrible for actually doing work in a Linux jail — you install a package within Linux and the binary does not work and you have to brandelf it…
So here's a patch that makes FreeBSD recognize these binaries.
Thanks Greg! The patch works for me! What about x86 binaries? I have tried adding a similar section to the 32-bit thing but it didn't work, I probably messed something up. Who cares about 32-bit Linux containers anyway? :) (In reply to Greg V from comment #5) I believe Docker on FreeBSD require 64-bit, so 32-bit support probably isn't worth worrying about. (In reply to Yonas Yanfa from comment #6) Yeah. It's not all about Docker though. (In reply to Greg V from comment #7) True. This issue has been open for a little while (7 months). Why don't we commit the patch we have now, and when we're able to figure out how to get 32-bit working, we can commit that later? A commit references this bug: Author: dchagin Date: Mon Jul 3 10:24:49 UTC 2017 New revision: 320595 URL: https://svnweb.freebsd.org/changeset/base/320595 Log: Add support for musl consumers to the Linuxulator. PR: 213809 Submitted by: Yonas Yanfa Reported by: Yonas Yanfa MFC after: 1 week Relnotes: yes Changes: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/linux/linux_sysvec.c A commit references this bug: Author: dchagin Date: Sat Jul 15 08:27:23 UTC 2017 New revision: 321007 URL: https://svnweb.freebsd.org/changeset/base/321007 Log: MFC r320595: Add support for musl consumers to the Linuxulator. PR: 213809 Submitted by: Yonas Yanfa (for amd64) Reported by: Yonas Yanfa Relnotes: yes Changes: _U stable/11/ stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux_sysvec.c Thanks |