* Possible regression due to 269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost"
@ 2021-03-04 16:21 Vladimir Murzin
2021-03-04 17:24 ` Masahiro Yamada
0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Murzin @ 2021-03-04 16:21 UTC (permalink / raw)
To: linux-kernel, linux-kbuild
Cc: Michal Marek, Masahiro Yamada, Vladimir Murzin, arnd
Hi,
Recently, I had to dig awkward build issue for external module (originally with ARCH=arm)
like
MODPOST module/path/Module.symvers
ERROR: modpost: "__put_user_1" [module/path/name.ko] undefined!
ERROR: modpost: "__aeabi_unwind_cpp_pr0" [/module/path/name.ko] undefined!
and it looks like it is happening due to
269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost"
Here is result of my investigation (with ARCH=arm64)
$ git describe
v5.7-rc5-72-g269a535
# Start with clean build
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 mrproper
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 defconfig
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 -j5 > /dev/null
$ cp vmlinux.symvers vmlinux.symvers.defconfig
$ cp Module.symvers Module.symvers.defconfig
# Alter configuration
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 allnoconfig
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 -j5 > /dev/null
$ cp vmlinux.symvers vmlinux.symvers.allnoconfig
$ cp Module.symvers Module.symvers.allnoconfig
$ diff vmlinux.symvers.defconfig vmlinux.symvers.allnoconfig > /dev/null
$ echo $?
1
$ diff Module.symvers.defconfig Module.symvers.allnoconfig > /dev/null
$ echo $?
0
So, Module.sysver not reflecting changes in configuration, yet IIUC it
it supposed to include vmlinux.symvers
If you are lucky enough with stale Module.symver there is a chance to
fail build of external module in very awkward way
Obviously
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 mrproper
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 allnoconfig
$ ls *.symvers
vmlinux.symvers
With that external module build would splat
WARNING: Symbol version dump "Module.symvers" is missing.
Modules may not have dependencies or modversions.
Also, there are several reports on user forums describing
symptoms which could be due to the issue, with workarounds
like "enable random in-tree module" or/and "create empty
Module.symvers"
One commit before 269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost"
$ git describe
v5.7-rc5-71-gf1005b3
# Start with clean build
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 mrproper
# Build defconfig
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 defconfig
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 -j5 > /dev/null
$ cp Module.symvers Module.symvers.defconfig
# Alter configuration
$ CROSS_COMPILE=make ARCH=arm64 allnoconfig
$ cp Module.symvers Module.symvers.allnoconfig
$ diff Module.symvers.defconfig Module.symvers.allnoconfig > /dev/null
$ echo $?
1
As you can see Module.symvers gets updated
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 mrproper
$ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 allnoconfig
$ CROSS_COMPILE=make ARCH=arm64 -j5 > /dev/null
$ ls *.symvers
Module.symvers
As you can see Modeule.symver gets created
Does that make sense? What I'm missing?
P.S.
I've also checked v5.12-rc1 and see the same symptoms
Cheers
Vladimir
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Possible regression due to 269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost"
2021-03-04 16:21 Possible regression due to 269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost" Vladimir Murzin
@ 2021-03-04 17:24 ` Masahiro Yamada
2021-03-05 14:15 ` Vladimir Murzin
0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2021-03-04 17:24 UTC (permalink / raw)
To: Vladimir Murzin
Cc: Linux Kernel Mailing List, Linux Kbuild mailing list,
Michal Marek, Arnd Bergmann
On Fri, Mar 5, 2021 at 1:21 AM Vladimir Murzin <vladimir.murzin@arm.com> wrote:
[ snip long description ]
>
> Does that make sense? What I'm missing?
>
> P.S.
> I've also checked v5.12-rc1 and see the same symptoms
Since you ran "make allnoconfig",
the module feature was disabled.
(CONFIG_MODULES=n)
That is why you cannot build external modules.
> Cheers
> Vladimir
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Possible regression due to 269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost"
2021-03-04 17:24 ` Masahiro Yamada
@ 2021-03-05 14:15 ` Vladimir Murzin
2021-03-05 14:33 ` Masahiro Yamada
0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Murzin @ 2021-03-05 14:15 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Linux Kernel Mailing List, Linux Kbuild mailing list,
Michal Marek, Arnd Bergmann
On 3/4/21 5:24 PM, Masahiro Yamada wrote:
> On Fri, Mar 5, 2021 at 1:21 AM Vladimir Murzin <vladimir.murzin@arm.com> wrote:
> [ snip long description ]
>
>>
>> Does that make sense? What I'm missing?
>>
>> P.S.
>> I've also checked v5.12-rc1 and see the same symptoms
>
> Since you ran "make allnoconfig",
> the module feature was disabled.
> (CONFIG_MODULES=n)
>
> That is why you cannot build external modules.
That's a good point, yet was not reason for my issue :) It forced me to try with ARCH=arm
(and update toolchain)
$ CROSS_COMPILE=arm-none-linux-gnueabihf- make ARCH=arm mrproper
$ CROSS_COMPILE=arm-none-linux-gnueabihf- make ARCH=arm vexpress_defconfig
$ grep -w CONFIG_MODULES .config
CONFIG_MODULES=y
$ grep "=m" .config
$ echo $?
1
$ CROSS_COMPILE=arm-none-linux-gnueabihf- make ARCH=arm Image -j5 > /dev/null
$ ls *.symvers
vmlinux.symvers
$ CROSS_COMPILE=arm-none-linux-gnueabihf- make ARCH=arm Image -j5 modules > /dev/null
$ ls *.symvers
Module.symvers vmlinux.symvers
So, `make modules` seems to become be mandatory. I'll go and update my scripts...
Cheers
Vladimir
>
>
>
>> Cheers
>> Vladimir
>
>
>
>
> --
> Best Regards
> Masahiro Yamada
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Possible regression due to 269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost"
2021-03-05 14:15 ` Vladimir Murzin
@ 2021-03-05 14:33 ` Masahiro Yamada
0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2021-03-05 14:33 UTC (permalink / raw)
To: Vladimir Murzin
Cc: Linux Kernel Mailing List, Linux Kbuild mailing list,
Michal Marek, Arnd Bergmann
On Fri, Mar 5, 2021 at 11:15 PM Vladimir Murzin <vladimir.murzin@arm.com> wrote:
>
> On 3/4/21 5:24 PM, Masahiro Yamada wrote:
> > On Fri, Mar 5, 2021 at 1:21 AM Vladimir Murzin <vladimir.murzin@arm.com> wrote:
> > [ snip long description ]
> >
> >>
> >> Does that make sense? What I'm missing?
> >>
> >> P.S.
> >> I've also checked v5.12-rc1 and see the same symptoms
> >
> > Since you ran "make allnoconfig",
> > the module feature was disabled.
> > (CONFIG_MODULES=n)
> >
> > That is why you cannot build external modules.
>
> That's a good point, yet was not reason for my issue :) It forced me to try with ARCH=arm
> (and update toolchain)
>
> $ CROSS_COMPILE=arm-none-linux-gnueabihf- make ARCH=arm mrproper
> $ CROSS_COMPILE=arm-none-linux-gnueabihf- make ARCH=arm vexpress_defconfig
> $ grep -w CONFIG_MODULES .config
> CONFIG_MODULES=y
> $ grep "=m" .config
> $ echo $?
> 1
> $ CROSS_COMPILE=arm-none-linux-gnueabihf- make ARCH=arm Image -j5 > /dev/null
> $ ls *.symvers
> vmlinux.symvers
> $ CROSS_COMPILE=arm-none-linux-gnueabihf- make ARCH=arm Image -j5 modules > /dev/null
> $ ls *.symvers
> Module.symvers vmlinux.symvers
>
> So, `make modules` seems to become be mandatory. I'll go and update my scripts...
>
Without 'make modules', still you can build
external modules, but you will see a warning.
WARNING: Symbol version dump Module.symver is missing.
Modules may not have dependencies or modversions.
Before 269a535ca931, if you did not run 'make modules',
Module.symvers contained symbols only from vmlinux, but
not from modules.
It was working for you just because your external modules
did not use symbols of in-tree modules.
But, it is fragile, and it may break suddenly if the
upstream code moves some config options from y to m.
So, building both vmlinux and modules
is the right thing.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-05 14:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 16:21 Possible regression due to 269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost" Vladimir Murzin
2021-03-04 17:24 ` Masahiro Yamada
2021-03-05 14:15 ` Vladimir Murzin
2021-03-05 14:33 ` Masahiro Yamada
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.