feat: add optimizations to env

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
sisungo committed 2026-10-07 13:35:08 +00:00
1 parent c42469740b
commit 085dd6b519
3 files changed
+22 -1

No files matched your search

+12
View File
@@ -6,14 +6,26 @@ all: dict[str, dict[str, str]] = {
"aarch64-semios-linux": {
"CC": "clang -target aarch64-unknown-linux-musl",
"CXX": "clang++ -target aarch64-unknown-linux-musl",
"CFLAGS": "-O3 -flto=thin",
"CXXFLAGS": "-O3 -flto=thin",
"LDFLAGS": "-flto=thin",
"RUSTFLAGS": "-Clto=thin -Ccodegen-units=1",
},
"x86_64-semios-linux": {
"CC": "clang -target x86_64-unknown-linux-musl",
"CXX": "clang++ -target x86_64-unknown-linux-musl",
"CFLAGS": "-O3 -march=x86-64-v3 -flto=thin",
"CXXFLAGS": "-O3 -march=x86-64-v3 -flto=thin",
"LDFLAGS": "-flto=thin",
"RUSTFLAGS": "-Ctarget-cpu=x86_64-v3 -Clto=thin -Ccodegen-units=1",
},
"riscv64-semios-linux": {
"CC": "clang -target riscv64-unknown-linux-musl",
"CXX": "clang++ -target riscv64-unknown-linux-musl",
"CFLAGS": "-O3 -flto=thin",
"CXXFLAGS": "-O3 -flto=thin",
"LDFLAGS": "-flto=thin",
"RUSTFLAGS": "-Clto=thin -Ccodegen-units=1",
},
}
_target: str = packie.host_arch()
+1 -1
View File
@@ -71,7 +71,7 @@ def ninja_install(rem: list[str] = [], chdir: bool = True, move: bool = True):
def meson_setup(rem: list[str] = []):
subprocess.run(["meson", "setup", "_meson_build"] + rem, check=True)
subprocess.run(["meson", "setup", "_meson_build"] + rem + ["--buildtype=release"], check=True)
def meson_compile(rem: list[str] = []):
+9
View File
@@ -57,6 +57,15 @@ archspec = {
def build():
# Disable LTO in CFLAGS, CXXFLAGS, LDFLAGS. Mesa cannot be built with LTO enabled.
for i in ["CFLAGS", "CXXFLAGS", "LDFLAGS"]:
os.environ[i] = (
os.environ.get(i, "")
.replace("-flto=thin", "")
.replace("-flto=full", "")
.replace("-flto", "")
)
cpp.meson_setup([
# Generic directories
f"--libdir=/lib/{arch.get_target()}",