Off-Topic > Off-Topic - Tiny Tux's Corner

Cosmos a "Fat Linux Distro"

(1/4) > >>


after hearing of Cosmopolitan Libc
which implements the αcτµαlly pδrταblε εxεcµταblε format"

the potential for a  "Fat (tc derived obviously) Distro" crossed my mind (  unicore or perhaps titanicore  :P  )

then i happened to find this mention of actual a fat distro zip
in the version 3.0 release of the Cosmopolitan library

--- Quote from: Cosmopolitan Third Edition ---a "Fat Linux Distro" which I've named the "Cosmos". In the Cosmos, every program is statically linked and contains a PKZIP central directory where its /usr/share dependencies are embedded. You can think of it as a coalition of individualistic executables, where each program can be separated from the whole and run on other OSes. So far it includes programs like Emacs, Vim, CoreUtils, Curl, etc.
163mb - PE+ELF+MachO+ZIP+SH executables
For AMD64+ARM64 on Linux+Mac+Windows+FreeBSD+NetBSD+OpenBSD

More specifically, the above zip file contains fat binaries for ape, python, lua, qjs, vim, emacs, emacsclient, nano, llama, bash, dash, less, grep, curl, wget, tidy, zip, unzip, zstd, bzip2, sqlite3, life, nesemu1, make (GNU + SECCOMP + Landlock), gmake (GNU), redbean, greenbean, datasette, assimilate, rusage, ctags, wall, pledge, verynice, find, tree, basename, chgrp, cp, date, du, expr, groups, ls, mknod, nl, pathchk, pwd, rm, seq, shred, stat, tee, uname, users, who, basenc, chmod, csplit, dd, echo, factor, head, mktemp, nohup, pinky, rmdir, shuf, stty, test, true, unexpand, vdir, whoami, awk, chown, df, false, id, link, mv, nproc, pr, rsync, sleep, sum, truncate, uniq, yes, b2sum, chroot, dir, fmt, install, md5sum, numfmt, printenv, readlink, runcon, sort, sync, timeout, tsort, unlink, base32, cat, cksum, cut, dircolors, env, fold, join, ln, mkdir, od, printf, realpath, script, split, tac, touch, tty, wc, base64, chcon, comm, dirname, expand, kill, logname, mkfifo, nice, paste, ptx, sed, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, tail, tr, ttyinfo, and uptime.

--- End quote ---

created with

--- Code: ---╠──────────────────────────────────────────────────────────────────────────────╣
│░░░░░░░█▀▀░█ █░██▀░░█░░█▀█░█▀█░█░░░█▀▀░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
│ αcτµαlly pδrταblε εxεcµταblε § program header                                │
--- End code ---


--- Quote ---Now you can build popular software such as bash,
curl, git, ninja, and even gcc itself, with Cosmopolitan Libc via the ./configure or cmake build system,
without having to change source code, and
the built executables should run on Linux, FreeBSD, MacOS, OpenBSD, NetBSD, and Windows too1.
You can download the binaries built using Github Actions
--- End quote ---

--- Quote from: ---build actually portable executables Pre-release contains tar, zip, unzip, bzip2, zstd, xz, brotli, gzip, and pigz contains bash, zsh, grep, less, lua, find, berry, GNU coreutils, and ninja contains vim, nano, and emacs (emacs now has gnutls support) contains the gcc-11 and binutils-2.35.2 tools targeting x86-64-linux-cosmo contains the gcc-11 and binutils-2.35.2 tools targeting aarch64-linux-cosmo contains datasette a build of CPython 3.11 with the datasette library contains python, a build of CPython 3.11 with a bunch of cli libraries like black, cookiecutter contains links, wget, curl, git, and rsync contains SDL2 test binaries built with libX11 (experimental, requires X Server to be running on the host system)

--- End quote ---

 the possibility of actual portability make me think of various "tc install" scripts/programs 
perhaps this could make various methods of scripted/automated installation actual portable!  ???

this looks very interesting (although it's clearly against tinycorelinux's philosophies)

One question, will a binary compiled on an x86_64 machine work on any other platform, 32bits, arm etc?

IMHO: Technically will NOT work on different machine architecture. Just on same architecture but different OS (magic header numbers in executable PE / ELF etc). Because each arch (x86, arm etc) has specific CPU instructions.

ex: So you compiled on x86-64-v3 (intel) the main body (the binary). Then you "glue" this body (less its Linux header) with an "universal" header (Linux / MacOS / Win). Then you try to run it on an ARM machine... The header will "possibly" run (after all is just a fuc*king small binary/ machine code ) and it jumps to body of program (x86/Intel assembly CPU instructions) and crash because those CPU instructions/registries not present on arm CPU.

EDIT: maybe will run, IF the ASM (first 4-10 bytes machine code) is same in each Firmware, and you include BOTH compiled versions of the body (one compiled for x86-64-v3 64 bits, and one cross-compiled for arm-32 bits) as a ZIP-packed collection bodies, etc. So  extra-fat .. not worthy in my opinion.


--- Quote from: nick65go on December 05, 2023, 06:31:40 AM ---Just on same architecture but different OS

--- End quote ---
Got it. Still, having a binary that works on multiple systems is a big deal.


[0] Message Index

[#] Next page

Go to full version