Skip to contentSkip to conversation

kernel/gcov/gcc_4_7.c:162:9: error: implicit declaration of function 'within_module'; did you mean 'init_module'?

PATCH In review kbuild test robot 5 participants 11 messages Mar 29, 2019 – Apr 3, 2019

Subsystems (2)
lore
Share & tools
lore

kbuild test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   1baf02ec984b88b435e2fa065300179a3f48e7d2
commit: 8c3d220cb6b5f502745285106154bad632f43b15 [4291/4370] gcov: clang support
config: x86_64-randconfig-a0-03291513 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout 8c3d220cb6b5f502745285106154bad632f43b15
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

kernel/gcov/gcc_4_7.c: In function 'gcov_info_within_module':

>> kernel/gcov/gcc_4_7.c:162:9: error: implicit declaration of function 'within_module'; did you mean 'init_module'? [-Werror=implicit-function-declaration]
     return within_module((unsigned long)info, mod);
            ^~~~~~~~~~~~~
            init_module

cc1: some warnings being treated as errors

vim +162 kernel/gcov/gcc_4_7.c

152
153 /**
154 * gcov_info_within_module - check if a profiling data set belongs to a module
155 * @info: profiling data set
156 * @mod: module
157 *
158 * Returns true if profiling data belongs module, false otherwise.
159 */
160 bool gcov_info_within_module(struct gcov_info *info, struct module *mod)
161 {

 > 162		return within_module((unsigned long)info, mod);

163 }
164

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#1 lore raw

PATCH 1/1 gcov: include linux/module.h for within_module

Fixes commit 8c3d220cb6b5 ("gcov: clang support")

---
 kernel/gcov/gcc_3_4.c | 1 +
 kernel/gcov/gcc_4_7.c | 1 +
 2 files changed, 2 insertions(+)
kernel/gcov/gcc_3_4.c +1 -0
index 801ee4b0b969..0eda59ef57df 100644
@@ -16,6 +16,7 @@
  */
 
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/seq_file.h>
kernel/gcov/gcc_4_7.c +1 -0
index ec37563674d6..677851284fe2 100644
@@ -13,6 +13,7 @@
  */
 
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/seq_file.h>
Signature · 1 line
2.21.0.392.gf8f6787159e-goog
#2 lore raw

Re: [PATCH] gcov: include linux/module.h for within_module

Quoted 10 lines · Nick Desaulniers

Fixes commit 8c3d220cb6b5 ("gcov: clang support")

see https://lore.kernel.org/linux-mm/20190328225107.ULwYw%[email protected]/T/#mee26c00158574326e807480fc39dfcbd7bebd5fd

Did you test this? kernel/gcov/gcc_4_7.c includes local "gcov.h", which includes <linux/module.h>, so why didn't that work or why does this patch work?

thanks.

Quoted 30 lines
---
 kernel/gcov/gcc_3_4.c | 1 +
 kernel/gcov/gcc_4_7.c | 1 +
 2 files changed, 2 insertions(+)
kernel/gcov/gcc_3_4.c +1 -0
index 801ee4b0b969..0eda59ef57df 100644
@@ -16,6 +16,7 @@
  */
 
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/seq_file.h>
kernel/gcov/gcc_4_7.c +1 -0
index ec37563674d6..677851284fe2 100644
@@ -13,6 +13,7 @@
  */
 
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/seq_file.h>
Signature · 1 line
~Randy
#3 lore raw

Re: [PATCH] gcov: include linux/module.h for within_module

Quoted 12 lines · Randy Dunlap
Quoted 10 lines · Nick Desaulniers

Fixes commit 8c3d220cb6b5 ("gcov: clang support")

Quoted 6 lines

see https://lore.kernel.org/linux-mm/20190328225107.ULwYw%[email protected]/T/#mee26c00158574326e807480fc39dfcbd7bebd5fd

Did you test this? kernel/gcov/gcc_4_7.c includes local "gcov.h", which includes <linux/module.h>, so why didn't that work or why does this patch work?

No, this patch does not fix the build error for me.

Quoted 34 lines

thanks.

Quoted 30 lines
---
 kernel/gcov/gcc_3_4.c | 1 +
 kernel/gcov/gcc_4_7.c | 1 +
 2 files changed, 2 insertions(+)
kernel/gcov/gcc_3_4.c +1 -0
index 801ee4b0b969..0eda59ef57df 100644
@@ -16,6 +16,7 @@
  */
 
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/seq_file.h>
kernel/gcov/gcc_4_7.c +1 -0
index ec37563674d6..677851284fe2 100644
@@ -13,6 +13,7 @@
  */
 
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/seq_file.h>
Signature · 1 line
~Randy
#4 lore raw

Re: [PATCH] gcov: include linux/module.h for within_module

In reply to Randy Dunlap
Quoted 13 lines · Randy Dunlap
Quoted 10 lines · Nick Desaulniers

Fixes commit 8c3d220cb6b5 ("gcov: clang support")

Quoted 4 lines

see https://lore.kernel.org/linux-mm/20190328225107.ULwYw%[email protected]/T/#mee26c00158574326e807480fc39dfcbd7bebd5fd

Did you test this?

Yes, built with gcc 7.3 and
defconfig
+
CONFIG_GCOV_KERNEL=y
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
CONFIG_GCOV_FORMAT_4_7=y

Quoted 3 lines

kernel/gcov/gcc_4_7.c includes local "gcov.h",
which includes <linux/module.h>, so why didn't that work or why does this patch work?

Good point. May be something in the configs from 0-day bot. Boarding a plane for Bangkok, but can dig further once landed.

Maybe module support was disabled?

