Files
patches/linux/0002-linux-7.0.12-bsd-tooling-compat.patch
SFG545 4f914253b7 Add various patches for compatibility and improvements across multiple projects
- Introduced BSD tooling compatibility patch for Linux kernel, modifying header dependency handling and export checks in KVM.
- Updated MLIR project to ensure generated headers are correctly located and dependencies are managed for various tools.
- Enhanced ncurses configuration to support wide-character handling, ensuring proper header generation and compatibility.
- Modified GNU parallel to use POSIX compliant shell, ensuring broader compatibility across different environments.
- Fixed capability name handling in procps-ng by replacing echo with printf for better formatting.
- Adjusted util-linux build system to support byacc alongside bison, improving parser generation and flexibility.
2026-07-10 19:15:34 -05:00

170 lines
6.1 KiB
Diff

--- a/Makefile
+++ b/Makefile
@@ -1409,7 +1409,7 @@
PHONY += headerdep
headerdep:
- $(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \
+ $(Q)find $(srctree)/include/ -name '*.h' | xargs -n 1 \
$(srctree)/scripts/headerdep.pl -I$(srctree)/include
# ---------------------------------------------------------------------------
--- a/arch/x86/kvm/Makefile
+++ b/arch/x86/kvm/Makefile
@@ -54,28 +54,29 @@
# Only a handful of exports intended for other modules (VFIO, KVMGT) should
# use EXPORT_SYMBOL_GPL, and EXPORT_SYMBOL should never be used.
ifdef CONFIG_KVM_X86
-# Search recursively for whole words and print line numbers. Filter out the
-# allowed set of exports, i.e. those that are intended for external usage.
-exports_grep_trailer := --include='*.[ch]' -nrw $(srctree)/virt/kvm $(srctree)/arch/x86/kvm | \
- grep -v -e kvm_page_track_register_notifier \
- -e kvm_page_track_unregister_notifier \
- -e kvm_write_track_add_gfn \
- -e kvm_write_track_remove_gfn \
- -e kvm_get_kvm \
- -e kvm_get_kvm_safe \
- -e kvm_put_kvm
+# Search C source and headers recursively for whole words and print line
+# numbers. Filter out the allowed set of exports, i.e. those that are intended
+# for external usage.
+exports_grep = find $(srctree)/virt/kvm $(srctree)/arch/x86/kvm \
+ -name '*.[ch]' -type f -exec grep -Hnw "$(1)" {} + | \
+ grep -v -e kvm_page_track_register_notifier \
+ -e kvm_page_track_unregister_notifier \
+ -e kvm_write_track_add_gfn \
+ -e kvm_write_track_remove_gfn \
+ -e kvm_get_kvm \
+ -e kvm_get_kvm_safe \
+ -e kvm_put_kvm
-# Force grep to emit a goofy group separator that can in turn be replaced with
-# the above newline macro (newlines in Make are a nightmare). Note, grep only
-# prints the group separator when N lines of context are requested via -C,
-# a.k.a. --NUM. Simply request zero lines. Print the separator only after
-# filtering out expected exports to avoid extra newlines in the error message.
+# Force a goofy group separator that can in turn be replaced with the above
+# newline macro (newlines in Make are a nightmare). Print the separator only
+# after filtering out expected exports to avoid extra newlines in the error
+# message.
define get_kvm_exports
-$(shell grep "$(1)" -C0 $(exports_grep_trailer) | grep "$(1)" -C0 --group-separator="!SEP!")
+$(shell $(call exports_grep,$(1)) | awk 'NR > 1 { printf "!SEP!" } { printf "%s", $$0 }')
endef
define check_kvm_exports
-nr_kvm_exports := $(shell grep "$(1)" $(exports_grep_trailer) | wc -l)
+nr_kvm_exports := $(shell $(call exports_grep,$(1)) | wc -l)
ifneq (0,$$(nr_kvm_exports))
$$(error ERROR ***\
@@ -94,5 +95,5 @@
undefine check_kvm_exports
undefine get_kvm_exports
-undefine exports_grep_trailer
+undefine exports_grep
endif # CONFIG_KVM_X86
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -201,7 +201,7 @@
# Some files are symlinks. If symlinks are changed, kheaders_data.tar.xz should
# be rebuilt.
-filechk_kheaders_md5sum = xargs -r -a $< stat -c %N | md5sum
+filechk_kheaders_md5sum = while IFS= read -r f; do stat -c %N "$$f"; done < $< | md5sum
$(obj)/kheaders.md5: $(obj)/kheaders-srclist FORCE
$(call filechk,kheaders_md5sum)
--- a/kernel/gen_kheaders.sh
+++ b/kernel/gen_kheaders.sh
@@ -43,8 +43,8 @@
rm -f "${tmpdir}.contents.txt"
# Create archive and try to normalize metadata for reproducibility.
+(cd "${tmpdir}" && find . \( -type f -o -type l \) -print | LC_ALL=C sort) | \
${TAR} "${timestamp:+--mtime=$timestamp}" \
- --owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \
- -I "${XZ}" -cf "${tarfile}" -C "${tmpdir}/" . > /dev/null
+ -J -cf "${tarfile}" -C "${tmpdir}/" -T - > /dev/null
rm -rf "${tmpdir}"
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -165,13 +165,13 @@
$(Q)$(MAKE) -f $(srctree)/Makefile
+$(Q)$(srctree)/scripts/package/buildtar $@
-compress-tar.gz = -I "$(KGZIP)"
-compress-tar.bz2 = -I "$(KBZIP2)"
-compress-tar.xz = -I "$(XZ)"
-compress-tar.zst = -I "$(ZSTD)"
+compress-tar.gz = -z
+compress-tar.bz2 = -j
+compress-tar.xz = -J
+compress-tar.zst = --zstd
quiet_cmd_tar = TAR $@
- cmd_tar = cd $<; tar cf ../$@ $(compress-tar$(suffix $@)) --owner=root --group=root --sort=name *
+ cmd_tar = cd $<; find * -prune -print | LC_ALL=C sort | tar cf ../$@ $(compress-tar$(suffix $@)) -T -
dir-tarballs := $(addprefix linux-$(KERNELRELEASE)-$(ARCH), .tar .tar.gz .tar.bz2 .tar.xz .tar.zst)
--- a/scripts/package/kernel.spec
+++ b/scripts/package/kernel.spec
@@ -80,7 +80,7 @@
%{__arch_install_post} \
%{__os_install_post} \
find %{buildroot}/lib/modules/%{KERNELRELEASE} -name "*.ko" -type f \\\
- | xargs --no-run-if-empty chmod u-x
+ | while read -r mod; do chmod u-x "$${mod}"; done
%else
%define __spec_install_post /usr/lib/rpm/brp-compress || :
%endif
@@ -126,7 +126,8 @@
done
if [ -d "%{buildroot}/lib/modules/%{KERNELRELEASE}/dtb" ];then
- find "%{buildroot}/lib/modules/%{KERNELRELEASE}/dtb" -printf "%%%ghost /boot/dtb-%{KERNELRELEASE}/%%P\n"
+ (cd "%{buildroot}/lib/modules/%{KERNELRELEASE}/dtb" && find . ! -name . -print) | \
+ sed 's#^\./#%%ghost /boot/dtb-%{KERNELRELEASE}/#'
fi
echo "%exclude /lib/modules/%{KERNELRELEASE}/build"
@@ -143,7 +144,7 @@
# make modules executable so that find-debuginfo.sh strips them. this
# will be undone later in %%__spec_install_post
find %{buildroot}/lib/modules/%{KERNELRELEASE} -name "*.ko" -type f \
- | xargs --no-run-if-empty chmod u+x
+ | while read -r mod; do chmod u+x "$${mod}"; done
%endif
%if %{with_debuginfo_manual}
--- a/scripts/kconfig/parser.y
+++ b/scripts/kconfig/parser.y
@@ -21,6 +21,10 @@
#define PRINTD 0x0001
#define DEBUG_PARSE 0x0002
+#ifndef YYDEBUGSTR
+#define YYDEBUGSTR "yydebug"
+#endif
+
int cdebug = PRINTD;
static void yyerror(const char *err);
@@ -97,13 +101,6 @@
%type <string> assign_val
%type <flavor> assign_op
-%destructor {
- fprintf(stderr, "%s:%d: missing end statement for this entry\n",
- $$->filename, $$->lineno);
- if (current_menu == $$)
- menu_end_menu();
-} if_entry menu_entry choice_entry
-
%%
input: mainmenu_stmt stmt_list | stmt_list;