Re: [PATCH v2 0/3] Detect changed compiler dependencies for full rebuild

2025-05-13 Thread Masahiro Yamada
On Fri, May 9, 2025 at 8:59 AM Kees Cook wrote: > > On Fri, May 09, 2025 at 08:13:18AM +0900, Masahiro Yamada wrote: > > On Fri, May 9, 2025 at 1:56 AM Kees Cook wrote: > > > > > > On Fri, May 09, 2025 at 01:44:09AM +0900, Masahiro Yamada wrote: > > > >

Re: [PATCH] um: let 'make clean' properly clean underlying SUBARCH as well

2025-05-08 Thread Masahiro Yamada
On Fri, May 9, 2025 at 7:14 AM Shuah Khan wrote: > > On 5/7/25 17:49, Masahiro Yamada wrote: > > On Thu, May 8, 2025 at 6:38 AM Shuah Khan wrote: > >> > >> On 5/7/25 01:49, Masahiro Yamada wrote: > >>> Building the kernel with O= is affected by stale i

Re: [PATCH v2 0/3] Detect changed compiler dependencies for full rebuild

2025-05-08 Thread Masahiro Yamada
On Fri, May 9, 2025 at 1:56 AM Kees Cook wrote: > > On Fri, May 09, 2025 at 01:44:09AM +0900, Masahiro Yamada wrote: > > On Sun, May 4, 2025 at 2:37 AM Kees Cook wrote: > > > > > > On Sat, May 03, 2025 at 06:39:28PM +0900, Masahiro Yamada wrote: > > > >

Re: [PATCH v2 0/3] Detect changed compiler dependencies for full rebuild

2025-05-08 Thread Masahiro Yamada
On Sun, May 4, 2025 at 2:37 AM Kees Cook wrote: > > On Sat, May 03, 2025 at 06:39:28PM +0900, Masahiro Yamada wrote: > > On Sat, May 3, 2025 at 7:54 AM Kees Cook wrote: > > > > > > v2: > > > - switch from -include to -I with a -D gated incl

Re: [PATCH] um: let 'make clean' properly clean underlying SUBARCH as well

2025-05-08 Thread Masahiro Yamada
pt for > e.g. "make tags"). > I argue this. You can start out-of-tree builds after running 'make mrproper' for the architecture you want to build the kernel for. Hence, Kbuild suggests to do so when it determines the source tree is not clean enough. Unfortunately, "make mrproper ARCH=um" did not clean the tree deeply enough. Hence, this patch. -- Best Regards Masahiro Yamada

Re: [PATCH] um: let 'make clean' properly clean underlying SUBARCH as well

2025-05-07 Thread Masahiro Yamada
On Thu, May 8, 2025 at 6:38 AM Shuah Khan wrote: > > On 5/7/25 01:49, Masahiro Yamada wrote: > > Building the kernel with O= is affected by stale in-tree build artifacts. > > > > So, if the source tree is not clean, Kbuild displays the following: > > > >

[PATCH] um: let 'make clean' properly clean underlying SUBARCH as well

2025-05-07 Thread Masahiro Yamada
of creating new ones under the specified build directory. This commit makes 'make ARCH=um clean' recurse into the SUBARCH directory. Reported-by: Shuah Khan Closes: https://lore.kernel.org/lkml/20250502172459.14175-1-sk...@linuxfoundation.org/ Signed-off-by: Masahiro Yamada --- a

Re: [PATCH v2 0/3] Detect changed compiler dependencies for full rebuild

2025-05-03 Thread Masahiro Yamada
ernel source tree will be rebuilt. This may rebuild more than needed (e.g. vdso) but I do not think it is a big deal. -- Best Regards Masahiro Yamada

[PATCH] kbuild: introduce include/generated/global-rebuild.h

2025-05-03 Thread Masahiro Yamada
.com/T/#me069145443a17f0b464c13814424dbba0d970863 [1] Cc: Kees Cook Signed-off-by: Masahiro Yamada --- Makefile | 9 - arch/um/Makefile | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5aa9ee52a765..64811eebd549 100644 --- a/Makefile +++ b/Makefile @@ -558,7

Re: [PATCH v2 2/3] randstruct: Force full rebuild when seed changes

2025-05-02 Thread Masahiro Yamada
clude/linux/compiler-version.h. Universally add a -I for the > scripts/basic directory, where header exists. The UM build requires that > the -I be explicitly added. > > Signed-off-by: Kees Cook > --- > Cc: Masahiro Yamada > Cc: Nathan Chancellor > Cc: Nicolas

Re: [PATCH v2 1/3] gcc-plugins: Force full rebuild when plugins change