--
Thanks,
~Nick Desaulniers

#5 lore raw

Re: [PATCH] gcov: include linux/module.h for within_module

Quoted 26 lines · Nick Desaulniers
Quoted 13 lines · Randy Dunlap
Quoted 10 lines · Nick Desaulniers

Fixes commit 8c3d220cb6b5 ("gcov: clang support")

Quoted 4 lines

see https://lore.kernel.org/linux-mm/20190328225107.ULwYw%[email protected]/T/#mee26c00158574326e807480fc39dfcbd7bebd5fd

Did you test this?

Yes, built with gcc 7.3 and
defconfig
+
CONFIG_GCOV_KERNEL=y
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
CONFIG_GCOV_FORMAT_4_7=y

Quoted 8 lines
Quoted 3 lines

kernel/gcov/gcc_4_7.c includes local "gcov.h",
which includes <linux/module.h>, so why didn't that work or why does this patch work?

Good point. May be something in the configs from 0-day bot. Boarding a plane for Bangkok, but can dig further once landed.

Maybe module support was disabled?

Yes, I reported the problem with CONFIG_MODULES not enabled.

Signature · 1 line
~Randy
#6 lore raw

PATCH v2 1/1 gcov: fix when CONFIG_MODULES is not set

Fixes commit 8c3d220cb6b5 ("gcov: clang support")

---
 kernel/gcov/gcc_3_4.c | 4 ++++
 kernel/gcov/gcc_4_7.c | 4 ++++
 2 files changed, 8 insertions(+)
kernel/gcov/gcc_3_4.c +4 -0
index 801ee4b0b969..8fc30f178351 100644
@@ -146,7 +146,11 @@ void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info)
  */
 bool gcov_info_within_module(struct gcov_info *info, struct module *mod)
 {
+#ifdef CONFIG_MODULES
 	return within_module((unsigned long)info, mod);
+#else
+	return false;
+#endif
 }
 
 /* Symbolic links to be created for each profiling data file. */
kernel/gcov/gcc_4_7.c +4 -0
index ec37563674d6..0b6886d4a4dd 100644
@@ -159,7 +159,11 @@ void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info)
  */
 bool gcov_info_within_module(struct gcov_info *info, struct module *mod)
 {
+#ifdef CONFIG_MODULES
 	return within_module((unsigned long)info, mod);
+#else
+	return false;
+#endif
 }
 
 /* Symbolic links to be created for each profiling data file. */
Signature · 1 line
2.21.0.392.gf8f6787159e-goog
Acked-by on v2 1/1
#7 lore raw

Re: [PATCH v2] gcov: fix when CONFIG_MODULES is not set

Quoted 1 line · Nick Desaulniers

Fixes commit 8c3d220cb6b5 ("gcov: clang support")

There is a certain format for Fixes: and that's not quite it. :(

Quoted 9 lines

Thanks.

Quoted 38 lines
---
 kernel/gcov/gcc_3_4.c | 4 ++++
 kernel/gcov/gcc_4_7.c | 4 ++++
 2 files changed, 8 insertions(+)
kernel/gcov/gcc_3_4.c +4 -0
index 801ee4b0b969..8fc30f178351 100644
@@ -146,7 +146,11 @@ void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info)
  */
 bool gcov_info_within_module(struct gcov_info *info, struct module *mod)
 {
+#ifdef CONFIG_MODULES
 	return within_module((unsigned long)info, mod);
+#else
+	return false;
+#endif
 }
 
 /* Symbolic links to be created for each profiling data file. */
kernel/gcov/gcc_4_7.c +4 -0
index ec37563674d6..0b6886d4a4dd 100644
@@ -159,7 +159,11 @@ void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info)
  */
 bool gcov_info_within_module(struct gcov_info *info, struct module *mod)
 {
+#ifdef CONFIG_MODULES
 	return within_module((unsigned long)info, mod);
+#else
+	return false;
+#endif
 }
 
 /* Symbolic links to be created for each profiling data file. */
Signature · 1 line
~Randy
#8 lore raw

Re: [PATCH v2] gcov: fix when CONFIG_MODULES is not set

Quoted 16 lines · Randy Dunlap
Quoted 1 line · Nick Desaulniers

Fixes commit 8c3d220cb6b5 ("gcov: clang support")

There is a certain format for Fixes: and that's not quite it. :(

Quoted 9 lines
Quoted 8 lines

Thanks.

Quoted 4 lines
---
 kernel/gcov/gcc_3_4.c | 4 ++++
 kernel/gcov/gcc_4_7.c | 4 ++++
 2 files changed, 8 insertions(+)

Thanks for taking a look at this Nick! I believe same fix should be applied to kernel/gcov/clang.c. I'll send out an updated version later today.

#9 lore raw

Re: [PATCH v2] gcov: fix when CONFIG_MODULES is not set

Quoted 7 lines · Tri Vo
Quoted 5 lines · Randy Dunlap
Quoted 1 line · Nick Desaulniers

Fixes commit 8c3d220cb6b5 ("gcov: clang support")

There is a certain format for Fixes: and that's not quite it. :(

Looks like the format is:
Fixes: <first 12 characters of commit sha> ("<first line of commit>") so:

Fixes 8c3d220cb6b5 ("gcov: clang support")

We should update:
https://www.kernel.org/doc/html/v5.0/process/stable-kernel-rules.html
to include this information.

Quoted 3 lines

Thanks for taking a look at this Nick! I believe same fix should be applied to kernel/gcov/clang.c. I'll send out an updated version later today.

All yours, happy to review.

Signature · 2 lines
Thanks,
~Nick Desaulniers