# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/firefox/hotfix-gcc-lto-sandbox-syscallasm.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- Fix gcc LTO link failure of libmozsandbox: undefined reference to SyscallAsm The workaround forcing a single LTO partition (so the file-scope asm in seccomp-bpf/syscall.cc lands in the same partition as its user) checked OS_CXXFLAGS for -flto, but the LTO flags are carried in MOZ_LTO_CFLAGS, so it never applied. Check CONFIG["MOZ_LTO"] instead. Signed-off-by: René Rebe --- firefox-154.0/security/sandbox/linux/moz.build.orig +++ firefox-154.0/security/sandbox/linux/moz.build @@ -128,9 +128,9 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc") # gcc lto likes to put the top level asm in syscall.cc in a different partition # from the function using it which breaks the build. Work around that by # forcing there to be only one partition. -for f in CONFIG["OS_CXXFLAGS"]: - if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang": - LDFLAGS += ["--param lto-partitions=1"] +# The LTO flags live in MOZ_LTO_CFLAGS, not OS_CXXFLAGS, so check MOZ_LTO. +if CONFIG["MOZ_LTO"] and CONFIG["CC_TYPE"] != "clang": + LDFLAGS += ["--param", "lto-partitions=1"] DEFINES["NS_NO_XPCOM"] = True DisableStlWrapping()