All of lore.kernel.org
 help / color / mirror / Atom feed
* FYI: net/phy/marvell10g: android kernel builing error due to modpost error
@ 2022-04-18  9:22 Mauro Rossi
  2022-04-18 10:08 ` Russell King (Oracle)
  0 siblings, 1 reply; 5+ messages in thread
From: Mauro Rossi @ 2022-04-18  9:22 UTC (permalink / raw)
  To: netdev; +Cc: linux, kabel, Chih-Wei Huang

Hello,
FYI I am writing based on current ./MANTAINERS file in linux

I am testing the linux build during 5.18 rc cycle,while supporting
android-x86 project for hobby

At the final stage of building  Linux 5.18-rc3 with the necessary AOSP
changes, I am getting the following building error:

  MODPOST modules-only.symvers
ERROR: modpost: "__compiletime_assert_344"
[drivers/net/phy/marvell10g.ko] undefined!
make[2]: *** [/home/utente/r-x86_kernel/kernel/scripts/Makefile.modpost:134:
modules-only.symvers] Error 1
make[2]: *** Deleting file 'modules-only.symvers'
make[1]: *** [/home/utente/r-x86_kernel/kernel/Makefile:1749: modules] Error 2
make[1]: *** Waiting for unfinished jobs....

It never happened before throughout all my previous android-x86 kernel
rc cycle build tests, which spanned from linux version 5.10 to linux
version 5.18rc

I am using AOSP prebuilt llvm toochain, which is mandatory in AOSP
builds because gcc was removed from the AOSP toolchain

/home/utente/r-x86_kernel/prebuilts/clang/host/linux-x86/clang-r383902b1/bin/clang
--version
Android (6877366 based on r383902b1) clang version 11.0.2
(https://android.googlesource.com/toolchain/llvm-project
b397f81060ce6d701042b782172ed13bee898b79)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/utente/r-x86_kernel/prebuilts/clang/host/linux-x86/clang-r383902b1/bin

At the moment I can easily avoid the build breakage by disabling
drivers/net/phy/marvell10g.ko in kconfig (# CONFIG_MARVELL_10G_PHY is
not set)

but I wanted to inform you, becasue I'm not sure if it can be a
problem outside of AOSP/ android-x86 scope and if that's the case, you
are now informed/aware

Your feedback is appreciated
Thank you

Mauro Rossi
android-x86 team

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FYI: net/phy/marvell10g: android kernel builing error due to modpost error
  2022-04-18  9:22 FYI: net/phy/marvell10g: android kernel builing error due to modpost error Mauro Rossi
@ 2022-04-18 10:08 ` Russell King (Oracle)
  2022-04-19 16:39   ` Mauro Rossi
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King (Oracle) @ 2022-04-18 10:08 UTC (permalink / raw)
  To: Mauro Rossi; +Cc: netdev, kabel, Chih-Wei Huang

On Mon, Apr 18, 2022 at 11:22:12AM +0200, Mauro Rossi wrote:
> At the final stage of building  Linux 5.18-rc3 with the necessary AOSP
> changes, I am getting the following building error:
> 
>   MODPOST modules-only.symvers
> ERROR: modpost: "__compiletime_assert_344"
> [drivers/net/phy/marvell10g.ko] undefined!
> make[2]: *** [/home/utente/r-x86_kernel/kernel/scripts/Makefile.modpost:134:
> modules-only.symvers] Error 1
> make[2]: *** Deleting file 'modules-only.symvers'
> make[1]: *** [/home/utente/r-x86_kernel/kernel/Makefile:1749: modules] Error 2
> make[1]: *** Waiting for unfinished jobs....
> 
> It never happened before throughout all my previous android-x86 kernel
> rc cycle build tests, which spanned from linux version 5.10 to linux
> version 5.18rc

As far as I'm aware, with mainline kernels, marvell10g builds fine.
I'm not sure how to work back from "__compiletime_assert_344" to
where the problem could be. The "344" appears to be generated by
the __COUNTER__ macro - and I don't know how that macro works (debian
annoyingly don't package the GCC info docs, and the info files I have
are out of date.)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FYI: net/phy/marvell10g: android kernel builing error due to modpost error
  2022-04-18 10:08 ` Russell King (Oracle)
@ 2022-04-19 16:39   ` Mauro Rossi
  2022-05-01 18:51     ` Mauro Rossi
  0 siblings, 1 reply; 5+ messages in thread
