mirror of
https://github.com/dslm4515/BMLFS.git
synced 2025-08-16 16:39:38 +00:00
Upgraded Mesa (without Xorg Libraries) from 21.3.3 to 25.1.6
Libglvnd and libepoxy are required to build msa without Xorg libraries. Included more notes on gallium and vulkan drivers.
This commit is contained in:
@ -1,89 +1,162 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
# Mesa without Xorg
|
# Mesa without Xorg
|
||||||
# Source: ftp://ftp.freedesktop.org/pub/mesa/mesa-21.3.3.tar.xz
|
# Source: https://mesa.freedesktop.org/archive/mesa-25.1.6.tar.xz
|
||||||
#
|
#
|
||||||
# $BUILD = Directory to temporarily install
|
# $BUILD = Directory to temporarily install
|
||||||
# $PKGS = Directory to store built packages
|
# $PKGS = Directory to store built packages
|
||||||
#
|
#
|
||||||
# DEPS
|
# DEPS
|
||||||
# Required: LLVM, libdrm, Mako
|
# Required: LLVM, libdrm, Mako, PyYAML
|
||||||
# Recommended: Libva, libvdpau(for Xorg), wayland-protocols
|
# Recommended: Libva, libvdpau, wayland-protocols, glslang, libclc,
|
||||||
# Optional: libgcrypt, lm-sensors, nettle, valgrind, libunwind, glslang (for vulkan layers)
|
# Recommended: libglvnd, vulkan-loader, ply, libepoxy
|
||||||
|
# Optional: cbindgen, make-ca, rust-bindgen, libgcrypt, libunwind
|
||||||
|
# Optional: DirectX-Headers, lm-sensors, nettle, valgrind, libtizonia
|
||||||
|
|
||||||
# Apply patches from Alpine Linux
|
# As of version 22.x.x, Mesa's classic OpenGL drivers (non-Gallium3D) have been removed. These are the
|
||||||
patch -Np1 -i ../patches/mesa-alpine-21.2.1/0001-radeonsi-On-Aarch64-force-persistent-buffers-to-GTT.patch
|
# old Radeon R100 and R200 drivers, the original Nouveau code, and the Intel i915 and i965 drivers.
|
||||||
patch -Np1 -i ../patches/mesa-alpine-21.2.1/add-use-elf-tls.patch
|
# More info at https://www.phoronix.com/scan.php?page=news_item&px=Mesa-Classic-Retired
|
||||||
patch -Np1 -i ../patches/mesa-alpine/disable-rgb10-by-default.patch # patch needs update
|
|
||||||
patch -Np1 -i ../patches/mesa-alpine-21.2.1/musl-fix-includes.patch
|
# NOTE - Feature Support
|
||||||
|
# LLVM ................ llvmpipe, r300, r600, radeonsi drivers
|
||||||
|
# libclc .............. Intel iris driver
|
||||||
|
# glslang ............. Vulkan support
|
||||||
|
# vulkan-loader ....... Vulkan support
|
||||||
|
# ply ................. Intel Vulkan driver
|
||||||
|
# cbindgen ............ Nouveau Vulkan driver
|
||||||
|
# make-ca ............. Nouveau Vulkan driver
|
||||||
|
# rust-bindgen ........ Nouveau Vulkan driver
|
||||||
|
# libva ............... VA-API support for some gallium drivers.
|
||||||
|
# wayland-protocols ... Required for Plasma & GNOME; recommended for GTK3
|
||||||
|
# libvdpau ............ VDPAU drivers (X11 only)
|
||||||
|
# libglvnd ............ Required for building mesa without Xorg libraries
|
||||||
|
# libepoxy ............ Required for building mesa without Xorg libraries
|
||||||
|
|
||||||
|
# NOTE: Mesa Driver Options (source: BLFS)
|
||||||
|
# gallium-drivers
|
||||||
|
# o r300 ........ ATI Radeon 9000 or Radeon X series
|
||||||
|
# o r600 ........ AMD/ATI Radeon HD 2000-6000 series
|
||||||
|
# o radeonsi .... AMD Radeon HD 7000 or newer AMD GPU models
|
||||||
|
# o nouveau ..... Support NVIDA GPU's
|
||||||
|
# o virgl ....... QEMU virtual GPU with virglrender support
|
||||||
|
# o svga ........ VMWare virtual GPU
|
||||||
|
# o llvmpip ..... Use CPU for 3D rasterization
|
||||||
|
# o softpipe .... Use CPU for 3D rasterization; Slower than llvmpipe; Use if LLVM not installed
|
||||||
|
# o crocus ...... Intel GMA 3000, X3000 series, 4000 series, or X4000 series GPUs shipped with chipsets,
|
||||||
|
# or Intel HD GPUs shipped with pre-Broadwell CPUs
|
||||||
|
# o iris ........ Intel GPUs shipped with Broadwell or newer CPUs, or as a dedicated PCIe card)
|
||||||
|
# o i915 ........ Intel GMA 900, 950, 3100, or 3150 GPUs shipped with chipsets or Atom D/N 4xx/5xx CPUs
|
||||||
|
# o zink ........ uses Vulkan to implement OpenGL, and while unstable at times, it can be a decent
|
||||||
|
# replacement for non-performant gallium drivers like nouveau
|
||||||
|
# o asahi ....... Apple Silcon like M1 or M2
|
||||||
|
# o d3d12 ....... D3D12 support; Used to get full OpenGL 3.3 support on GPU's that only support D3D12
|
||||||
|
# o etnaviv .....
|
||||||
|
# o freedreno ...
|
||||||
|
# o lima ........ Mali Utgard (Mali-4xx) GPUs for ARM
|
||||||
|
# o panfrost .... Mali Midgard/Bifrost GPUs for ARM
|
||||||
|
# o tegra ....... Nvidia GPU's on ARM like TK1
|
||||||
|
# o vc4 ......... VideoCore IV found in Raspberry Pi's
|
||||||
|
# o v3d .........
|
||||||
|
# o auto ........ selects all Gallium3D drivers available for running hardware.
|
||||||
|
#
|
||||||
|
# vulkan-drivers
|
||||||
|
# o amd ......... AMD Radeon HD 7730 or newer AMD GPUs
|
||||||
|
# o intel ....... Intel GPUs shipped with Skylake or newer CPUs, or as a dedicated PCIe card
|
||||||
|
# o intel_hasvk.. Intel GPUs shipped with Ivy Bridge, Haswell, or Broadwell CPUs
|
||||||
|
# o nouveau ..... GTX 16XX, RTX 20XX, or newer NVIDIA GPUs
|
||||||
|
# o panfrost .... Mali Midgard/Bifrost GPUs for ARM
|
||||||
|
# o swrast ...... use CPU for 3D rasterization
|
||||||
|
# o nouveau ..... Nvidia GPU's
|
||||||
|
# o asahi ....... Apple Silicon like M1 or M2 graphics
|
||||||
|
# o broadcom freedreno virtio gfxstream imagination-experimental microsoft-experimental
|
||||||
|
#
|
||||||
|
# vulkan-layers
|
||||||
|
# o device-select
|
||||||
|
# o intel-nullhw
|
||||||
|
# o overlay
|
||||||
|
# o screenshot
|
||||||
|
# o vram-report-limit
|
||||||
|
|
||||||
|
|
||||||
|
# Per Alpine Linux, add missing symbols on x86 (32-bit) machines:
|
||||||
|
patch -Np1 -i ../patches/mesa-25.1.6-alpine/symbols-check-register-frame-info-bases.patch
|
||||||
|
|
||||||
|
# Per Alpine Linux, add the Rockchip EBC driver is used in the Pine64 PineNote.
|
||||||
|
patch -Np1 -i ../patches/mesa-25.1.6-alpine/23575.patch
|
||||||
|
|
||||||
|
# Per Alpine Linux, apply patch to fix assembler error when building on riscv
|
||||||
|
patch -Np1 -i ../patches/mesa-25.1.6-alpine/riscv64-tls.patch
|
||||||
|
|
||||||
# If optimizing, use these flags
|
# If optimizing, use these flags
|
||||||
# LTO is not recommended
|
# LTO breaks build on only x86, per Alpine Linux
|
||||||
|
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21371
|
||||||
|
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21180
|
||||||
|
# For other CPU arches, binaries are only ~5% smaller, per Alpine Linux
|
||||||
|
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/11846
|
||||||
export CFLAGS="-march=native -mtune=native "
|
export CFLAGS="-march=native -mtune=native "
|
||||||
export CFLAGS+="-Ofast -falign-functions=32 -fno-lto "
|
export CFLAGS+="-Ofast -falign-functions=32 -fno-lto "
|
||||||
export CFLAGS+="-fno-semantic-interposition -mprefer-vector-width=256 "
|
export CFLAGS+="-fno-semantic-interposition -mprefer-vector-width=256 "
|
||||||
export CXXFLAGS=$CFLAGS
|
export CXXFLAGS=$CFLAGS
|
||||||
unset LDFLAGS
|
unset LDFLAGS
|
||||||
|
|
||||||
|
export PVER="25.1.6"
|
||||||
|
|
||||||
export CFLAGS="$CFLAGS -D_XOPEN_SOURCE=700" &&
|
export CFLAGS="$CFLAGS -D_XOPEN_SOURCE=700" &&
|
||||||
case $(uname -m) in
|
case $(uname -m) in
|
||||||
i686|x86_64) export GLL_DRV="i915,nouveau,radeonsi,svga,swrast,r600,iris,crocus"
|
i686|x86_64) export GLL_DRV="i915,nouveau,radeonsi,svga,swrast,r600,iris,crocus"
|
||||||
export DRI_DRIVERS="i965,nouveau"
|
|
||||||
export V_DRIVERS="amd,swrast,intel" ;;
|
export V_DRIVERS="amd,swrast,intel" ;;
|
||||||
arm*) export GLL_DRV="vc4,panfrost,nouveau,tegra,swrast"
|
arm*) export GLL_DRV="vc4,panfrost,nouveau,tegra,swrast"
|
||||||
export DRI_DRIVEiRS="nouveau"
|
export V_DRIVERS="panfrost" ;;
|
||||||
export V_DRIVERS="" ;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Set configure flags
|
# Set configure flags
|
||||||
export BUILDOPT="-Dbuildtype=release "
|
export BUILDOPT="-Dbuildtype=release "
|
||||||
export BUILDOPT+="-Dllvm=enabled "
|
export BUILDOPT+="-Dllvm=enabled "
|
||||||
export BUILDOPT+="-Dshared-llvm=enabled "
|
export BUILDOPT+="-Dshared-llvm=enabled "
|
||||||
export BUILDOPT+="-Dosmesa=true "
|
#export BUILDOPT+="-Dosmesa=true " # Option deprecated
|
||||||
export BUILDOPT+="-Dtools= "
|
export BUILDOPT+="-Dtools= "
|
||||||
export BUILDOPT+="-Dvalgrind=false "
|
export BUILDOPT+="-Dvalgrind=disabled "
|
||||||
|
export BUILDOPT+="-Dspirv-to-dxil=true "
|
||||||
|
|
||||||
export GFXOPT="-Dglx=disabled "
|
export GFXOPT="-Dglx=disabled "
|
||||||
export GFXOPT+="-Dglx-read-only-text=true "
|
export GFXOPT+="-Dglx-read-only-text=true "
|
||||||
export GFXOPT+="-Dxlib-lease=disabled "
|
export GFXOPT+="-Dxlib-lease=disabled "
|
||||||
export GFXOPT+="-Ddri3=enabled "
|
|
||||||
export GFXOPT+="-Dopengl=true "
|
export GFXOPT+="-Dopengl=true "
|
||||||
export GFXOPT+="-Degl=enabled "
|
export GFXOPT+="-Degl=enabled "
|
||||||
export GFXOPT+="-Dgles2=enabled "
|
export GFXOPT+="-Dgles2=enabled "
|
||||||
export GFXOPT+="-Dgles1=enabled "
|
export GFXOPT+="-Dgles1=enabled "
|
||||||
export GFXOPT+="-Dshared-glapi=enabled "
|
#export GFXOPT+="-Dshared-glapi=enabled " # Option deprecated
|
||||||
|
|
||||||
|
# If libglvnd is installed
|
||||||
|
export GFXOPT+="-Dglvnd=enabled "
|
||||||
|
|
||||||
export DRVROPT="-Dplatforms=wayland "
|
export DRVROPT="-Dplatforms=wayland "
|
||||||
export DRVROPT+="-Degl-native-platform=wayland "
|
export DRVROPT+="-Degl-native-platform=wayland "
|
||||||
|
|
||||||
export GALLIUMOPT="-Dgallium-va=disabled "
|
export GALLIUMOPT="-Dgallium-va=enabled "
|
||||||
export GALLIUMOPT+="-Dgallium-xa=false "
|
#export GALLIUMOPT+="-Dgallium-xa=enabled " # Option deprecated
|
||||||
export GALLIUMOPT+="-Dgallium-xvmc=false "
|
#export GALLIUMOPT+="-Dgallium-nine=true " # Option deprecated
|
||||||
export GALLIUMOPT+="-Dgallium-nine=false "
|
|
||||||
export GALLIUMOPT+="-Dgallium-vdpau=disabled "
|
export GALLIUMOPT+="-Dgallium-vdpau=disabled "
|
||||||
|
#export GALLIUMOPT+="-Dgallium-opencl=standalone " # Option deprecated
|
||||||
|
export GALLIUMOPT+="-Dgallium-d3d12-video=enabled "
|
||||||
|
|
||||||
# For intel graphics only (i.e. intergrated graphics on some laptops)
|
# For intel graphics only (i.e. intergrated graphics on some laptops)
|
||||||
# then only enable these drivers:
|
# then only enable these drivers:
|
||||||
export DRI_DRIVERS="i965"
|
export GLL_DRV="i915,llvmpipe,zink,iris,crocus"
|
||||||
export GLL_DRV="i915,svga,swrast,iris,crocus"
|
export V_DRIVERS="swrast,intel,intel_hasvk"
|
||||||
export V_DRIVERS="swrast,intel"
|
|
||||||
|
|
||||||
# If glslang is installed, vulkan layers an be built
|
# If glslang is installed, vulkan layers an be built
|
||||||
export V_LAYERS="-Dvulkan-layers=device-select,overlay,intel-nullhw "
|
export V_LAYERS="-Dvulkan-layers=device-select,overlay,intel-nullhw "
|
||||||
|
|
||||||
export MESA_GIT_SHA1_OVERRIDE=53b2b224dc2de982c37915a0ad218e33365ff75e &&
|
meson setup --prefix=/usr \
|
||||||
python3 bin/git_sha1_gen.py --output include/git_sha1.h &&
|
|
||||||
|
|
||||||
meson --prefix=/usr \
|
|
||||||
-Dvulkan-drivers="${V_DRIVERS}" \
|
-Dvulkan-drivers="${V_DRIVERS}" \
|
||||||
-Ddri-drivers="${DRI_DRIVERS}" \
|
|
||||||
-Dgallium-drivers="${GLL_DRV}" \
|
-Dgallium-drivers="${GLL_DRV}" \
|
||||||
$BUILDOPT $GFXOPT $DRVROPT $GALLIUMOPT $V_LAYERS OUT
|
$BUILDOPT $GFXOPT $DRVROPT $GALLIUMOPT $V_LAYERS OUT
|
||||||
|
|
||||||
read -p "Compile?" && ninja -C OUT -j2 &&
|
read -p "Compile?" && ninja -C OUT -j2 &&
|
||||||
|
|
||||||
sudo -S DESTDIR=$BUILD ninja -C OUT install &&
|
sudo -S DESTDIR=$BUILD ninja -C OUT install &&
|
||||||
unset CFLAGS GLL_DRV DRI_DRIVERS MESA_GIT_SHA1_OVERRIDE V_DRIVERS &&
|
unset CFLAGS GLL_DRV DRI_DRIVERS V_DRIVERS &&
|
||||||
unset BUILDOPT GFXOPT DRVROPT GALLIUMOPT V_LAYERS
|
unset BUILDOPT GFXOPT DRVROPT GALLIUMOPT V_LAYERS
|
||||||
|
|
||||||
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
|
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
|
||||||
@ -109,5 +182,5 @@ mesa:
|
|||||||
mesa: Tailored without Xorg Libraries
|
mesa: Tailored without Xorg Libraries
|
||||||
EOF
|
EOF
|
||||||
sudo -S mv -v /tmp/slack-desc install/ &&
|
sudo -S mv -v /tmp/slack-desc install/ &&
|
||||||
sudo -S makepkg -l y -c n $PKGS/mesa-21.3.3_nox-$(uname -m)-mlfs.txz &&
|
sudo -S makepkg -l y -c n $PKGS/mesa-${PVER}_nox-$PSUFFIX &&
|
||||||
sudo -S rm -rf ${BUILD}/*
|
sudo -S rm -rf ${BUILD}/*
|
||||||
|
41
patches/mesa-25.1.6-alpine/23575.patch
Normal file
41
patches/mesa-25.1.6-alpine/23575.patch
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
From: Diederik de Haas <didi.debian@cknow.org>
|
||||||
|
Date: Sun, 22 Sep 2024 10:48:22 +0200
|
||||||
|
Subject: [PATCH] dri: Add Rockchip EBC to kmsro drivers
|
||||||
|
Forwarded: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23575
|
||||||
|
|
||||||
|
The Rockchip EBC driver is used in the Pine64 PineNote.
|
||||||
|
|
||||||
|
Link: https://lore.kernel.org/linux-arm-kernel/20220413221916.50995-1-samuel@sholland.org/
|
||||||
|
---
|
||||||
|
src/gallium/targets/dri/dri_target.c | 3 +++
|
||||||
|
src/gallium/targets/dril/dril_target.c | 1 +
|
||||||
|
src/gallium/targets/dril/meson.build | 1 +
|
||||||
|
3 files changed, 5 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/gallium/targets/dril/dril_target.c b/src/gallium/targets/dril/dril_target.c
|
||||||
|
index a94ab09858f..2e628ae1c02 100644
|
||||||
|
--- a/src/gallium/targets/dril/dril_target.c
|
||||||
|
+++ b/src/gallium/targets/dril/dril_target.c
|
||||||
|
@@ -599,6 +599,7 @@ DEFINE_LOADER_DRM_ENTRYPOINT(pl111)
|
||||||
|
DEFINE_LOADER_DRM_ENTRYPOINT(rcar_du)
|
||||||
|
DEFINE_LOADER_DRM_ENTRYPOINT(repaper)
|
||||||
|
DEFINE_LOADER_DRM_ENTRYPOINT(rockchip)
|
||||||
|
+DEFINE_LOADER_DRM_ENTRYPOINT(rockchip_ebc)
|
||||||
|
DEFINE_LOADER_DRM_ENTRYPOINT(rzg2l_du)
|
||||||
|
DEFINE_LOADER_DRM_ENTRYPOINT(ssd130x)
|
||||||
|
DEFINE_LOADER_DRM_ENTRYPOINT(st7586)
|
||||||
|
diff --git a/src/gallium/targets/dril/meson.build b/src/gallium/targets/dril/meson.build
|
||||||
|
index 3adf97b24a7..df802194bc5 100644
|
||||||
|
--- a/src/gallium/targets/dril/meson.build
|
||||||
|
+++ b/src/gallium/targets/dril/meson.build
|
||||||
|
@@ -89,6 +89,7 @@ foreach d : [[with_gallium_kmsro, [
|
||||||
|
'rcar-du_dri.so',
|
||||||
|
'repaper_dri.so',
|
||||||
|
'rockchip_dri.so',
|
||||||
|
+ 'rockchip-ebc_dri.so',
|
||||||
|
'rzg2l-du_dri.so',
|
||||||
|
'ssd130x_dri.so',
|
||||||
|
'st7586_dri.so',
|
||||||
|
--
|
||||||
|
2.45.2
|
||||||
|
|
15
patches/mesa-25.1.6-alpine/riscv64-tls.patch
Normal file
15
patches/mesa-25.1.6-alpine/riscv64-tls.patch
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
upstream: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11729
|
||||||
|
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index 3d72bb56f25..5161c97af11 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -496,7 +496,7 @@ foreach c_arg : get_option('c_args')
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
-if not have_mtls_dialect
|
||||||
|
+if not have_mtls_dialect and host_machine.cpu_family() != 'riscv64'
|
||||||
|
# need .run to check libc support. meson aborts when calling .run when
|
||||||
|
# cross-compiling, but because this is just an optimization we can skip it
|
||||||
|
if meson.is_cross_build() and not meson.can_run_host_binaries()
|
@ -0,0 +1,37 @@
|
|||||||
|
From 56a786c0e1b9386817c87564c0c6b15a6f5f98d6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: fossdd <fossdd@pwned.life>
|
||||||
|
Date: Wed, 16 Jul 2025 23:31:31 +0200
|
||||||
|
Subject: [PATCH] bin/symbols-check: add __(de)register_frame_info_bases to
|
||||||
|
platform symbols
|
||||||
|
|
||||||
|
Cause of the following error on x86 (32-bit):
|
||||||
|
|
||||||
|
src/gbm/libgbm.so.1.0.0: unknown symbol exported: __deregister_frame_info_bases
|
||||||
|
src/gbm/libgbm.so.1.0.0: unknown symbol exported: __register_frame_info_bases
|
||||||
|
---
|
||||||
|
bin/symbols-check.py | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/bin/symbols-check.py b/bin/symbols-check.py
|
||||||
|
index 841860c65ad53..94b3d281b4b18 100644
|
||||||
|
--- a/bin/symbols-check.py
|
||||||
|
+++ b/bin/symbols-check.py
|
||||||
|
@@ -43,6 +43,7 @@ PLATFORM_SYMBOLS = [
|
||||||
|
'__cxa_uncaught_exceptions',
|
||||||
|
'__cxa_unexpected_handler',
|
||||||
|
'__deregister_frame_info',
|
||||||
|
+ '__deregister_frame_info_bases',
|
||||||
|
'__dynamic_cast',
|
||||||
|
'__emutls_get_address',
|
||||||
|
'__end__',
|
||||||
|
@@ -51,6 +52,7 @@ PLATFORM_SYMBOLS = [
|
||||||
|
'__odr_asan._glapi_Context',
|
||||||
|
'__odr_asan._glapi_Dispatch',
|
||||||
|
'__register_frame_info',
|
||||||
|
+ '__register_frame_info_bases',
|
||||||
|
'_bss_end__',
|
||||||
|
'_edata',
|
||||||
|
'_end',
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
Reference in New Issue
Block a user