Mk/Uses/linux.mk has: .ifndef ONLY_FOR_ARCHS ONLY_FOR_ARCHS= amd64 i386 ONLY_FOR_ARCHS_REASON= Linux compatibility is only available on amd64 and i386 .endif Linuxulator also supports arm64/aarch64 (support started being added in 2018). There are increasing amounts of bug fixes over time and we could limit ports support to FreeBSD 13 and up.
Just noting here so we have a reference point. The editors/sublime-text4 port is using this feature on Aarch64 and is the perfect test case to validate when it works. This was briefly discussed on Twitter: https://twitter.com/Ericbsd/status/1415402574728077313
Okay, this is turning into a much larger body of work, so I'm going to start documenting things as I find them. 1) bsd.sites.mk also needs updating to include aarch64 before linux.mk will work. Both in the centos and epel7 sections need aarch64 support. 2) emulators/linux_base-c7: compat-libstdc++-33-3.2.3-72.el7 doesn't exist on aarch64. 3) emulators/linux_base-c7: redhat-lsb-core has a different filename between i386/amd64 and aarch64. Currently it looks like linux.mk assumes that all archs have the same file list when doing a "makesum" - this assumption is no longer true on aarch64 with the two noted files above. We'll need to come up with a way to provide a dynamic file list that'll work on all arches for makesum to work properly.
@Ed/Vince If this ends up being a tracking issue, please feel free to self-assign and created separate dependent issues
Here is my personal work-in-progress attempt to get emulators/linux_base-c7 working. Currently, its pulling in a PLIST from some unknown location, so throwing errors attempting to make the package. Even outright deleting the pkg-plist.amd64 and pkg-plist.i386 files, there are still references to i386 being included SOMEWHERE. I'm currently at a loss on this one. https://github.com/darkain/freebsd-ports/commit/e44f5edb91f8d354debdaf343694793b9f52854a
https://reviews.freebsd.org/D29288 "Fix the 'linux' rc script on aarch64" This will need to be backported to 13-STABLE Also, things are starting to work! :-O https://twitter.com/DarkainMX/status/1419018099668316165
Patch set: https://patch-diff.githubusercontent.com/raw/freebsd/freebsd-ports/pull/113.diff WARNING: SOME OF THESE CHANGE BREAK I386/AMD64 TODO: - Check each individual c7 port to see if they have architecture specific pkg-plist files, and generate a new file for Aarch64 - linux-c7-dri is all kinds of broken and has sections of i386/amd64 upstream packages commented out, rather than properly architecture gated - At least one port had issues with DISTFILES, but I don't remember which or what that issue was off the top of my head. This issue only effected "makesum" though, so I temporarily disabled DISTFILES while making the checksums on one of these, and then re-enabled it afterwards.
Updated almost all C7 ports to build on Aarch64. Currently there are 7 left giving me troubles that I've yet to look into exactly why, but should be easy enough to tackle once I get some time. Remaining 7 ports: devel/linux-c7-strace devel/linux-c7-sdl20 audio/linux-c7-alsa-plugins-oss audio/linux-c7-libsndfile audio/linux-c7-pulseaudio-libs audio/linux-c7-flac audio/linux-c7-alsa-plugins-pulseaudio
Nice! Note that linux-c7-strace one isn’t going to work as-is, due to ptrace(2) missing on aarch64. But let me know when you have the port ready; implementing ptrace(2) is on my TODO list.
> linux-c7-strace one isn’t going to work as-is, due to ptrace(2) missing on aarch64. That's really handy to know! Yeah, right now, I've just been making sure the ports properly extract the upstream archives and put files in the correct places, and then have an updated plist file to built a FreeBSD package out of. Only a small handful of the ports have I actively tried using and running. Several though, I'm not sure exactly how to test, since many are just a single shared object file, and not knowing what relies on those to test with.
(In reply to Edward Tomasz Napierala from comment #8) I went back and looked at what was wrong with linux-c7-strace, it was just a 32-bit vs 64-bit dependency reference in the Makefile. So the port is good, just need that ptrace(2) work now! https://github.com/freebsd/freebsd-ports/pull/113/commits/f8deb033a14a905048eaddc51a370a80f15272fa
What's the status of this PR? Is it ok to commit?
(In reply to Mikael Urankar from comment #11) At this point, there are a small number of C7 ports still not working on Aarch64, HOWEVER, I think those should be broken out into their own commit instead of holding up this main body of work. Before merging in these changes, it would be very appreciated if there could be some testing to ensure that i386 and amd64 C7 packages didn't break in this process. If everything checks out okay, I think this should be good to check in, so we have a basis for Aarch64 Linuxulator distros going forward.
@Vincent Do any ports dependent on the leftover "to add/fix ones" need to be adjusted to account for them being missing or not working?
(In reply to Kubilay Kocak from comment #13) Most of the remaining ports are all in a cluster of audio libraries. Looking at the list of things that depends on the remaining ports, ya, I still think its a good idea to exclude them from this commit, and doing them separately, just so we can have a basic Linuxulator userland from ports on Aarch64. emulators/linux-c7: The meta port depends on the remaining ports, but that's fine if we don't have the meta port right now linux-c7-sdl20: nothing else depends on it linux-c7-alsa-plugins-oss: audio/linux-c7-alsa-utils games/linux-steam-utils (not available on Aarch64) net-im/zoom (probably not available on Aarch64) audio/linux-c7-libsndfile: audio/linux-c7-pulseaudio-libs games/linux-dwarffortress (probably not available on Aarch64) audio/linux-c7-pulseaudio-libs: audio/linux-c7-alsa-plugins-pulseaudio audio/linux-c7-pulseaudio-utils chinese/linux-wps-office-zh_CN (??? is this an intended dependency?) editors/linux-wps-office (new port as of June 2021, I don't know anything about it) audio/linux-c7-flac: audio/linux-c7-libsndfile audio/linux-c7-alsa-plugins-pulseaudio: nothing else depends on it
games/linux-steam-utils: has proper arch gating net-im/zoom: has no aarch gating at all, this probably needs fixed games/linux-dwarffortress: has proper arch gating, but can probably be updated to use Aarch64 once these audio packages are fixed editors/linux-wps-office: has proper arch gating
I'm building this again on a new system, and I think that's a good thing. Already found something I missed in the initial patch, which will need addressed. /compat/linux/usr/lib/ld-linux-aarch64.so.1 This file is missing from the plist file in emulators/linux_base-c7 I believe I manually copied this file when I was doing my initial testing.
Fixed the missing file in emulators/linux_base-c7 https://github.com/freebsd/freebsd-ports/pull/113/commits/2f5094adaf56ae9d140b7587557afb953ad1ed12
Ping?
(In reply to Edward Tomasz Napierala from comment #18) I have an updated branch with a few fixes based on Vincent's work: https://github.com/MikaelUrankar/freebsd-ports/tree/darkain
Mikael's branch looks fine to me.
So, what's required for this to get committed?
(In reply to Edward Tomasz Napierala from comment #21) I think it just needs to be reviewed and approved at this point.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=c7dd5ca11a141ecb8a4decab08d1c09e48c9ae6a commit c7dd5ca11a141ecb8a4decab08d1c09e48c9ae6a Author: Mikael Urankar <mikael@FreeBSD.org> AuthorDate: 2021-09-30 13:49:32 +0000 Commit: Mikael Urankar <mikael@FreeBSD.org> CommitDate: 2022-01-17 14:47:28 +0000 *: Linux emulation: add support for aarch64 PR: 256008 Submitted by: Vincent Milum Jr (prior version) Approved by: emulation (maintainer timeout) Mk/Uses/linux.mk | 28 +- Mk/bsd.sites.mk | 6 +- accessibility/linux-c7-at-spi2-atk/distinfo | 4 +- .../linux-c7-at-spi2-atk/pkg-plist.aarch64 (new) | 7 + accessibility/linux-c7-at-spi2-core/distinfo | 4 +- .../linux-c7-at-spi2-core/pkg-plist.aarch64 (new) | 78 + accessibility/linux-c7-atk/distinfo | 4 +- accessibility/linux-c7-atk/pkg-plist.aarch64 (new) | 106 + archivers/linux-c7-lz4/distinfo | 4 +- archivers/linux-c7-lz4/pkg-plist.aarch64 (new) | 13 + audio/linux-c7-alsa-lib-devel/distinfo | 4 +- .../pkg-plist.aarch64 (new) | 580 ++++ audio/linux-c7-alsa-lib/distinfo | 4 +- audio/linux-c7-alsa-lib/pkg-plist.aarch64 (new) | 89 + audio/linux-c7-alsa-plugins-oss/Makefile | 1 + .../pkg-plist.aarch64 (new) | 2 + audio/linux-c7-alsa-plugins-pulseaudio/distinfo | 4 +- .../pkg-plist.aarch64 (new) | 9 + audio/linux-c7-alsa-utils/distinfo | 4 +- audio/linux-c7-alsa-utils/pkg-plist.aarch64 (new) | 80 + audio/linux-c7-audiofile/distinfo | 4 +- audio/linux-c7-audiofile/pkg-plist.aarch64 (new) | 62 + audio/linux-c7-flac/Makefile | 1 + audio/linux-c7-flac/distinfo | 4 +- audio/linux-c7-flac/pkg-plist.aarch64 (new) | 10 + audio/linux-c7-gsm/distinfo | 4 +- audio/linux-c7-gsm/pkg-plist.aarch64 (new) | 6 + audio/linux-c7-libogg/distinfo | 4 +- audio/linux-c7-libogg/pkg-plist.aarch64 (new) | 6 + audio/linux-c7-libsndfile/distinfo | 4 +- audio/linux-c7-libsndfile/pkg-plist.aarch64 (new) | 6 + audio/linux-c7-libvorbis/distinfo | 4 +- audio/linux-c7-libvorbis/pkg-plist.aarch64 (new) | 7 + audio/linux-c7-openal-soft/distinfo | 4 +- audio/linux-c7-openal-soft/pkg-plist.aarch64 (new) | 8 + audio/linux-c7-pulseaudio-libs/distinfo | 6 +- .../pkg-plist.aarch64 (new) | 55 + audio/linux-c7-pulseaudio-utils/distinfo | 4 +- .../pkg-plist.aarch64 (new) | 20 + audio/linux-c7-sdl_mixer/Makefile | 2 +- audio/linux-c7-sdl_mixer/distinfo | 4 +- audio/linux-c7-sdl_mixer/pkg-plist.aarch64 (new) | 7 + converters/linux-c7-fribidi/distinfo | 4 +- .../linux-c7-fribidi/pkg-plist.aarch64 (new) | 10 + databases/linux-c7-sqlite3/distinfo | 4 +- databases/linux-c7-sqlite3/pkg-plist.aarch64 (new) | 5 + databases/linux-c7-unixODBC/distinfo | 3 + .../linux-c7-unixODBC/pkg-plist.aarch64 (new) | 109 + devel/linux-c7-dbus-glib/distinfo | 4 +- devel/linux-c7-dbus-glib/pkg-plist.aarch64 (new) | 5 + devel/linux-c7-dbus-libs/distinfo | 4 +- devel/linux-c7-dbus-libs/pkg-plist.aarch64 (new) | 3 + devel/linux-c7-devtools/Makefile | 8 +- devel/linux-c7-devtools/distinfo | 30 +- devel/linux-c7-devtools/pkg-plist.aarch64 (new) | 2434 +++++++++++++++++ devel/linux-c7-elfutils-libelf/distinfo | 4 +- .../pkg-plist.aarch64 (new) | 11 + devel/linux-c7-elfutils-libs/distinfo | 4 +- .../linux-c7-elfutils-libs/pkg-plist.aarch64 (new) | 36 + devel/linux-c7-icu/distinfo | 4 +- devel/linux-c7-icu/pkg-plist.aarch64 (new) | 18 + devel/linux-c7-libaio/distinfo | 4 +- devel/linux-c7-libaio/pkg-plist.aarch64 (new) | 5 + devel/linux-c7-libgfortran/distinfo | 4 +- devel/linux-c7-libgfortran/pkg-plist.aarch64 (new) | 2 + devel/linux-c7-libglade2/distinfo | 4 +- devel/linux-c7-libglade2/pkg-plist.aarch64 (new) | 8 + devel/linux-c7-libpciaccess/distinfo | 4 +- .../linux-c7-libpciaccess/pkg-plist.aarch64 (new) | 4 + devel/linux-c7-libsigc++20/distinfo | 4 +- devel/linux-c7-libsigc++20/pkg-plist.aarch64 (new) | 6 + devel/linux-c7-libthai/distinfo | 4 +- devel/linux-c7-libthai/pkg-plist.aarch64 (new) | 8 + devel/linux-c7-libtool-ltdl/distinfo | 3 + .../linux-c7-libtool-ltdl/pkg-plist.aarch64 (new) | 3 + devel/linux-c7-libunwind/distinfo | 4 +- devel/linux-c7-libunwind/pkg-plist.aarch64 (new) | 9 + devel/linux-c7-make/distinfo | 4 +- devel/linux-c7-make/pkg-plist.aarch64 (new) | 35 + devel/linux-c7-nspr/distinfo | 4 +- devel/linux-c7-nspr/pkg-plist.aarch64 (new) | 3 + devel/linux-c7-qt/distinfo | 4 +- devel/linux-c7-qt/pkg-plist.aarch64 (new) | 71 + devel/linux-c7-sdl12/distinfo | 4 +- devel/linux-c7-sdl12/pkg-plist.aarch64 (new) | 6 + devel/linux-c7-strace/Makefile | 8 + devel/linux-c7-strace/distinfo | 4 +- devel/linux-c7-strace/pkg-plist.aarch64 (new) | 4 + devel/linux-c7-systemd-libs/distinfo | 4 +- .../linux-c7-systemd-libs/pkg-plist.aarch64 (new) | 12 + devel/linux_libusb/Makefile | 3 +- dns/linux-c7-libasyncns/distinfo | 4 +- dns/linux-c7-libasyncns/pkg-plist.aarch64 (new) | 4 + emulators/linux_base-c7/Makefile | 23 +- emulators/linux_base-c7/distinfo | 108 +- emulators/linux_base-c7/pkg-plist.aarch64 (new) | 2818 ++++++++++++++++++++ ftp/linux-c7-curl/distinfo | 6 +- ftp/linux-c7-curl/pkg-plist.aarch64 (new) | 14 + graphics/linux-c7-cairo-gobject/distinfo | 4 +- .../linux-c7-cairo-gobject/pkg-plist.aarch64 (new) | 2 + graphics/linux-c7-cairo/distinfo | 4 +- graphics/linux-c7-cairo/pkg-plist.aarch64 (new) | 13 + graphics/linux-c7-dri/Makefile | 15 +- graphics/linux-c7-dri/distinfo | 24 +- graphics/linux-c7-dri/pkg-plist.aarch64 (new) | 111 + graphics/linux-c7-gdk-pixbuf2/distinfo | 4 +- .../linux-c7-gdk-pixbuf2/pkg-plist.aarch64 (new) | 134 + graphics/linux-c7-glx-utils/distinfo | 4 +- .../linux-c7-glx-utils/pkg-plist.aarch64 (new) | 5 + graphics/linux-c7-graphite2/distinfo | 4 +- .../linux-c7-graphite2/pkg-plist.aarch64 (new) | 7 + graphics/linux-c7-jasper/distinfo | 4 +- graphics/linux-c7-jasper/pkg-plist.aarch64 (new) | 6 + graphics/linux-c7-jbigkit/distinfo | 4 +- graphics/linux-c7-jbigkit/pkg-plist.aarch64 (new) | 6 + graphics/linux-c7-jpeg/distinfo | 4 +- graphics/linux-c7-jpeg/pkg-plist.aarch64 (new) | 6 + graphics/linux-c7-libdrm/distinfo | 4 +- graphics/linux-c7-libdrm/pkg-plist.aarch64 (new) | 15 + graphics/linux-c7-libepoxy/distinfo | 4 +- graphics/linux-c7-libepoxy/pkg-plist.aarch64 (new) | 3 + graphics/linux-c7-libglvnd/distinfo | 12 +- graphics/linux-c7-libglvnd/pkg-plist.aarch64 (new) | 27 + graphics/linux-c7-librsvg2/distinfo | 4 +- graphics/linux-c7-librsvg2/pkg-plist.aarch64 (new) | 14 + graphics/linux-c7-png/distinfo | 4 +- graphics/linux-c7-png/pkg-plist.aarch64 (new) | 9 + graphics/linux-c7-sdl_image/Makefile | 2 +- graphics/linux-c7-sdl_image/distinfo | 4 +- .../linux-c7-sdl_image/pkg-plist.aarch64 (new) | 6 + graphics/linux-c7-sdl_ttf/Makefile | 2 +- graphics/linux-c7-sdl_ttf/distinfo | 4 +- graphics/linux-c7-sdl_ttf/pkg-plist.aarch64 (new) | 5 + graphics/linux-c7-tiff/distinfo | 4 +- graphics/linux-c7-tiff/pkg-plist.aarch64 (new) | 8 + graphics/linux-c7-wayland/distinfo | 10 +- graphics/linux-c7-wayland/pkg-plist.aarch64 (new) | 12 + lang/linux-c7-tcl85/distinfo | 4 +- lang/linux-c7-tcl85/pkg-plist.aarch64 (new) | 926 +++++++ multimedia/linux-c7-libtheora/distinfo | 4 +- .../linux-c7-libtheora/pkg-plist.aarch64 (new) | 8 + multimedia/linux-c7-libv4l/distinfo | 4 +- multimedia/linux-c7-libv4l/pkg-plist.aarch64 (new) | 20 + multimedia/linux_dvbwrapper-kmod/Makefile | 2 +- net/linux-c7-avahi-libs/distinfo | 4 +- net/linux-c7-avahi-libs/pkg-plist.aarch64 (new) | 4 + net/linux-c7-openldap/distinfo | 4 +- net/linux-c7-openldap/pkg-plist.aarch64 (new) | 18 + net/linux-c7-tcp_wrappers-libs/distinfo | 4 +- .../pkg-plist.aarch64 (new) | 15 + print/linux-c7-cups-libs/distinfo | 4 +- print/linux-c7-cups-libs/pkg-plist.aarch64 (new) | 6 + print/linux-c7-freetype/distinfo | 4 +- print/linux-c7-freetype/pkg-plist.aarch64 (new) | 6 + print/linux-c7-harfbuzz/distinfo | 4 +- print/linux-c7-harfbuzz/pkg-plist.aarch64 (new) | 6 + security/linux-c7-cyrus-sasl2/distinfo | 4 +- .../linux-c7-cyrus-sasl2/pkg-plist.aarch64 (new) | 30 + security/linux-c7-gnutls/distinfo | 4 +- security/linux-c7-gnutls/pkg-plist.aarch64 (new) | 25 + security/linux-c7-libgcrypt/distinfo | 4 +- .../linux-c7-libgcrypt/pkg-plist.aarch64 (new) | 8 + security/linux-c7-libgpg-error/distinfo | 4 +- .../linux-c7-libgpg-error/pkg-plist.aarch64 (new) | 23 + security/linux-c7-libssh2/distinfo | 4 +- security/linux-c7-libssh2/pkg-plist.aarch64 (new) | 6 + security/linux-c7-libtasn1/distinfo | 4 +- security/linux-c7-libtasn1/pkg-plist.aarch64 (new) | 10 + security/linux-c7-nettle/distinfo | 4 +- security/linux-c7-nettle/pkg-plist.aarch64 (new) | 19 + security/linux-c7-nss/distinfo | 10 +- security/linux-c7-nss/pkg-plist.aarch64 (new) | 28 + security/linux-c7-p11-kit/distinfo | 4 +- security/linux-c7-p11-kit/pkg-plist.aarch64 (new) | 14 + security/linux-c7-trousers/distinfo | 4 +- security/linux-c7-trousers/pkg-plist.aarch64 (new) | 11 + sysutils/linux-c7-dosfstools/distinfo | 4 +- sysutils/linux-c7-lttng-ust/Makefile | 2 +- sysutils/linux-c7-lttng-ust/distinfo | 4 +- .../linux-c7-lttng-ust/pkg-plist.aarch64 (new) | 24 + sysutils/linux-c7-numactl-libs/distinfo | 4 +- .../linux-c7-numactl-libs/pkg-plist.aarch64 (new) | 2 + sysutils/linux-c7-userspace-rcu/Makefile | 2 +- sysutils/linux-c7-userspace-rcu/distinfo | 4 +- .../linux-c7-userspace-rcu/pkg-plist.aarch64 (new) | 20 + sysutils/linuxfdisk/Makefile | 2 + textproc/linux-c7-aspell/distinfo | 4 +- textproc/linux-c7-aspell/pkg-plist.aarch64 (new) | 132 + textproc/linux-c7-expat/distinfo | 4 +- textproc/linux-c7-expat/pkg-plist.aarch64 (new) | 6 + textproc/linux-c7-libcroco/distinfo | 4 +- textproc/linux-c7-libcroco/pkg-plist.aarch64 (new) | 8 + textproc/linux-c7-libxml2/distinfo | 4 +- textproc/linux-c7-libxml2/pkg-plist.aarch64 (new) | 12 + textproc/linux-c7-libxslt/distinfo | 4 +- textproc/linux-c7-libxslt/pkg-plist.aarch64 (new) | 13 + www/linux-c7-qtwebkit/Makefile | 2 +- www/linux-c7-qtwebkit/distinfo | 4 +- www/linux-c7-qtwebkit/pkg-plist.aarch64 (new) | 5 + x11-fonts/linux-c7-fontconfig/distinfo | 4 +- .../linux-c7-fontconfig/pkg-plist.aarch64 (new) | 37 + x11-toolkits/linux-c7-gtk2/distinfo | 6 +- x11-toolkits/linux-c7-gtk2/pkg-plist.aarch64 (new) | 150 ++ x11-toolkits/linux-c7-gtk3/distinfo | 6 +- x11-toolkits/linux-c7-gtk3/pkg-plist.aarch64 (new) | 162 ++ x11-toolkits/linux-c7-openmotif/distinfo | 4 +- .../linux-c7-openmotif/pkg-plist.aarch64 (new) | 10 + x11-toolkits/linux-c7-pango/distinfo | 4 +- .../linux-c7-pango/pkg-plist.aarch64 (new) | 20 + x11-toolkits/linux-c7-qt-x11/distinfo | 4 +- .../linux-c7-qt-x11/pkg-plist.aarch64 (new) | 115 + x11-toolkits/linux-c7-tk85/distinfo | 4 +- x11-toolkits/linux-c7-tk85/pkg-plist.aarch64 (new) | 264 ++ x11/linux-c7-libxkbcommon/distinfo | 4 +- x11/linux-c7-libxkbcommon/pkg-plist.aarch64 (new) | 3 + x11/linux-c7-pixman/distinfo | 4 +- x11/linux-c7-pixman/pkg-plist.aarch64 (new) | 2 + x11/linux-c7-xcb-util-image/distinfo | 4 +- .../pkg-plist.aarch64 (new) | 4 + x11/linux-c7-xcb-util-keysyms/distinfo | 4 +- .../pkg-plist.aarch64 (new) | 3 + x11/linux-c7-xcb-util/distinfo | 4 +- x11/linux-c7-xcb-util/pkg-plist.aarch64 (new) | 4 + x11/linux-c7-xorg-libs/distinfo | 72 +- x11/linux-c7-xorg-libs/pkg-plist.aarch64 (new) | 749 ++++++ 225 files changed, 10752 insertions(+), 128 deletions(-)