2025-05-02 Thread Masahiro Yamada
I to include the gcc-plugins directory, and depend on the > new -DGCC_PLUGINS_ENABLED flag to include the generated header file via > include/linux/compiler-version.h, which is already being used to control > full rebuilds. The UM build requires that the -I be explicitly added. > > Signed-off-by:

Re: [PATCH v1] kbuild: Allow building of samples with UML

2025-02-11 Thread Masahiro Yamada
s (and tests using them) with UML too: > > printf > 'CONFIG_SAMPLES=y\nCONFIG_HEADERS_INSTALL=y\nCONFIG_SAMPLE_LANDLOCK=y\n' > >.config > make ARCH=um olddefconfig headers_install > make ARCH=um samples/landlock/ > > Cc: Anton Ivanov > Cc: Johannes Berg

[PATCH] um: remove dependency on undefined CC_CAN_LINK_STATIC_NO_RUNTIME_DEPS

2024-09-24 Thread Masahiro Yamada
g for non-glibc implementations") - 5e1121cd43d4 ("um: Some fixes to build UML with musl") Given that nobody has noticed the missing first patch for many years, it seems it was unnecessary. [1]: https://lore.kernel.org/lkml/20200719210222.2811-1-ig...@cloudflare.com/ Signed-off-by:

Re: [PATCH] kbuild: use objcopy to generate asm-offsets

2024-09-03 Thread Masahiro Yamada
h it, given all the > failures and little workarounds :-| If I can sort out the last few > failures I'll submit it as an RFC. This patch has zero benefit. The current way (preprocess + sed) is faster than your way (preprocess + compile + objcopy) and works independently of tool quirks. -- Best Regards Masahiro Yamada

Re: [PATCH 2/2] modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS

2024-01-27 Thread Masahiro Yamada
SECTIONS ".text", ".text.*", ".sched.text", \ > - ".kprobes.text", ".cpuidle.text", ".noinstr.text" > + ".kprobes.text", ".cpuidle.text", ".noinstr.text", \ > + ".ltext", ".ltext.*" > #define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \ > ".fixup", ".entry.text", ".exception.text", \ > ".coldtext", ".softirqentry.text" > > -- > 2.43.0 > -- Best Regards Masahiro Yamada

Re: [PATCH 1/2] um: Fix adding '-no-pie' for clang

2024-01-27 Thread Masahiro Yamada
NK-$(CONFIG_LD_SCRIPT_DYN) += $(call cc-option, -no-pie) > +ifdef CONFIG_LD_SCRIPT_DYN > +LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) += -no-pie > +endif > LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib > > CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, > -fno-pic,) \ > > -- > 2.43.0 > -- Best Regards Masahiro Yamada

Re: [PATCH 0/2] Fix UML build with clang-18 and newer

2024-01-27 Thread Masahiro Yamada
t; 2 files changed, 5 insertions(+), 2 deletions(-) > --- > base-commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a > change-id: 20240118-fix-uml-clang-18-e365b0503a29 > > Best regards, > -- > Nathan Chancellor > -- Best Regards Masahiro Yamada

[PATCH v2 1/2] kbuild: unify vdso_install rules

2023-10-14 Thread Masahiro Yamada
rom arch/arm64/Makefile. vdso-install-$(CONFIG_COMPAT_VDSO) += arch/arm64/kernel/vdso32/vdso.so.dbg:vdso32.so This will rename vdso.so.dbg to vdso32.so during installation. If such architectures change their implementation so that the base names match, this workaround will go away. Signed-off-by:

[PATCH v2 2/2] kbuild: unify no-compiler-targets and no-sync-config-targets

2023-10-14 Thread Masahiro Yamada
Now that vdso_install does not depend on any in-tree build artifact, it no longer needs a compiler, making no-compiler-targets the same as no-sync-config-targets. Signed-off-by: Masahiro Yamada --- Changes in v2: - Revive need-compiler flag Makefile | 13 ++--- 1 file changed, 2

Re: [PATCH 1/5] csky: remove unused cmd_vdso_install

2023-10-14 Thread Masahiro Yamada
On Tue, Oct 10, 2023 at 12:16 AM Guo Ren wrote: > > On Mon, Oct 9, 2023 at 8:42 PM Masahiro Yamada wrote: > > > > You cannot run this code because arch/csky/Makefile does not define the > > vdso_install target. > > > > It appears that this code was blindly cop

Re: [PATCH 5/5] kbuild: unify no-compiler-targets and no-sync-config-targets

