Skip to content

Instantly share code, notes, and snippets.

@yuri1969
Last active October 4, 2024 20:17
Show Gist options
  • Save yuri1969/892972c420b11c2462304cf675dfb50c to your computer and use it in GitHub Desktop.
Save yuri1969/892972c420b11c2462304cf675dfb50c to your computer and use it in GitHub Desktop.
Gentoo Portage make.conf - ThinkPad T480
###################################################
#
# ThinkPad T480
#
# i7-8550U, 9th Gen Intel GFX, SSD WD NS720 512G
#
###################################################
# Prefer stability over agressive optimizations
# Use '-march=native' since working fine; check: 'echo | gcc -### -E - -march=native'
# Align functions to 32B since that's Intel's fetch size in Sandy Bridge and newer processors
# Align variables to cache line size
# Enable vectorization in order to utilize SIMDs
COMMON_FLAGS="-march=native -O2 -pipe -falign-functions=32 -ftree-vectorize -ftree-slp-vectorize"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
LDFLAGS="${LDFLAGS} -Wl,--hash-style=gnu"
# https://rust-lang-nursery.github.io/packed_simd/perf-guide/target-feature/rustflags.html
RUSTFLAGS="-C target-cpu=native -C opt-level=3"
# Available x86 instruction sets; https://wiki.gentoo.org/wiki/CPU_FLAGS_*
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3"
# Allow spawning 8 parallel make jobs; Target 8 logical CPU threads; 8 + 1 would make the CPU choke https://wiki.gentoo.org/wiki/MAKEOPTS
MAKEOPTS="-j8"
# Restrict Emerge to build just a single package (--jobs 1 * -j8 => 8); https://wiki.gentoo.org/wiki/EMERGE_DEFAULT_OPTS
EMERGE_DEFAULT_OPTS="--ask --jobs 1 --quiet-build y"
# Deprioritize build jobs CPU - 'Idle' scheduling class
PORTAGE_SCHEDULING_POLICY="idle"
# Deprioritize build jobs I/O - 'Idle' scheduling class
PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"
# Save messages after emerging to /var/log/portage/elog
PORTAGE_ELOG_SYSTEM="echo save"
# By app-portage/mirrorselect
GENTOO_MIRRORS="ftp://gentoo.mirror.web4u.cz/ ftp://tux.rainside.sk/gentoo/"
# Minor security tuning
FEATURES="userfetch binpkg-request-signature"
# USE flags for a GNOME, SMP targeted laptop installation; Used with '/desktop/gnome/systemd' profile; https://packages.gentoo.org/useflags
HARDWARE="acpi alsa apm bluetooth mtp nat gpu-accel openal openmp sharedmem smp opencl tcmalloc threads aio upnp upnp-av udev lm-sensors usb wifi xkb cryptsetup"
COMPRESSION="bzip2 gzip lz4 lzma lzo rar snappy zip zlib zstd"
GTK="gtk gtk3 gtkstyle"
# libinput
DRIVERS="libinput"
GRAPHICS="X dri opengl vulkan vaapi truetype cleartype corefonts xft colord"
# LTO requires over 8GiB RAM - disable the 'lto' USE flag individually
COMPILATION="lto pgo graphite"
DISABLE="-mpi -kde -qt5 -wayland -vdpau -consolekit -cups -ppp -ieee1394 -dc1394 -ldap -cdr -cdrom -dvd -dvdr -btrfs -zfs -fortran -samba -icu -libav -ssh1 -bindist -webengine"
MISC="systemd networkmanager pulseaudio dbus initramfs startup-notification libnotify bash-completion ssl curl http seccomp json latex raw exif gd xmp unicode fontconfig branding offensive"
# Merge all subsets
USE="${HARDWARE} ${COMPRESSION} ${GTK} ${GRAPHICS} ${DRIVERS} ${COMPILATION} ${DISABLE} ${MISC}"
LINGUAS="en"
L10N="en en-US"
# Intel GMA Gen 9 - Coffee Lake; https://wiki.gentoo.org/wiki/Intel
VIDEO_CARDS="intel"
# Input devices
INPUT_DEVICES="libinput"
# EFI 64 instead of legacy BIOS
GRUB_PLATFORMS="efi-64"
# Install only firmware for the current CPU
MICROCODE_SIGNATURES="-S"
# Filter LLVM's targets to x86 only
LLVM_TARGETS="X86"
# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C.utf8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment