Added again clang optional compilation. Simplify makes.
This commit is contained in:
parent
b615b6db3d
commit
e6566526b6
6
.SRCINFO
6
.SRCINFO
|
@ -1,5 +1,5 @@
|
||||||
pkgbase = linux-xanmod
|
pkgbase = linux-xanmod
|
||||||
pkgdesc = Linux Xanmod - Current Stable (STABLE)
|
pkgdesc = Linux Xanmod - Current Stable (CURRENT)
|
||||||
pkgver = 6.0.2
|
pkgver = 6.0.2
|
||||||
pkgrel = 1
|
pkgrel = 1
|
||||||
url = http://www.xanmod.org/
|
url = http://www.xanmod.org/
|
||||||
|
@ -22,7 +22,7 @@ pkgbase = linux-xanmod
|
||||||
sha256sums = 5c2443a5538de52688efb55c27ab0539c1f5eb58c0cfd16a2b9fbb08fd81788e
|
sha256sums = 5c2443a5538de52688efb55c27ab0539c1f5eb58c0cfd16a2b9fbb08fd81788e
|
||||||
sha256sums = SKIP
|
sha256sums = SKIP
|
||||||
sha256sums = feb15accc0576f78eca9cbf8f8178419c4a2aeb3915a9bfefacf2467bcc55b35
|
sha256sums = feb15accc0576f78eca9cbf8f8178419c4a2aeb3915a9bfefacf2467bcc55b35
|
||||||
sha256sums = 1ac18cad2578df4a70f9346f7c6fccbb62f042a0ee0594817fdef9f2704904ee
|
sha256sums = 5c84bfe7c1971354cff3f6b3f52bf33e7bbeec22f85d5e7bfde383b54c679d30
|
||||||
|
|
||||||
pkgname = linux-xanmod
|
pkgname = linux-xanmod
|
||||||
pkgdesc = The Linux kernel and modules with Xanmod patches
|
pkgdesc = The Linux kernel and modules with Xanmod patches
|
||||||
|
@ -37,5 +37,5 @@ pkgname = linux-xanmod
|
||||||
provides = NTFS3-MODULE
|
provides = NTFS3-MODULE
|
||||||
|
|
||||||
pkgname = linux-xanmod-headers
|
pkgname = linux-xanmod-headers
|
||||||
pkgdesc = Headers and scripts for building modules for the Linux Xanmod - Current Stable (STABLE) kernel
|
pkgdesc = Headers and scripts for building modules for the Linux Xanmod - Current Stable (CURRENT) kernel
|
||||||
depends = pahole
|
depends = pahole
|
||||||
|
|
33
PKGBUILD
33
PKGBUILD
|
@ -31,18 +31,19 @@ if [ -z ${use_tracers+x} ]; then
|
||||||
use_tracers=y
|
use_tracers=y
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## NOTICE: clang config is not ready yet in 5.17.x
|
# Unique compiler supported upstream is GCC
|
||||||
## Choose between GCC and CLANG config (default is GCC)
|
## Choose between GCC and CLANG config (default is GCC)
|
||||||
if [ -z ${_compiler+x} ] || [ "$_compiler" = "clang" ]; then
|
## Use the environment variable "_compiler=clang"
|
||||||
_compiler=gcc
|
if [ "${_compiler}" = "clang" ]; then
|
||||||
|
_compiler_flags="CC=clang HOSTCC=clang LLVM=1 LLVM_IAS=1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Choose between the 3 main configs for EDGE branch. Default x86-64-v2 which use CONFIG_GENERIC_CPU2:
|
# Choose between the 4 main configs for stable branch. Default x86-64-v1 which use CONFIG_GENERIC_CPU2:
|
||||||
# Possible values: config_x86-64 (default) / config_x86-64-v2 / config_x86-64-v3
|
# Possible values: config_x86-64-v1 (default) / config_x86-64-v2 / config_x86-64-v3 / config_x86-64-v4
|
||||||
# This will be overwritten by selecting any option in microarchitecture script
|
# This will be overwritten by selecting any option in microarchitecture script
|
||||||
# Source files: https://github.com/xanmod/linux/tree/5.17/CONFIGS/xanmod/gcc
|
# Source files: https://github.com/xanmod/linux/tree/5.17/CONFIGS/xanmod/gcc
|
||||||
if [ -z ${_config+x} ]; then
|
if [ -z ${_config+x} ]; then
|
||||||
_config=config_x86-64
|
_config=config_x86-64-v1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Compress modules with ZSTD (to save disk space)
|
# Compress modules with ZSTD (to save disk space)
|
||||||
|
@ -75,7 +76,7 @@ pkgver=${_major}.2
|
||||||
_branch=5.x
|
_branch=5.x
|
||||||
xanmod=1
|
xanmod=1
|
||||||
pkgrel=${xanmod}
|
pkgrel=${xanmod}
|
||||||
pkgdesc='Linux Xanmod - Current Stable (STABLE)'
|
pkgdesc='Linux Xanmod - Current Stable (CURRENT)'
|
||||||
url="http://www.xanmod.org/"
|
url="http://www.xanmod.org/"
|
||||||
arch=(x86_64)
|
arch=(x86_64)
|
||||||
|
|
||||||
|
@ -109,7 +110,7 @@ done
|
||||||
sha256sums=('5c2443a5538de52688efb55c27ab0539c1f5eb58c0cfd16a2b9fbb08fd81788e'
|
sha256sums=('5c2443a5538de52688efb55c27ab0539c1f5eb58c0cfd16a2b9fbb08fd81788e'
|
||||||
'SKIP'
|
'SKIP'
|
||||||
'feb15accc0576f78eca9cbf8f8178419c4a2aeb3915a9bfefacf2467bcc55b35'
|
'feb15accc0576f78eca9cbf8f8178419c4a2aeb3915a9bfefacf2467bcc55b35'
|
||||||
'1ac18cad2578df4a70f9346f7c6fccbb62f042a0ee0594817fdef9f2704904ee')
|
'5c84bfe7c1971354cff3f6b3f52bf33e7bbeec22f85d5e7bfde383b54c679d30')
|
||||||
|
|
||||||
export KBUILD_BUILD_HOST=${KBUILD_BUILD_HOST:-archlinux}
|
export KBUILD_BUILD_HOST=${KBUILD_BUILD_HOST:-archlinux}
|
||||||
export KBUILD_BUILD_USER=${KBUILD_BUILD_USER:-makepkg}
|
export KBUILD_BUILD_USER=${KBUILD_BUILD_USER:-makepkg}
|
||||||
|
@ -137,12 +138,11 @@ prepare() {
|
||||||
done
|
done
|
||||||
|
|
||||||
# Applying configuration
|
# Applying configuration
|
||||||
cp -vf CONFIGS/xanmod/${_compiler}/${_config} .config
|
cp -vf CONFIGS/xanmod/gcc/${_config} .config
|
||||||
# enable LTO_CLANG_THIN
|
# enable LTO_CLANG_THIN
|
||||||
if [ "${_compiler}" = "clang" ]; then
|
if [ "${_compiler}" = "clang" ]; then
|
||||||
scripts/config --disable LTO_CLANG_FULL
|
scripts/config --disable LTO_CLANG_FULL
|
||||||
scripts/config --enable LTO_CLANG_THIN
|
scripts/config --enable LTO_CLANG_THIN
|
||||||
_LLVM=1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# CONFIG_STACK_VALIDATION gives better stack traces. Also is enabled in all official kernel packages by Archlinux team
|
# CONFIG_STACK_VALIDATION gives better stack traces. Also is enabled in all official kernel packages by Archlinux team
|
||||||
|
@ -172,7 +172,10 @@ prepare() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Let's user choose microarchitecture optimization in GCC
|
# Let's user choose microarchitecture optimization in GCC
|
||||||
../choose-gcc-optimization.sh $_microarchitecture
|
# Use default microarchitecture only if we have not choosen another microarchitecture
|
||||||
|
if [ "$_microarchitecture" -ne "0" ]; then
|
||||||
|
../choose-gcc-optimization.sh $_microarchitecture
|
||||||
|
fi
|
||||||
|
|
||||||
# This is intended for the people that want to build this package with their own config
|
# This is intended for the people that want to build this package with their own config
|
||||||
# Put the file "myconfig" at the package folder (this will take preference) or "${XDG_CONFIG_HOME}/linux-xanmod/myconfig"
|
# Put the file "myconfig" at the package folder (this will take preference) or "${XDG_CONFIG_HOME}/linux-xanmod/myconfig"
|
||||||
|
@ -199,20 +202,20 @@ prepare() {
|
||||||
if [ "$_localmodcfg" = "y" ]; then
|
if [ "$_localmodcfg" = "y" ]; then
|
||||||
if [ -f $HOME/.config/modprobed.db ]; then
|
if [ -f $HOME/.config/modprobed.db ]; then
|
||||||
msg2 "Running Steven Rostedt's make localmodconfig now"
|
msg2 "Running Steven Rostedt's make localmodconfig now"
|
||||||
make LLVM=$_LLVM LLVM_IAS=$_LLVM LSMOD=$HOME/.config/modprobed.db localmodconfig
|
make ${_compiler_flags} LSMOD=$HOME/.config/modprobed.db localmodconfig
|
||||||
else
|
else
|
||||||
msg2 "No modprobed.db data found"
|
msg2 "No modprobed.db data found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make LLVM=$_LLVM LLVM_IAS=$_LLVM olddefconfig
|
make ${_compiler_flags} olddefconfig
|
||||||
|
|
||||||
make -s kernelrelease > version
|
make -s kernelrelease > version
|
||||||
msg2 "Prepared %s version %s" "$pkgbase" "$(<version)"
|
msg2 "Prepared %s version %s" "$pkgbase" "$(<version)"
|
||||||
|
|
||||||
if [ "$_makenconfig" = "y" ]; then
|
if [ "$_makenconfig" = "y" ]; then
|
||||||
make LLVM=$_LLVM LLVM_IAS=$_LLVM nconfig
|
make ${_compiler_flags} nconfig
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# save configuration for later reuse
|
# save configuration for later reuse
|
||||||
|
@ -221,7 +224,7 @@ prepare() {
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd linux-${_major}
|
cd linux-${_major}
|
||||||
make LLVM=$_LLVM LLVM_IAS=$_LLVM all
|
make ${_compiler_flags} all
|
||||||
}
|
}
|
||||||
|
|
||||||
_package() {
|
_package() {
|
||||||
|
|
|
@ -66,7 +66,7 @@ cat << EOF
|
||||||
98) Intel-Native optimizations autodetected by GCC
|
98) Intel-Native optimizations autodetected by GCC
|
||||||
99) AMD-Native optimizations autodetected by GCC
|
99) AMD-Native optimizations autodetected by GCC
|
||||||
|
|
||||||
0) Generic (default)
|
0) Generic x64-v1 (default)
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -133,7 +133,16 @@ warning "According to PKGBUILD variable _microarchitecture, your choice is $answ
|
||||||
msg "Building this package for microarchitecture: $Microarchitecture$default"
|
msg "Building this package for microarchitecture: $Microarchitecture$default"
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
_defaultmicro=$(grep ^CONFIG_LOCALVERSION .config)
|
||||||
|
if [ -z "${default}" ]; then
|
||||||
|
_localversion=$(echo ${Microarchitecture,,} | sed -e 's/config_m/-/g' -e 's/config_generic_cpu/-x64v/g')
|
||||||
|
sed -e "s|^$_defaultmicro|CONFIG_LOCALVERSION=\"$_localversion\"|g" -i .config
|
||||||
|
fi
|
||||||
|
|
||||||
sed -e 's|^CONFIG_GENERIC_CPU=y|# CONFIG_GENERIC_CPU is not set|g' -i .config
|
sed -e 's|^CONFIG_GENERIC_CPU=y|# CONFIG_GENERIC_CPU is not set|g' -i .config
|
||||||
|
sed -e 's|^CONFIG_GENERIC_CPU2=y|# CONFIG_GENERIC_CPU2 is not set|g' -i .config
|
||||||
|
sed -e 's|^CONFIG_GENERIC_CPU3=y|# CONFIG_GENERIC_CPU3 is not set|g' -i .config
|
||||||
|
sed -e 's|^CONFIG_GENERIC_CPU4=y|# CONFIG_GENERIC_CPU4 is not set|g' -i .config
|
||||||
sed -e "s|^# $Microarchitecture is not set|$Microarchitecture=y|g" -i .config
|
sed -e "s|^# $Microarchitecture is not set|$Microarchitecture=y|g" -i .config
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Reference in New Issue