COMMON symbol warnings
After my compile run with __CHECK_ENDIAN__ the modules were built and I got:
WARNING: "iwl_param_debug" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_disable_hw_scan" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_hwcrypto" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_antenna" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_disable" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_debug" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_disable_hw_scan" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_hwcrypto" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_antenna" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_disable" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw-mac80211/zd1211rw-mac80211] is COMMON symbol
WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw/zd1211rw] is COMMON symbol
any idea what that means? It's from scripts/mod/modpost.c:
switch (sym->st_shndx) {
case SHN_COMMON:
warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name);
break;johannes
Quoted 1 line · Johannes Berg
After my compile run with
__CHECK_ENDIAN__the modules were built and I
...
Quoted 8 lines
WARNING: "
zd_workqueue" [drivers/net/wireless/zd1211rw-mac80211/zd1211rw-mac80211] is COMMON symbol
WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw/zd1211rw] is COMMON symbolany idea what that means? It's from
scripts/mod/modpost.c:switch (sym->st_shndx) { case SHN_COMMON: warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name); break;
It looks like that modpost warns about symbols that are shared between objects. In the zd1211rw case this is a extern symbol shared between objects, but this has never created an issue. Surely one could write a function which returns the pointer to prevent the warning, but I can't see the definite necessity.
Signature · 1 line
Uli Kunitz
Quoted 16 lines · Johannes Berg
After my compile run with
__CHECK_ENDIAN__the modules were built and I got:WARNING: "
iwl_param_debug" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_disable_hw_scan" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_hwcrypto" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_antenna" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_disable" [drivers/net/wireless/iwl3945] is COMMON symbol
WARNING: "iwl_param_debug" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_disable_hw_scan" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_hwcrypto" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_antenna" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "iwl_param_disable" [drivers/net/wireless/iwl4965] is COMMON symbol
WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw-mac80211/zd1211rw-mac80211] is COMMON symbol
WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw/zd1211rw] is COMMON symbol
Quoted 1 line
any idea what that means?
Yes. It means a variable is declared in multiple places and the linker merges it for you. The fix is to make sure these are declared extern in all places but one.
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines
WARNING: "
zd_workqueue" [drivers/net/wireless/zd1211rw-mac80211/zd1211rw-mac80211] is COMMON symbol
WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw/zd1211rw] is COMMON symbolany idea what that means?
Yes. It means a variable is declared in multiple places and the linker merges it for you. The fix is to make sure these are declared extern in all places but one.
Do you need an own workqueue in zd? Can you use the one mac80211 exports?
Quoted 11 lines · Michael Buesch
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines
WARNING: "
zd_workqueue" [drivers/net/wireless/zd1211rw-mac80211/zd1211rw-mac80211] is COMMON symbol
WARNING: "zd_workqueue" [drivers/net/wireless/zd1211rw/zd1211rw] is COMMON symbolany idea what that means?
Yes. It means a variable is declared in multiple places and the linker merges it for you. The fix is to make sure these are declared extern in all places but one.
Do you need an own workqueue in zd? Can you use the one mac80211 exports?
We could use the one mac80211 exports. This has been on my TODO list for quite some time. But given the other problems we still have, this hasn't been the highest priority. There is no bug here, the only issue is that resource usage is a little bit higher. The warning is from my point of view useless, because it is always shown regardless whether there is a problem or not.
Signature · 1 line
Uli Kunitz
Quoted 3 lines · Christoph Hellwig
Yes. It means a variable is declared in multiple places and the linker merges it for you. The fix is to make sure these are declared extern in all places but one.
Interesting. So it's missing in a header file but sparse doesn't warn about it like it does with functions that aren't declared nor static?
johannes
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Christoph Hellwig
Yes. It means a variable is declared in multiple places and the linker merges it for you. The fix is to make sure these are declared extern in all places but one.
Interesting. So it's missing in a header file but sparse doesn't warn about it like it does with functions that aren't declared nor static?
No. Say you have the following case:
----------- foo.h ------------
int foo;
----------- foo1.c -----------
#include "foo.h"
----------- foo2.c -----------
#include "foo.h"
--------- Makefile -----------
obj-m += foo.o
foo-y += foo1.o foo2.o
This gives you a foo COMMON symbol. But at least on i386 the kernel is compiled with -fno-common so you get a warning like:
/home/hch/test/foo1.o:(.bss+0x0): multiple definition of `foo' /home/hch/test/foo2.o:(.bss+0x0): first defined here
When adding -fcommon to EXTRA_FLAGS I get what you saw in this thread:
WARNING: "foo" [/home/hch/test/foo] is COMMON symbol
I wonder how the driver build managed to override our global -fno-common setting.
Quoted 13 lines · Christoph Hellwig
No. Say you have the following case:
-----------
foo.h------------
int foo;
-----------foo1.c-----------
#include "foo.h"
-----------foo2.c-----------
#include "foo.h"
---------Makefile-----------
obj-m += foo.o
foo-y += foo1.o foo2.o
Quoted 1 line
This gives you a foo COMMON symbol.
Ah, ok. I'm not familiar with these drivers though so I have no idea why this happened, and then only with -D__CHECK_ENDIAN__.
Quoted 2 lines
But at least on i386 the kernel
is compiled with -fno-common so you get a warning like:
I'm building on powerpc. It has -fno-common as well.
Quoted 2 lines
I wonder how the driver build managed to override our global -fno-common setting.
No idea. I guess the driver authors should look into it :)
johannes