2023-10-14 Thread Masahiro Yamada
On Tue, Oct 10, 2023 at 1:44 AM Nathan Chancellor wrote: > > On Mon, Oct 09, 2023 at 09:42:10PM +0900, Masahiro Yamada wrote: > > Now that vdso_install does not depend on any in-tree build artifact, > > it no longer invokes a compiler, making no-compiler-targets the same >

Re: [PATCH 4/5] kbuild: unify vdso_install rules

2023-10-11 Thread Masahiro Yamada
On Wed, Oct 11, 2023 at 11:24 AM Guo Ren wrote: > > On Mon, Oct 9, 2023 at 8:42 PM Masahiro Yamada wrote: > > --- a/arch/riscv/Makefile > > +++ b/arch/riscv/Makefile > > @@ -131,12 +131,6 @@ endif > > libs-y += arch/riscv/lib/ > > libs-$(CONFIG_EFI_STUB

[PATCH 5/5] kbuild: unify no-compiler-targets and no-sync-config-targets

2023-10-09 Thread Masahiro Yamada
Now that vdso_install does not depend on any in-tree build artifact, it no longer invokes a compiler, making no-compiler-targets the same as no-sync-config-targets. Signed-off-by: Masahiro Yamada --- Makefile | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a

[PATCH 4/5] kbuild: unify vdso_install rules

2023-10-09 Thread Masahiro Yamada
, this workaround will go away. Signed-off-by: Masahiro Yamada --- Makefile | 9 ++ arch/arm/Makefile | 7 +--- arch/arm/vdso/Makefile | 25 -- arch/arm64/Makefile| 9 ++ arch/arm64/ke

[PATCH 3/5] parisc: remove broken vdso_install

2023-10-09 Thread Masahiro Yamada
arisc does not define CONFIG_COMPAT_VDSO. It appears that this code was copied from another architecture without proper adaptation. Remove the broken code. Signed-off-by: Masahiro Yamada --- arch/parisc/Makefile | 7 --- 1 file changed, 7 deletions(-) diff --git a/arch/parisc/Makefile b/a

[PATCH 2/5] UML: remove unused cmd_vdso_install

2023-10-09 Thread Masahiro Yamada
You cannot run this code because arch/um/Makefile does not define the vdso_install target. It appears that this code was blindly copied from another architecture. Remove the dead code. Signed-off-by: Masahiro Yamada --- arch/x86/um/vdso/Makefile | 12 1 file changed, 12

[PATCH 1/5] csky: remove unused cmd_vdso_install

2023-10-09 Thread Masahiro Yamada
You cannot run this code because arch/csky/Makefile does not define the vdso_install target. It appears that this code was blindly copied from another architecture. Remove the dead code. Signed-off-by: Masahiro Yamada --- arch/csky/kernel/vdso/Makefile | 10 -- 1 file changed, 10

Re: [PATCH v2 1/2] UML: hard-code the result of 'uname -s'

2023-08-19 Thread Masahiro Yamada
Just because 'uname -s' is meaningless. Just build 'Linux' ones irrespective of the host platform. If it works, it works. If not, it does not work. -- Best Regards Masahiro Yamada ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um

Re: [PATCH v5] um/drivers: fix hostaudio build errors

2023-08-06 Thread Masahiro Yamada
) > Fixes: d886e87cb82b ("sound: make OSS sound core optional") > Signed-off-by: Randy Dunlap > Reported-by: kernel test robot > Closes: lore.kernel.org/r/202307141416.vxurvpfv-...@intel.com > Cc: Richard Weinberger > Cc: Anton Ivanov > Cc: Johannes Berg

Re: [PATCH v4] um/drivers: fix hostaudio build errors

2023-08-01 Thread Masahiro Yamada
el test robot > Closes: lore.kernel.org/r/202307141416.vxurvpfv-...@intel.com > Cc: Richard Weinberger > Cc: Anton Ivanov > Cc: Johannes Berg > Cc: linux-um@lists.infradead.org > Cc: Tejun Heo > Cc: Takashi Iwai > Cc: Jaroslav Kysela > Cc: Masahiro Yamada > Cc:

Re: [PATCH v3] um/drivers: fix hostaudio build errors

2023-07-28 Thread Masahiro Yamada
> Reported-by: kernel test robot > Link: lore.kernel.org/r/202307141416.vxurvpfv-...@intel.com > Cc: Richard Weinberger > Cc: Anton Ivanov > Cc: Johannes Berg > Cc: linux-um@lists.infradead.org > Cc: Tejun Heo > Cc: Takashi Iwai > Cc: Jaroslav Kysela > Cc: Ma

Re: [PATCH] um/drivers: Kconfig: fix hostaudio build errors

