Re: [PATCH 5.15 5.10 5.4 v2] kbuild: fix Build ID if CONFIG_MODVERSIONS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 10, 2023 at 03:58:11PM +0900, Masahiro Yamada wrote:
> On Tue, Jan 10, 2023 at 3:36 AM Tom Saeger <tom.saeger@xxxxxxxxxx> wrote:
> >
> > On Thu, Dec 22, 2022 at 07:01:11AM +0100, Greg Kroah-Hartman wrote:
> > > On Wed, Dec 21, 2022 at 02:52:10PM -0600, Tom Saeger wrote:
> > > > On Wed, Dec 21, 2022 at 05:31:51PM +0100, Greg Kroah-Hartman wrote:
> > > > > On Thu, Dec 15, 2022 at 04:18:18PM -0700, Tom Saeger wrote:
> > > > > > Backport of:
> > > > > > commit 0d362be5b142 ("Makefile: link with -z noexecstack --no-warn-rwx-segments")
> > > > > > breaks arm64 Build ID when CONFIG_MODVERSIONS=y for all kernels
> > > > > > from: commit e4484a495586 ("Merge tag 'kbuild-fixes-v5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild")
> > > > > > until: commit df202b452fe6 ("Merge tag 'kbuild-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild")
> > > > > >
> > > > > > Linus's tree doesn't have this issue since 0d362be5b142 was merged
> > > > > > after df202b452fe6 which included:
> > > > > > commit 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS")
> > > > >
> > > > > Why can't we add this one instead of a custom change?
> > > >
> > > > I quickly abandoned that route - there are too many dependencies.
> > >
> > > How many?  Why?  Whenever we add a "this is not upstream" patch, 90% of
> > > the time it is incorrect and causes problems (merge issues included.)
> > > So please please please let's try to keep in sync with what is in
> > > Linus's tree.
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > Ok - I spent some time on this.
> >
> > The haystack I searched:
> >
> >   git rev-list --grep="masahiroy/linux-kbuild" v5.15..v5.19-rc1 | while read -r CID ; do git rev-list "${CID}^-" ; done | wc -l
> >   182
> >
> > I have 54 of those 182 applied to 5.15.85, and this works in my
> > limited build testing (x86_64 gcc, arm64 gcc, arm64 clang).
> >
> > Specifically:
> >
> >

It probably makes more sense to post the cherry-picked hashes:

5ce2176b81f7 genksyms: adjust the output format to modpost
7375cbcf2343 kbuild: stop merging *.symversions
7b4537199a4a kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS
f292d875d0dc modpost: extract symbol versions from *.cmd files
69c4cc99bbcb modpost: add sym_find_with_module() helper
2a66c3124afd modpost: change the license of EXPORT_SYMBOL to bool type
ce79c406a24c modpost: remove left-over cross_compile declaration
78e9e56af385 kbuild: record symbol versions in *.cmd files
e493f4727520 kbuild: generate a list of objects in vmlinux
a44abaca0e19 modpost: move *.mod.c generation to write_mod_c_files()
7fedac9698b3 modpost: merge add_{intree_flag,retpoline,staging_flag} to add_header
f18379a30271 modpost: split new_symbol() to symbol allocation and hash table addition
e76cc48d8e6d modpost: make sym_add_exported() always allocate a new symbol
b8422711080f modpost: make multiple export error
f841536e8c5b modpost: dump Module.symvers in the same order of modules.order
ab489d6002fc modpost: traverse the namespace_list in order
4484054816ca modpost: use doubly linked list for dump_lists
8a69152be9a8 modpost: traverse unresolved symbols in order
e882e89bcf1d modpost: add sym_add_unresolved() helper
325eba05e8ab modpost: traverse modules in order
97aa4aef532a modpost: import include/linux/list.h
5066743e4c2f modpost: change mod->gpl_compatible to bool type
58e01fcae18c modpost: use bool type where appropriate
70ddb48db4aa modpost: move struct namespace_list to modpost.c
4cae77ac582b modpost: retrieve the module dependency and CRCs in check_exports()
23beb44a0eff modpost: add a separate error for exported symbols without definition
594ade3eef3f modpost: remove stale comment about sym_add_exported()
c155a47d83ab modpost: do not write out any file when error occurred
15a28c7c7291 modpost: use snprintf() instead of sprintf() for safety
feb7d79fea1d kbuild: read *.mod to get objects passed to $(LD) or $(AR)
fc93a4cdce1d kbuild: make *.mod not depend on *.o
22f26f21774f kbuild: get rid of duplication in *.mod files
9413e7640564 kbuild: split the second line of *.mod into *.usyms
b3591e061919 kbuild: reuse real-search to simplify cmd_mod
f97cf399915b kbuild: make multi_depend work with targets in subdirectory
9eef99f7a335 kbuild: reuse suffix-search to refactor multi_depend
7cfa2fcbac16 kbuild: refactor cmd_modversions_S
8017ce50641c kbuild: refactor cmd_modversions_c
79f646e8654b modpost: remove annoying namespace_from_kstrtabns()
b5f1a52a59eb modpost: remove redundant initializes for static variables
535b3e05f435 modpost: move export_from_secname() call to more relevant place
7ce3e410e018 modpost: remove useless export_from_sec()
dc6dc3e7a73f kbuild: do not remove empty *.symtypes explicitly
f43e31d5cb78 kbuild: factor out genksyms command from cmd_gensymtypes_{c,S}
d4c858643263 kallsyms: ignore all local labels prefixed by '.L'
64d8aaa4ef38 kbuild: drop $(size_append) from cmd_zstd
7d153696e5db kbuild: do not include include/config/auto.conf from shell scripts
4db9c2e3d055 kbuild: stop using config_filename in scripts/Makefile.modsign
8212f8986d31 kbuild: use more subdir- for visiting subdirectories while cleaning
90a353491e9f kbuild: reuse $(cmd_objtool) for cmd_cc_lto_link_modules
ef62588c2c86 kbuild: detect objtool update without using .SECONDEXPANSION
918a6b7f6846 kbuild: factor out OBJECT_FILES_NON_STANDARD check into a macro
92594d569b6d kbuild: store the objtool command in *.cmd files
5c4859e77aa1 kbuild: rename __objtool_obj and reuse it for cmd_cc_lto_link_modules


> >
> > There may be a few more patches post v5.19-rc1 for Fixes.
> > I haven't tried minimizing the 54.
> 
> 
> It is up to Greg.
> 
> 
> Indeed, 7b4537199a4a requires a lot of prerequisite commits.
> I do not remember which ones are exactly mandatory.
> 
> 
> > Greg - is 54 too many?
> >
> > Regards,
> >
> > --Tom
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux