summaryrefslogtreecommitdiffstats
path: root/kernel.spec
diff options
context:
space:
mode:
authorLaura Abbott <labbott@redhat.com>2019-10-17 16:55:49 -0400
committerLaura Abbott <labbott@redhat.com>2019-10-22 08:43:37 -0400
commit483dcef3b1d79c531bb746461da1a105455d776c (patch)
treeb6c30fc84e9954b01372da2c7e802a92c7e2c111 /kernel.spec
parent9a4aee9f8d58e3d267c1c09f82036126b6b8fa08 (diff)
downloadkernel-483dcef3b1d79c531bb746461da1a105455d776c.tar.gz
kernel-483dcef3b1d79c531bb746461da1a105455d776c.tar.xz
kernel-483dcef3b1d79c531bb746461da1a105455d776c.zip
Consolodate cflags
The build flags for building are used inconsistently. Clean things up to make it easier to understand.
Diffstat (limited to 'kernel.spec')
-rw-r--r--kernel.spec19
1 files changed, 10 insertions, 9 deletions
diff --git a/kernel.spec b/kernel.spec
index 2d2fce6a4..2271ebebb 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -1033,8 +1033,6 @@ done
rm -f kernel-%{version}-*debug.config
%endif
-%define make make %{?cross_opts}
-
CheckConfigs() {
./check_configs.awk $1 $2 > .mismatches
if [ -s .mismatches ]
@@ -1124,6 +1122,8 @@ cp_vmlinux()
%define build_hostldflags %{?build_ldflags} -Wl,--build-id=uuid
%endif
+%define make make %{?cross_opts} %{?make_opts} %{?_smp_mflags} HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}"
+
BuildKernel() {
MakeTarget=$1
KernelImage=$2
@@ -1168,7 +1168,7 @@ BuildKernel() {
# and now to start the build process
- make %{?make_opts} mrproper
+ %{make} mrproper
cp configs/$Config .config
%if %{signkernel}%{signmodules}
@@ -1180,13 +1180,13 @@ BuildKernel() {
KCFLAGS="%{?kcflags}"
- make %{?make_opts} HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}" ARCH=$Arch olddefconfig
+ %{make} ARCH=$Arch olddefconfig >/dev/null
# This ensures build-ids are unique to allow parallel debuginfo
perl -p -i -e "s/^CONFIG_BUILD_SALT.*/CONFIG_BUILD_SALT=\"%{KVERREL}\"/" .config
- %{make} %{?make_opts} HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}" ARCH=$Arch %{?_smp_mflags} KCFLAGS="$KCFLAGS" WITH_GCOV="%{with_gcov}" $MakeTarget %{?sparse_mflags} %{?kernel_mflags}
+ %{make} ARCH=$Arch KCFLAGS="$KCFLAGS" WITH_GCOV="%{?with_gcov}" $MakeTarget %{?sparse_mflags} %{?kernel_mflags}
if [ $DoModules -eq 1 ]; then
- %{make} %{?make_opts} HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}" ARCH=$Arch %{?_smp_mflags} KCFLAGS="$KCFLAGS" WITH_GCOV="%{with_gcov}" modules %{?sparse_mflags} || exit 1
+ %{make} ARCH=$Arch KCFLAGS="$KCFLAGS" WITH_GCOV="%{?with_gcov}" modules %{?sparse_mflags} || exit 1
fi
mkdir -p $RPM_BUILD_ROOT/%{image_install_path}
@@ -1196,7 +1196,8 @@ BuildKernel() {
%endif
%ifarch %{arm} aarch64
- %{make} %{?make_opts} ARCH=$Arch dtbs dtbs_install INSTALL_DTBS_PATH=$RPM_BUILD_ROOT/%{image_install_path}/dtb-$KernelVer
+ %{make} ARCH=$Arch dtbs INSTALL_DTBS_PATH=$RPM_BUILD_ROOT/%{image_install_path}/dtb-$KernelVer
+ %{make} ARCH=$Arch dtbs_install INSTALL_DTBS_PATH=$RPM_BUILD_ROOT/%{image_install_path}/dtb-$KernelVer
cp -r $RPM_BUILD_ROOT/%{image_install_path}/dtb-$KernelVer $RPM_BUILD_ROOT/lib/modules/$KernelVer/dtb
find arch/$Arch/boot/dts -name '*.dtb' -type f -delete
%endif
@@ -1239,7 +1240,7 @@ BuildKernel() {
if [ $DoModules -eq 1 ]; then
# Override $(mod-fw) because we don't want it to install any firmware
# we'll get it from the linux-firmware package and we don't want conflicts
- %{make} %{?make_opts} ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw=
+ %{make} ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw=
fi
%if %{with_gcov}
@@ -1253,7 +1254,7 @@ BuildKernel() {
# add an a noop %%defattr statement 'cause rpm doesn't like empty file list files
echo '%%defattr(-,-,-)' > ../kernel${Flavour:+-${Flavour}}-ldsoconf.list
if [ $DoVDSO -ne 0 ]; then
- %{make} %{?make_opts} ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT vdso_install KERNELRELEASE=$KernelVer
+ %{make} ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT vdso_install KERNELRELEASE=$KernelVer
if [ -s ldconfig-kernel.conf ]; then
install -D -m 444 ldconfig-kernel.conf \
$RPM_BUILD_ROOT/etc/ld.so.conf.d/kernel-$KernelVer.conf