2023-07-22 Thread Masahiro Yamada
rger > Cc: Anton Ivanov > Cc: Johannes Berg > Cc: linux-um@lists.infradead.org > Cc: Tejun Heo > Cc: Takashi Iwai > Cc: Jaroslav Kysela > Cc: Masahiro Yamada > Cc: Nathan Chancellor > Cc: Nick Desaulniers > Cc: Nicolas Schier > Cc: linux-kbu...@vger.kernel.or

[PATCH v2 1/2] UML: hard-code the result of 'uname -s'

2023-07-21 Thread Masahiro Yamada
We rely on 'uname -s' returning 'Linux' because there are os-Linux/ directories, but no other os-*/. Supporting a non-Linux host is unlikely to happen. Let's hard-code 'Linux'. Signed-off-by: Masahiro Yamada --- (no changes since v1) arch/um/Makefile

[PATCH v2 2/2] UML: use obj-y to descend into arch/um/*/

2023-07-21 Thread Masahiro Yamada
The single build rule does not work with the core-y syntax. [1] Use the standard obj-y syntax. [1]: https://lore.kernel.org/linux-kbuild/d57ba55f-20a3-b836-783d-b49c8a161...@kernel.org/T/#m7bc402e1e038f00ebcf2e92ed7fcb8a52fc1ea44 Signed-off-by: Masahiro Yamada --- Changes in v2: - Rephase

[PATCH 2/2] UML: use obj-y to descend into arch/um/*/

2023-07-21 Thread Masahiro Yamada
I like to use obj-y in as many places as possible. Change the core-y to obj-y. It fixes the single build issue. [1] [1]: https://lore.kernel.org/linux-kbuild/d57ba55f-20a3-b836-783d-b49c8a161...@kernel.org/T/#m7bc402e1e038f00ebcf2e92ed7fcb8a52fc1ea44 Signed-off-by: Masahiro Yamada --- arch

[PATCH 1/2] UML: hard-code the result of 'uname -s'

2023-07-21 Thread Masahiro Yamada
We rely on 'uname -s' returning 'Linux' as there are arch/um/os-Linux/ and arch/x86/um/os-Linux/, but no other os-*/ directories. Supporting a non-Linux host is unlikely to happen. Let's hard-code 'Linux'. Signed-off-by: Masahiro Yamada --- arch/um/Ma

Re: [PATCH v7 03/11] kbuild: generate KSYMTAB entries by modpost

2023-06-21 Thread Masahiro Yamada
On Thu, Jun 22, 2023 at 1:15 AM Guenter Roeck wrote: > > On Thu, Jun 08, 2023 at 11:24:20PM +0900, Masahiro Yamada wrote: > > Commit 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing > > CONFIG_MODULE_REL_CRCS") made modpost output CRCs in the same way &

Re: [PATCH v8 00/11] Unify and , remove EXPORT_DATA_SYMBOL(), faster TRIM_UNUSED_KSYMS

