mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-24 00:59:22 -04:00
Pull Kbuild / Kconfig updates from Nathan Chancellor:
"Kbuild:
- Remove broken module linking exclusion for BTF
- Add documentation around how offset header files work
- Include unstripped vDSO libraries in pacman packages
- Bump minimum version of LLVM for building the kernel to 17.0.1 and
clean up unnecessary workarounds
- Use a context manager in run-clang-tools
- Add dist macro value if present to release tag for RPM packages
- Detect and report truncated buf_printf() output in modpost
- Add __llvm_covfun and __llvm_covmap to section whitelist in modpost
- Support Clang's distributed ThinLTO mode
- Remove architecture specific configurations for AutoFDO and
Propeller to ease individual architecture maintenance
Kconfig:
- Add kconfig-sym-check target to look for dangling Kconfig symbol
references and invalid tristate literal values
- Harden against potential NULL pointer dereference
- Fix typo in Kconfig test comment"
* tag 'kbuild-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux: (31 commits)
kconfig: tests: fix typo in comment
kconfig: Remove the architecture specific config for Propeller
kconfig: Remove the architecture specific config for AutoFDO
modpost: Add __llvm_covfun and __llvm_covmap to section_white_list
kconfig: add kconfig-sym-check static checker
kbuild: Remove unnecessary 'T' modifier in cmd_ar_builtin_fixup
kbuild: distributed build support for Clang ThinLTO
kbuild: move vmlinux.a build rule to scripts/Makefile.vmlinux_a
scripts: modpost: detect and report truncated buf_printf() output
kbuild: rpm-pkg: append %{?dist} macro to Release tag
run-clang-tools: run multiprocessing.Pool as context manager
compiler-clang.h: Drop explicit version number from "all" diagnostic macro
compiler-clang.h: Remove __cleanup -Wunused-variable workaround
kbuild: Remove check for broken scoping with clang < 17 in CC_HAS_ASM_GOTO_OUTPUT
x86/entry/vdso32: Remove conditional omission of '.cfi_offset eflags'
x86/module: Revert "Deal with GOT based stack cookie load on Clang < 17"
x86/build: Drop unnecessary '-ffreestanding' addition to KBUILD_CFLAGS
scripts/Makefile.warn: Drop -Wformat handling for clang < 16
riscv: Drop tautological condition from TOOLCHAIN_NEEDS_OLD_ISA_SPEC
riscv: Remove tautological condition from selection of ARCH_SUPPORTS_CFI
...
135 lines
3.4 KiB
Bash
135 lines
3.4 KiB
Bash
# SPDX-License-Identifier: GPL-2.0-only
|
|
# Maintainer: Thomas Weißschuh <linux@weissschuh.net>
|
|
# Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
|
|
|
|
pkgbase=${PACMAN_PKGBASE:-linux-upstream}
|
|
pkgname=("${pkgbase}")
|
|
|
|
_extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers debug}
|
|
for pkg in $_extrapackages; do
|
|
pkgname+=("${pkgbase}-${pkg}")
|
|
done
|
|
|
|
pkgver="$(echo "${KERNELRELEASE}" | sed 's/-\(rc[0-9]\+\)/\1/;s/-/_/g')"
|
|
# The PKGBUILD is evaluated multiple times.
|
|
# Running scripts/build-version from here would introduce inconsistencies.
|
|
pkgrel="${KBUILD_REVISION}"
|
|
pkgdesc='Upstream Linux'
|
|
url='https://www.kernel.org/'
|
|
# Enable flexible cross-compilation
|
|
arch=(${CARCH})
|
|
license=(GPL-2.0-only)
|
|
makedepends=(
|
|
bc
|
|
bison
|
|
flex
|
|
gettext
|
|
kmod
|
|
libelf
|
|
openssl
|
|
pahole
|
|
perl
|
|
python
|
|
rsync
|
|
tar
|
|
)
|
|
options=(!debug !strip !buildflags !makeflags)
|
|
|
|
_prologue() {
|
|
# MAKEFLAGS from makepkg.conf override the ones inherited from kbuild.
|
|
# Bypass this override with a custom variable.
|
|
export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
|
|
|
|
# Kbuild works in the output directory, where this PKGBUILD is located.
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
}
|
|
|
|
build() {
|
|
_prologue
|
|
|
|
${MAKE} KERNELRELEASE="${KERNELRELEASE}" KBUILD_BUILD_VERSION="${pkgrel}"
|
|
}
|
|
|
|
_package() {
|
|
pkgdesc="The ${pkgdesc} kernel and modules"
|
|
|
|
local modulesdir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}"
|
|
|
|
_prologue
|
|
|
|
echo "Installing boot image..."
|
|
# systemd expects to find the kernel here to allow hibernation
|
|
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
|
|
install -Dm644 "$(${MAKE} -s image_name)" "${modulesdir}/vmlinuz"
|
|
|
|
# Used by mkinitcpio to name the kernel
|
|
echo "${pkgbase}" > "${modulesdir}/pkgbase"
|
|
|
|
echo "Installing modules..."
|
|
${MAKE} INSTALL_MOD_PATH="${pkgdir}/usr" INSTALL_MOD_STRIP=1 \
|
|
DEPMOD=true modules_install
|
|
|
|
if [ -d "${srctree}/arch/${SRCARCH}/boot/dts" ]; then
|
|
echo "Installing dtbs..."
|
|
${MAKE} INSTALL_DTBS_PATH="${modulesdir}/dtb" dtbs_install
|
|
fi
|
|
|
|
# remove build link, will be part of -headers package
|
|
rm -f "${modulesdir}/build"
|
|
}
|
|
|
|
_package-headers() {
|
|
pkgdesc="Headers and scripts for building modules for the ${pkgdesc} kernel"
|
|
|
|
local builddir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}/build"
|
|
|
|
_prologue
|
|
|
|
if grep -q CONFIG_MODULES=y include/config/auto.conf; then
|
|
echo "Installing build files..."
|
|
"${srctree}/scripts/package/install-extmod-build" "${builddir}"
|
|
fi
|
|
|
|
echo "Installing System.map and config..."
|
|
mkdir -p "${builddir}"
|
|
cp System.map "${builddir}/System.map"
|
|
cp .config "${builddir}/.config"
|
|
|
|
echo "Adding symlink..."
|
|
mkdir -p "${pkgdir}/usr/src"
|
|
ln -sr "${builddir}" "${pkgdir}/usr/src/${pkgbase}"
|
|
}
|
|
|
|
_package-api-headers() {
|
|
pkgdesc="Kernel headers sanitized for use in userspace"
|
|
provides=(linux-api-headers="${pkgver}")
|
|
conflicts=(linux-api-headers)
|
|
|
|
_prologue
|
|
|
|
${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr"
|
|
}
|
|
|
|
_package-debug(){
|
|
pkgdesc="Non-stripped vmlinux file for the ${pkgdesc} kernel"
|
|
|
|
local debugdir="${pkgdir}/usr/src/debug/${pkgbase}"
|
|
local builddir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}/build"
|
|
|
|
_prologue
|
|
|
|
install -Dt "${debugdir}" -m644 vmlinux
|
|
mkdir -p "${builddir}"
|
|
ln -sr "${debugdir}/vmlinux" "${builddir}/vmlinux"
|
|
|
|
echo "Installing unstripped vDSO(s)..."
|
|
${MAKE} INSTALL_MOD_PATH="${pkgdir}/usr" vdso_install
|
|
}
|
|
|
|
for _p in "${pkgname[@]}"; do
|
|
eval "package_$_p() {
|
|
$(declare -f "_package${_p#$pkgbase}")
|
|
_package${_p#$pkgbase}
|
|
}"
|
|
done
|