From: Mauro Rossi @ 2022-04-19 16:39 UTC (permalink / raw)
  To: Russell King (Oracle); +Cc: netdev, kabel, Chih-Wei Huang

Hi Russell,

On Mon, Apr 18, 2022 at 12:08 PM Russell King (Oracle)
<linux@armlinux.org.uk> wrote:
>
> On Mon, Apr 18, 2022 at 11:22:12AM +0200, Mauro Rossi wrote:
> > At the final stage of building  Linux 5.18-rc3 with the necessary AOSP
> > changes, I am getting the following building error:
> >
> >   MODPOST modules-only.symvers
> > ERROR: modpost: "__compiletime_assert_344"
> > [drivers/net/phy/marvell10g.ko] undefined!
> > make[2]: *** [/home/utente/r-x86_kernel/kernel/scripts/Makefile.modpost:134:
> > modules-only.symvers] Error 1
> > make[2]: *** Deleting file 'modules-only.symvers'
> > make[1]: *** [/home/utente/r-x86_kernel/kernel/Makefile:1749: modules] Error 2
> > make[1]: *** Waiting for unfinished jobs....
> >
> > It never happened before throughout all my previous android-x86 kernel
> > rc cycle build tests, which spanned from linux version 5.10 to linux
> > version 5.18rc
>
> As far as I'm aware, with mainline kernels, marvell10g builds fine.

Thanks for response, I will also check that when
https://android.googlesource.com/kernel/common-patches/ becomes
available for kernel-5.18rc(s)

> I'm not sure how to work back from "__compiletime_assert_344" to
> where the problem could be. The "344" appears to be generated by
> the __COUNTER__ macro - and I don't know how that macro works (debian
> annoyingly don't package the GCC info docs, and the info files I have
> are out of date.)

Looking at the error printout, it seams indeed that modpost parsed
modules-only.symvers file line-by-line
and (my assumption, correct me if I may be wrong) encountered some
'undefined!' symbol at line 344 of  modules-only.symvers and pointed
out that marvell10g.ko module is the one associated with the missing
symbol

I have tried to copy
$OUT/target/product/x86_64/obj/kernel/modules-only.symvers to be able
to inspect which symbol is listed at line 344,
but even with "watch -n 0.1 cp ..." command I am not able to save the
generated modules-only.symvers before it is deleted, therefore I am
not able to inspect line 344

Is there a way to have modpost modified for printing the symbol
instead of the "indirection" of "__compiletime_assert_344" ?

As other info, I had to cross compile using prebuilt clang 11.0.2
(kernel version constraint) and set  LLVM_IAS=0 to disable the llvm
integrated assembler to be able to build, but I don't think that
should cause the missing symbol as I don't see any assembler code is
needed to build marvell10g.ko module

KR
Mauro

>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FYI: net/phy/marvell10g: android kernel builing error due to modpost error
  2022-04-19 16:39   ` Mauro Rossi
@ 2022-05-01 18:51     ` Mauro Rossi
  2022-05-01 21:28       ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Mauro Rossi @ 2022-05-01 18:51 UTC (permalink / raw)
  To: Russell King (Oracle), masahiroy, michal.lkml
  Cc: netdev, kabel, Chih-Wei Huang

