Kbuild fixes for v6.10 (fourth)

- Make scripts/ld-version.sh robust against the latest LLD
 
  - Fix warnings in rpm-pkg with device tree support
 
  - Fix warnings in fortify tests with KASAN
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCgAzFiEEbmPs18K1szRHjPqEPYsBB53g2wYFAmaUM9kVHG1hc2FoaXJv
 eUBrZXJuZWwub3JnAAoJED2LAQed4NsGHEYQAKvrP1IzwlkANEEj/2qW1iGHlUod
 im3cFCKyxrlBar71n15fYtclhK0N4GTVAUMHAk0d1GZo8UjuCeUzurHM4o53Hu1P
 D0pXbkmiA0YgndpJYQpSV0CrLxCOCVAEFRf7AgdolVjpNLuba4z0bXSTQfEwfHKC
 W1igTL2vGG8citbfHhEGZfB7AIEQBB0LtNkarpsDVD39rG+blZAABBLEtCueSVtw
 rVX/Yuny9nDET6tlaCNgr2esNfkrHPIxOSsufeLWdhVVIZprPSGERflhkL3yE299
 v6R45ANn72iVNKnnmmjxTNeezIpr74w1NSzBJ0jRM1KRqzbsEuFAf0ZNamtoUJ4r
 m4tSu5l7lDj86APvehoO2o07A3omd8vcgLPt+lZlFsBIjorVIKovsjix6pVUgHlS
 BTvxbSojbSMUa/NrkbosJkLo/6TzZxYxHKr17nxk+HsXu0i9A9IiHPBK5dTcbtua
 olp1MKolQG78FYMwl7v4yQithawRG0mNDLJ2J8oTEIATXQtXV0WAaje73qQFIs6I
 cMBEfeaDAMH4z0/VvKZsdksXFPDrrjoW0/x1tPqcAgOSyacPGbki4asn52rwDHT5
 mfAzlnUc8ts56sBasArmMpk0z+PKC4MZeFUXNGJf7bZ3NZqoDRDHpb69Aqs11vSw
 AJa9Kj07o5YD8N+E
 =MMw8
 -----END PGP SIGNATURE-----

Merge tag 'kbuild-fixes-v6.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Make scripts/ld-version.sh robust against the latest LLD

 - Fix warnings in rpm-pkg with device tree support

 - Fix warnings in fortify tests with KASAN

* tag 'kbuild-fixes-v6.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  fortify: fix warnings in fortify tests with KASAN
  kbuild: rpm-pkg: avoid the warnings with dtb's listed twice
  kbuild: Make ld-version.sh more robust against version string changes
This commit is contained in:
Linus Torvalds 2024-07-14 15:29:35 -07:00
commit 882ddcd1bf
3 changed files with 9 additions and 4 deletions

View File

@ -426,3 +426,7 @@ $(obj)/$(TEST_FORTIFY_LOG): $(addprefix $(obj)/, $(TEST_FORTIFY_LOGS)) FORCE
ifeq ($(CONFIG_FORTIFY_SOURCE),y)
$(obj)/string.o: $(obj)/$(TEST_FORTIFY_LOG)
endif
# Some architectures define __NO_FORTIFY if __SANITIZE_ADDRESS__ is undefined.
# Pass CFLAGS_KASAN to avoid warnings.
$(foreach x, $(patsubst %.log,%.o,$(TEST_FORTIFY_LOGS)), $(eval KASAN_SANITIZE_$(x) := y))

View File

@ -57,9 +57,11 @@ else
fi
fi
# Some distributions append a package release number, as in 2.34-4.fc32
# Trim the hyphen and any characters that follow.
version=${version%-*}
# There may be something after the version, such as a distribution's package
# release number (like Fedora's "2.34-4.fc32") or punctuation (like LLD briefly
# added before the "compatible with GNU linkers" string), so remove everything
# after just numbers and periods.
version=${version%%[!0-9.]*}
cversion=$(get_canonical_version $version)
min_cversion=$(get_canonical_version $min_version)

View File

@ -83,7 +83,6 @@ ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEA
done
if [ -d "%{buildroot}/lib/modules/%{KERNELRELEASE}/dtb" ];then
echo "/lib/modules/%{KERNELRELEASE}/dtb"
find "%{buildroot}/lib/modules/%{KERNELRELEASE}/dtb" -printf "%%%ghost /boot/dtb-%{KERNELRELEASE}/%%P\n"
fi