2023-06-11 Thread Masahiro Yamada
On Sat, Jun 10, 2023 at 6:13 PM Masahiro Yamada wrote: > > > This patch set refactors modpost first to make it easier to > add new code. Only the first patch was applied. (https://patchwork.kernel.org/project/linux-kbuild/patch/20230610091320.1054554-2-masahi...@kernel.org/) I

[PATCH v8 08/11] kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion

2023-06-10 Thread Masahiro Yamada
mization where the chain reaction of trimming comes into play because: - CONFIG_LTO_CLANG cannot remove any unused symbols - CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is enabled only for vmlinux, but not modules If deeper trimming is required, we need to revisit this, but I guess that is unlikely

[PATCH v8 11/11] linux/export.h: rename 'sec' argument to 'license'

2023-06-10 Thread Masahiro Yamada
Now, EXPORT_SYMBOL() is populated in two stages. In the first stage, all of EXPORT_SYMBOL/EXPORT_SYMBOL_GPL go into the same section, '.export_symbol'. 'sec' does not make sense any more. Rename it to 'license'. Signed-off-by: Masahiro Yamada Reviewed-by: Nick

[PATCH v8 10/11] modpost: show offset from symbol for section mismatch warnings

2023-06-10 Thread Masahiro Yamada
Currently, modpost only shows the symbol names and section names, so it repeats the same message if there are multiple relocations in the same symbol. It is common the relocation spans across multiple instructions. It is better to show the offset from the symbol. Signed-off-by: Masahiro Yamada

[PATCH v8 09/11] modpost: merge two similar section mismatch warnings

2023-06-10 Thread Masahiro Yamada
are similar. Merge them. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- scripts/mod/modpost.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index decb7d23ef9f..85df3f3ba9ee 100644 --- a/scri

[PATCH v8 07/11] modpost: use null string instead of NULL pointer for default namespace

2023-06-10 Thread Masahiro Yamada
is saves 1 byte memory allocated for "", but loses the readability. In kernel-space, we strive to save memory, but modpost is a userspace tool used to build the kernel. On modern systems, such small piece of memory is not a big deal. Handle the namespace string as is. Signed-off-by:

[PATCH v8 06/11] modpost: squash sym_update_namespace() into sym_add_exported()

2023-06-10 Thread Masahiro Yamada
Pass a set of the name, license, and namespace to sym_add_exported(). sym_update_namespace() is unneeded. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- scripts/mod/modpost.c | 27 --- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a

[PATCH v8 05/11] modpost: check static EXPORT_SYMBOL* by modpost again

2023-06-10 Thread Masahiro Yamada
d foo(void) {} EXPORT_SYMBOL(foo); foo2.c: void foo(void) {} Then, modpost can catch it correctly. MODPOST Module.symvers ERROR: modpost: vmlinux: local symbol 'foo' was exported Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- (no changes since v6) Changes

[PATCH v8 04/11] ia64,export.h: replace EXPORT_DATA_SYMBOL* with EXPORT_SYMBOL*

2023-06-10 Thread Masahiro Yamada
With the previous refactoring, you can always use EXPORT_SYMBOL*. Replace two instances in ia64, then remove EXPORT_DATA_SYMBOL*. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- arch/ia64/kernel/head.S | 2 +- arch/ia64/kernel/ivt.S | 2 +- include/asm-generic

[PATCH v8 03/11] kbuild: generate KSYMTAB entries by modpost

2023-06-10 Thread Masahiro Yamada
UNUSED_KSYMS is enabled, Kbuild recursively traverses the directory tree to determine which EXPORT_SYMBOL to trim. If an EXPORT_SYMBOL turns out to be unused by anyone, Kbuild begins the second traverse, where some source files are recompiled with their EXPORT_SYMBOL() tuned into a no-op. We can do th

[PATCH v8 02/11] modpost: pass struct module pointer to check_section_mismatch()

2023-06-10 Thread Masahiro Yamada
The next commit will use it. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- scripts/mod/modpost.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 8decf04633bc..403ba4d923f5

[PATCH v8 00/11] Unify and , remove EXPORT_DATA_SYMBOL(), faster TRIM_UNUSED_KSYMS

2023-06-10 Thread Masahiro Yamada
kernel_symbol to kernel/module/internal.h Changes in v2: - Use KSYMTAB_FUNC and KSYMTAB_DATA for functions and data, respectively This distinction is needed for ia64. Masahiro Yamada (11): Revert "[PATCH] uml: export symbols added by GCC hardened" modpost: pass struct module

[PATCH v8 01/11] Revert "[PATCH] uml: export symbols added by GCC hardened"

2023-06-10 Thread Masahiro Yamada
t sensible because UML cannot enable the stack-protector in the first place! (Please note UML does not select HAVE_STACKPROTECTOR in Kconfig.) So, the code is already broken (and unused) in multiple ways. Just remove. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- (no change

Re: [PATCH v7 03/11] kbuild: generate KSYMTAB entries by modpost

2023-06-10 Thread Masahiro Yamada
On Thu, Jun 8, 2023 at 11:24 PM Masahiro Yamada wrote: > > Commit 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing > CONFIG_MODULE_REL_CRCS") made modpost output CRCs in the same way > whether the EXPORT_SYMBOL() is placed in *.c or *.S. > > For f

[PATCH v7 08/11] kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion

2023-06-08 Thread Masahiro Yamada
mization where the chain reaction of trimming comes into play because: - CONFIG_LTO_CLANG cannot remove any unused symbols - CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is enabled only for vmlinux, but not modules If deeper trimming is required, we need to revisit this, but I guess that is unlikely

[PATCH v7 09/11] modpost: merge two similar section mismatch warnings

2023-06-08 Thread Masahiro Yamada
are similar. Merge them. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- scripts/mod/modpost.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index decb7d23ef9f..85df3f3ba9ee 100644 --- a/scri

[PATCH v7 07/11] modpost: use null string instead of NULL pointer for default namespace

2023-06-08 Thread Masahiro Yamada
is saves 1 byte memory allocated for "", but loses the readability. In kernel-space, we strive to save memory, but modpost is a userspace tool used to build the kernel. On modern systems, such small piece of memory is not a big deal. Handle the namespace string as is. Signed-off-by:

[PATCH v7 11/11] linux/export.h: rename 'sec' argument to 'license'

2023-06-08 Thread Masahiro Yamada
Now, EXPORT_SYMBOL() is populated in two stages. In the first stage, all of EXPORT_SYMBOL/EXPORT_SYMBOL_GPL go into the same section, .export_symbol. 'sec' does not make sense any more. Rename it to 'license'. Signed-off-by: Masahiro Yamada --- Changes in v7: - New p

[PATCH v7 10/11] modpost: show offset from symbol for section mismatch warnings

2023-06-08 Thread Masahiro Yamada
Currently, modpost only shows the symbol names and section names, so it repeats the same message if there are multiple relocations in the same symbol. It is common the relocation spans across multiple instructions. It is better to show the offset from the symbol. Signed-off-by: Masahiro Yamada

[PATCH v7 06/11] modpost: squash sym_update_namespace() into sym_add_exported()

2023-06-08 Thread Masahiro Yamada
Pass a set of the name, license, and namespace to sym_add_exported(). sym_update_namespace() is unneeded. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- scripts/mod/modpost.c | 27 --- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a

[PATCH v7 05/11] modpost: check static EXPORT_SYMBOL* by modpost again

2023-06-08 Thread Masahiro Yamada
d foo(void) {} EXPORT_SYMBOL(foo); foo2.c: void foo(void) {} Then, modpost can catch it correctly. MODPOST Module.symvers ERROR: modpost: vmlinux: local symbol 'foo' was exported Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- (no changes since v6) Changes

[PATCH v7 03/11] kbuild: generate KSYMTAB entries by modpost

2023-06-08 Thread Masahiro Yamada
IG_TRIM_UNUSED_KSYMS is enabled, Kbuild recursively traverses the directory tree to determine which EXPORT_SYMBOL to trim. If an EXPORT_SYMBOL turns out to be unused by anyone, Kbuild begins the second traverse, where some source files are recompiled with their EXPORT_SYMBOL() tuned into a no-op

[PATCH v7 04/11] ia64,export.h: replace EXPORT_DATA_SYMBOL* with EXPORT_SYMBOL*

2023-06-08 Thread Masahiro Yamada
With the previous refactoring, you can always use EXPORT_SYMBOL*. Replace two instances in ia64, then remove EXPORT_DATA_SYMBOL*. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- arch/ia64/kernel/head.S | 2 +- arch/ia64/kernel/ivt.S | 2 +- include/asm-generic

[PATCH v7 00/11] Unify and , remove EXPORT_DATA_SYMBOL(), faster TRIM_UNUSED_KSYMS

2023-06-08 Thread Masahiro Yamada
/T/#t v3: https://lore.kernel.org/all/20220928063947.299333-1-masahi...@kernel.org/ Masahiro Yamada (11): Revert "[PATCH] uml: export symbols added by GCC hardened" modpost: pass struct module pointer to check_section_mismatch() kbuild: generate KSYMTAB entries by modpost ia6

[PATCH v7 02/11] modpost: pass struct module pointer to check_section_mismatch()

2023-06-08 Thread Masahiro Yamada
The next commit will use it. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- scripts/mod/modpost.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 8decf04633bc..403ba4d923f5

[PATCH v7 01/11] Revert "[PATCH] uml: export symbols added by GCC hardened"

2023-06-08 Thread Masahiro Yamada
ecause UML cannot enable the stack-protector in the first place! (Please note UML does not select HAVE_STACKPROTECTOR in Kconfig.) So, the code is already broken (and unused) in multiple ways. Just remove. Signed-off-by: Masahiro Yamada --- Changes in v7: - New patch arch/um/os-Linux/user_

[PATCH] UML: define RUNTIME_DISCARD_EXIT

2023-02-07 Thread Masahiro Yamada
IME_DISCARD_EXIT") Fixes: 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv") Reported-by: SeongJae Park Signed-off-by: Masahiro Yamada --- arch/um/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/kernel/vmlinux.lds.S b/

Re: [PATCH v8 27/31] Kbuild: add Rust support

2022-09-06 Thread Masahiro Yamada
XT > + string > + depends on RUST > + default $(shell,command -v $(RUSTC) >/dev/null 2>&1 && $(RUSTC) > --version || echo n) > + > +config BINDGEN_VERSION_TEXT > + string > + depends on RUST > + default $(shell,comman

Re: [PATCH] Kconfig: eradicate CC_HAS_ASM_GOTO

2022-08-19 Thread Masahiro Yamada
omment block below it, it mentions that > these kernel headers are being sucked into UAPI headers that are used > outside of the kernel builds, such as when building eBPF programs. So > we don't know what userspace tools might be consuming these headers. > The original in

Re: [PATCH v7 21/25] Kbuild: add Rust support

2022-07-16 Thread Masahiro Yamada
> +# Rust targets > +# --- > + > +# "Is Rust available?" target > +PHONY += rustavailable > +rustavailable: > + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/rust-is-avail

Re: [PATCH v3 00/15] kbuild: yet another series of cleanups (modpost, LTO, MODULE_REL_CRCS)

2022-05-08 Thread Masahiro Yamada
On Thu, May 5, 2022 at 4:24 PM Masahiro Yamada wrote: > > > This is the third batch of cleanups in this development cycle. > > Major changes in v3: > > - Generate symbol CRCs as C code, and remove CONFIG_MODULE_REL_CRCS. > > Major changes in v2: > > - V1 did not

Re: [PATCH v3 00/15] kbuild: yet another series of cleanups (modpost, LTO, MODULE_REL_CRCS)

2022-05-05 Thread Masahiro Yamada
On Thu, May 5, 2022 at 4:24 PM Masahiro Yamada wrote: > > > This is the third batch of cleanups in this development cycle. This series is available at: git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git lto-cleanup-v3 -- Best Regards Masahi

Re: [PATCH v3 02/15] modpost: change the license of EXPORT_SYMBOL to bool type

2022-05-05 Thread Masahiro Yamada
On Thu, May 5, 2022 at 4:24 PM Masahiro Yamada wrote: > > Currently, enum export is tristate, but export_unknown does not make > sense in any way. > > If the symbol name starts with "__ksymtab_", but the section name > does not start with "___ksymtab+"

[PATCH v3 08/15] kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS

2022-05-05 Thread Masahiro Yamada
longer use the linker magic. The new C implementation works in the same way, whether CONFIG_RELOCATABLE is enabled or not. CONFIG_MODULE_REL_CRCS is no longer needed. Previously, Kbuild invoked additional $(LD) to update the CRCs in objects, but this step is unneeded too. Signed-off-by: Masahiro

[PATCH v3 15/15] kbuild: make *.mod rule robust against too long argument error

2022-05-05 Thread Masahiro Yamada
hnson reported before [1]. [1] https://lore.kernel.org/linux-kbuild/4c02050c4e95e4cb8cc04282695f8...@codeaurora.org/ Signed-off-by: Masahiro Yamada --- (no changes since v2) Changes in v2: - New patch scripts/Makefile.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --

[PATCH v3 09/15] kbuild: stop merging *.symversions

2022-05-05 Thread Masahiro Yamada
Now modpost reads symbol versions from .*.cmd files. These merged *.symversions are not used any more. Signed-off-by: Masahiro Yamada --- (no changes since v1) scripts/Makefile.build | 21 ++--- scripts/link-vmlinux.sh | 15 --- 2 files changed, 2 insertions

[PATCH v3 13/15] modpost: use hlist for hash table implementation

2022-05-05 Thread Masahiro Yamada
. Signed-off-by: Masahiro Yamada --- (no changes since v2) Changes in v2: - Move to the end of the series because this is now optional scripts/mod/file2alias.c | 2 -- scripts/mod/list.h | 52 scripts/mod/modpost.c| 39

[PATCH v3 07/15] modpost: extract symbol versions from *.cmd files

2022-05-05 Thread Masahiro Yamada
es instead of from ELF objects. Signed-off-by: Masahiro Yamada --- (no changes since v2) Changes in v2: - Simplify the implementation (parse .cmd files after ELF) scripts/mod/modpost.c | 177 ++ 1 file changed, 129 insertions(+), 48 deletions(-) diff

[PATCH v3 14/15] kbuild: make built-in.a rule robust against too long argument error

2022-05-05 Thread Masahiro Yamada
mpare drivers/gpu/drm/i915/.built-in.a.cmd with/without this commit. Signed-off-by: Masahiro Yamada --- (no changes since v2) Changes in v2: - New patch scripts/Makefile.build | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.

[PATCH v3 11/15] kbuild: do not create *.prelink.o for Clang LTO or IBT

2022-05-05 Thread Masahiro Yamada
(ELF)| foo2.c ---> foo2.o ---/ | (LLVM bitcode) foo.mod.o --/ Signed-off-by: Masahiro Yamada --- (no changes since v2) Changes in v2: - replace the chain of $(if ...) with $(and ) scripts/Kbuild.include| 4 +++ scripts/Makefile.build| 58 -

[PATCH v3 12/15] modpost: simplify the ->is_static initialization

2022-05-05 Thread Masahiro Yamada
->is_static is set to true at allocation, then to false if the symbol comes from the dump file. It is simpler to use !mod->from_dump as the init value. Signed-off-by: Masahiro Yamada --- (no changes since v2) Changes in v2: - New patch scripts/mod/modpost.c | 4 ++-- 1 file chan

[PATCH v3 02/15] modpost: change the license of EXPORT_SYMBOL to bool type

2022-05-05 Thread Masahiro Yamada
ols is boolean (EXPORT_SYMBOL or EXPORT_SYMBOL_GPL). I renamed the field name to is_gpl_only. If it is true, only GPL-compat modules can use it. Signed-off-by: Masahiro Yamada --- Changes in v3: - New patch scripts/mod/modpost.c | 108 +- 1 file change

[PATCH v3 10/15] genksyms: adjust the output format to modpost

2022-05-05 Thread Masahiro Yamada
t status'. Signed-off-by: Masahiro Yamada --- (no changes since v2) Changes in v2: - New patch scripts/Makefile.build | 6 -- scripts/genksyms/genksyms.c | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index dff

[PATCH v3 06/15] kbuild: record symbol versions in *.cmd files

2022-05-05 Thread Masahiro Yamada
-by: Masahiro Yamada Tested-by: Nicolas Schier Reviewed-by: Nicolas Schier --- (no changes since v2) Changes in v2: - Fix CONFIG_MODULE_REL_CRCS=y case scripts/Makefile.build | 7 +++ 1 file changed, 7 insertions(+) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index

[PATCH v3 04/15] modpost: move *.mod.c generation to write_mod_c_files()

2022-05-05 Thread Masahiro Yamada
A later commit will add more code to this list_for_each_entry loop. Before that, move the loop body into a separate helper function. Signed-off-by: Masahiro Yamada --- Changes in v3: - New patch scripts/mod/modpost.c | 56 --- 1 file changed, 31

[PATCH v3 01/15] modpost: mitigate false-negatives for static EXPORT_SYMBOL checks

2022-05-05 Thread Masahiro Yamada
assed, it is equivalent to find_module(). Please note there are still false positives in the composite module, like below (or when both are built-in). I have no idea how to do this correctly. [Sample 2] (not fixed by this commit) Makefile: obj-m += mymod.o mymod-objs := mymod1.o mymod2.

[PATCH v3 00/15] kbuild: yet another series of cleanups (modpost, LTO, MODULE_REL_CRCS)

2022-05-05 Thread Masahiro Yamada
- Refactor the code more - Avoid too long argument error Masahiro Yamada (15): modpost: mitigate false-negatives for static EXPORT_SYMBOL checks modpost: change the license of EXPORT_SYMBOL to bool type modpost: merge add_{intree_flag,retpoline,staging_flag} to add_header modpost: move

[PATCH v3 03/15] modpost: merge add_{intree_flag, retpoline, staging_flag} to add_header

2022-05-05 Thread Masahiro Yamada
add_intree_flag(), add_retpoline(), and add_staging_flag() are small enough to be merged into add_header(). Signed-off-by: Masahiro Yamada --- Changes in v3: - New patch scripts/mod/modpost.c | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a

[PATCH v3 05/15] kbuild: generate a list of objects in vmlinux

2022-05-05 Thread Masahiro Yamada
A *.mod file lists the member objects of a module, but vmlinux does not have such a file to list out all the member objects. Generate this list to allow modpost to know all the member objects. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- (no changes since v2) Changes in v2

Re: [PATCH] um: Fix filtering '-mno-global-merge'

2022-04-01 Thread Masahiro Yamada
On Sun, Mar 27, 2022 at 5:00 AM Nathan Chancellor wrote: > > On Sat, Mar 26, 2022 at 12:29:55PM +0900, Masahiro Yamada wrote: > > On Wed, Mar 23, 2022 at 2:39 AM Nathan Chancellor wrote: > > > > > > When booting a clang compiled UML kernel, the kernel panics

Re: [PATCH 0/2] Remove '-mno-global-merge' from KBUILD_CFLAGS

2022-04-01 Thread Masahiro Yamada
m/llvm-project/commit/863bfdbfb446adaef767ff514d1f2ffb5d489562 > > Nathan Chancellor (2): > kbuild: Remove '-mno-global-merge' > Revert "um: clang: Strip out -mno-global-merge from USER_CFLAGS" > > Makefile | 4 > arch/um/Makefile | 4 ---- >

Re: [PATCH] um: Fix filtering '-mno-global-merge'

2022-03-25 Thread Masahiro Yamada
$(patsubst -mno-global-merge,,$(USER_CFLAGS)) > -endif > - > #This will adjust *FLAGS accordingly to the platform. > include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) > > > base-commit: 82017457957a550d7d00dde419435dd74a890887 > -- > 2.35.1 > -- Best Regards Masahiro Yamada ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um