On Tue, Apr 19, 2022 at 6:39 PM Mauro Rossi <issor.oruam@gmail.com> wrote:
>
> Hi Russell,
>
> On Mon, Apr 18, 2022 at 12:08 PM Russell King (Oracle)
> <linux@armlinux.org.uk> wrote:
> >
> > On Mon, Apr 18, 2022 at 11:22:12AM +0200, Mauro Rossi wrote:
> > > At the final stage of building  Linux 5.18-rc3 with the necessary AOSP
> > > changes, I am getting the following building error:
> > >
> > >   MODPOST modules-only.symvers
> > > ERROR: modpost: "__compiletime_assert_344"
> > > [drivers/net/phy/marvell10g.ko] undefined!
> > > make[2]: *** [/home/utente/r-x86_kernel/kernel/scripts/Makefile.modpost:134:
> > > modules-only.symvers] Error 1
> > > make[2]: *** Deleting file 'modules-only.symvers'
> > > make[1]: *** [/home/utente/r-x86_kernel/kernel/Makefile:1749: modules] Error 2
> > > make[1]: *** Waiting for unfinished jobs....
> > >
> > > It never happened before throughout all my previous android-x86 kernel
> > > rc cycle build tests, which spanned from linux version 5.10 to linux
> > > version 5.18rc
> >
> > As far as I'm aware, with mainline kernels, marvell10g builds fine.
>
> Thanks for response, I will also check that when
> https://android.googlesource.com/kernel/common-patches/ becomes
> available for kernel-5.18rc(s)
>
> > I'm not sure how to work back from "__compiletime_assert_344" to
> > where the problem could be. The "344" appears to be generated by
> > the __COUNTER__ macro - and I don't know how that macro works (debian
> > annoyingly don't package the GCC info docs, and the info files I have
> > are out of date.)
>
> Looking at the error printout, it seams indeed that modpost parsed
> modules-only.symvers file line-by-line
> and (my assumption, correct me if I may be wrong) encountered some
> 'undefined!' symbol at line 344 of  modules-only.symvers and pointed
> out that marvell10g.ko module is the one associated with the missing
> symbol
>
> I have tried to copy
> $OUT/target/product/x86_64/obj/kernel/modules-only.symvers to be able
> to inspect which symbol is listed at line 344,
> but even with "watch -n 0.1 cp ..." command I am not able to save the
> generated modules-only.symvers before it is deleted, therefore I am
> not able to inspect line 344
>
> Is there a way to have modpost modified for printing the symbol
> instead of the "indirection" of "__compiletime_assert_344" ?
>
> As other info, I had to cross compile using prebuilt clang 11.0.2
> (kernel version constraint) and set  LLVM_IAS=0 to disable the llvm
> integrated assembler to be able to build, but I don't think that
> should cause the missing symbol as I don't see any assembler code is
> needed to build marvell10g.ko module
>
> KR
> Mauro

Hello,

I am adding script/mod/modpost.c mantainers to consult them, as I am
not much familiar with the meaning of the error

I am building the kernel with Android Build System as part of our
iso_img target build, gcc based build has always been successful,
while llvm based build is not working and generates the following
error, which we are not able to interpret.

ERROR: modpost: "__compiletime_assert_344"
[drivers/net/phy/marvell10g.ko] undefined!

"__compiletime_assert_344" is obviously not a symbol
used/needed/exported by marvell10g.ko

I have also tried with different build machines and different kernel
versions i.e. 5.17 and 5.16
the 344 number changes, but the modpost error at marvell10g.ko is always there.

This is how to reproduce:

CONFIG_MARVELL_PHY=m
CONFIG_MARVELL_10G_PHY=m

Could you please help us to understand the reason for the error and
how to avoid it?
Thank you

Mauro
android-x86 team

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: FYI: net/phy/marvell10g: android kernel builing error due to modpost error
  2022-05-01 18:51     ` Mauro Rossi
@ 2022-05-01 21:28       ` Andrew Lunn
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2022-05-01 21:28 UTC (permalink / raw)
  To: Mauro Rossi
  Cc: Russell King (Oracle),
	masahiroy, michal.lkml, netdev, kabel, Chih-Wei Huang

