Skip to content

dslm4515/Optimux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optimux

Optimized Musl Linux

This is a deriviative of MLFS (Musl Linux From Scratch) with a focus on optimization and speed.

Methods and patches will be from Alpine Linux, Void Linux, and Clear Linux. Work from Alpine and Void are primarily for Musl Libc support and optimizations from Clear Linux.

Specification

  • Compiler: GNU's GCC
  • Binary Utilities: GNU Binutils
  • System Library C: Musl
  • INIT system: skarnet's S6 & S6-rc
  • TLS Implementaion: LibreSSL
  • Device manager: Udev
  • Gettext: gettext-tiny
  • Zlib: zlib-ng

Method

Build cross-tools & tools just like in MLFS, but enable LTO & graphite (ISL) in tools' GCC & binutils.

Most packages [in chroot] will be built with these flags:

CFLAGS="-flto -march=native -mtune=native -O3 -pipe -fno-semantic-interposition "
CFLAGS+="-falign-functions=32 -flimit-function-alignment -malign-data=cacheline "
CXXFLAGS=$CFLAGS
LDFLAGS="-flto -Wl,-O2 -Wl,--as-needed

To see what to set for march and mtune, run the following on the target machine:

gcc -march=native -Q --help=target | grep march | sed '2d' && \
gcc -march=native -Q --help=target | grep mtune | sed '1d' | sed '2d'

Goals

  • Build GCC with Graphite
  • Build GCC with LTO(full) support
  • Build rootfs with LTO and optimizing flags
  • Clean up patches for GCC-11.2
  • Merge bin, sbin, and lib
  • Add script to check build requirements
  • Update initramfs to use binaries from s6-portable-utils
  • Port to aarch64 (64-bit ARM)
  • Port to i686 (32-bit x86)

Build Requirements

  • bash 3.2 (/bin/sh should be a symbolic or hard link to bash)
  • binutils 2.25
  • bison 2.7 (/usr/bin/yacc should be a link to bison or small script that executes bison)
  • bzip2 1.0.4
  • coreutils 6.9
  • diffutils 2.8.1
  • findutils 4.2.31
  • gawk 4.0.1 (/usr/bin/awk should be a link to gawk)
  • GCC 6.2, including the C++ compiler, g++
  • Glibc 2.11 / Musl Libc 1.20
  • Grep 2.5.1a
  • gzip 1.3.12
  • linux kernel 3.2 (not sure if it matters, as most distros are running 4.x/5.x kernels)
  • m4 1.4.10
  • make 4.0
  • patch 2.5.4
  • Python 3.4
  • sed 4.1.5
  • tar 1.22
  • texinfo 4.7
  • xz 5.0.0

Issues

Built system will not allow any logins. This was caused by a broken Shadow-4.9 build. Using shadow-4.8 build from MLFS for now.