On Sun, May 01, 2022 at 08:51:17PM +0200, Mauro Rossi wrote:
> On Tue, Apr 19, 2022 at 6:39 PM Mauro Rossi <issor.oruam@gmail.com> wrote:
> >
> > Hi Russell,
> >
> > On Mon, Apr 18, 2022 at 12:08 PM Russell King (Oracle)
> > <linux@armlinux.org.uk> wrote:
> > >
> > > On Mon, Apr 18, 2022 at 11:22:12AM +0200, Mauro Rossi wrote:
> > > > At the final stage of building  Linux 5.18-rc3 with the necessary AOSP
> > > > changes, I am getting the following building error:
> > > >
> > > >   MODPOST modules-only.symvers
> > > > ERROR: modpost: "__compiletime_assert_344"
> > > > [drivers/net/phy/marvell10g.ko] undefined!
> > > > make[2]: *** [/home/utente/r-x86_kernel/kernel/scripts/Makefile.modpost:134:
> > > > modules-only.symvers] Error 1
> > > > make[2]: *** Deleting file 'modules-only.symvers'
> > > > make[1]: *** [/home/utente/r-x86_kernel/kernel/Makefile:1749: modules] Error 2
> > > > make[1]: *** Waiting for unfinished jobs....
> > > >
> > > > It never happened before throughout all my previous android-x86 kernel
> > > > rc cycle build tests, which spanned from linux version 5.10 to linux
> > > > version 5.18rc
> > >
> > > As far as I'm aware, with mainline kernels, marvell10g builds fine.
> >
> > Thanks for response, I will also check that when
> > https://android.googlesource.com/kernel/common-patches/ becomes
> > available for kernel-5.18rc(s)
> >
> > > I'm not sure how to work back from "__compiletime_assert_344" to
> > > where the problem could be. The "344" appears to be generated by
> > > the __COUNTER__ macro - and I don't know how that macro works (debian
> > > annoyingly don't package the GCC info docs, and the info files I have
> > > are out of date.)
> >
> > Looking at the error printout, it seams indeed that modpost parsed
> > modules-only.symvers file line-by-line
> > and (my assumption, correct me if I may be wrong) encountered some
> > 'undefined!' symbol at line 344 of  modules-only.symvers and pointed
> > out that marvell10g.ko module is the one associated with the missing
> > symbol
> >
> > I have tried to copy
> > $OUT/target/product/x86_64/obj/kernel/modules-only.symvers to be able
> > to inspect which symbol is listed at line 344,
> > but even with "watch -n 0.1 cp ..." command I am not able to save the
> > generated modules-only.symvers before it is deleted, therefore I am
> > not able to inspect line 344
> >
> > Is there a way to have modpost modified for printing the symbol
> > instead of the "indirection" of "__compiletime_assert_344" ?
> >
> > As other info, I had to cross compile using prebuilt clang 11.0.2
> > (kernel version constraint) and set  LLVM_IAS=0 to disable the llvm
> > integrated assembler to be able to build, but I don't think that
> > should cause the missing symbol as I don't see any assembler code is
> > needed to build marvell10g.ko module
> >
> > KR
> > Mauro
> 
> Hello,
> 
> I am adding script/mod/modpost.c mantainers to consult them, as I am
> not much familiar with the meaning of the error
> 
> I am building the kernel with Android Build System as part of our
> iso_img target build, gcc based build has always been successful,
> while llvm based build is not working and generates the following
> error, which we are not able to interpret.
> 
> ERROR: modpost: "__compiletime_assert_344"
> [drivers/net/phy/marvell10g.ko] undefined!
> 
> "__compiletime_assert_344" is obviously not a symbol
> used/needed/exported by marvell10g.ko

My guess would be, this is a BUILD_BUG_ON() which is somehow not
working correctly, but is working sufficiently to stop you using a
broken kernel.

**
 * compiletime_assert - break build and emit msg if condition is false
 * @condition: a compile-time constant condition to check
 * @msg:       a message to emit if condition is false
 *
 * In tradition of POSIX assert, this macro will break the build if the
 * supplied condition is *false*, emitting the supplied error message if the
 * compiler has support to do so.
 */
#define compiletime_assert(condition, msg) \
	_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)

https://elixir.bootlin.com/linux/v5.18-rc4/source/include/linux/compiler_types.h#L332

# define __compiletime_assert(condition, msg, prefix, suffix)		\
	do {								\
		/*							\
		 * __noreturn is needed to give the compiler enough	\
		 * information to avoid certain possibly-uninitialized	\
		 * warnings (regardless of the build failing).		\
		 */							\
		__noreturn extern void prefix ## suffix(void)		\
			__compiletime_error(msg);			\
		if (!(condition))					\
			prefix ## suffix();				\
	} while (0)

It appears the compiler you are using is not able to emit the supplied
error message, but it is inserting a call to a function which does not
exist.

What you probably want to do is create the .lst file for marvell10g.c
and look through the mixed C/Assembly code and find the BUILD_BUG_ON
which is triggering the issue. It is probably somewhere in an include
file, not marvell10g itself.

The other possibility is that condition is too complex for your
compiler, it cannot evaluate it at build time, allowing the optimizer
to remove the code as impossible to reach. So the compiler has
generated code to actually evaluate condition and so has the call to
the function, which is never going to exist.

The same method to debug this applies, generate the .lst file and take
a look at it.

	Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-01 21:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18  9:22 FYI: net/phy/marvell10g: android kernel builing error due to modpost error Mauro Rossi
2022-04-18 10:08 ` Russell King (Oracle)
2022-04-19 16:39   ` Mauro Rossi
2022-05-01 18:51     ` Mauro Rossi
2022-05-01 21:28       ` Andrew Lunn

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.