Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicit declaration of function ‘jhash’ #1

Open
moharaka opened this issue Mar 11, 2020 · 1 comment
Open

Implicit declaration of function ‘jhash’ #1

moharaka opened this issue Mar 11, 2020 · 1 comment

Comments

@moharaka
Copy link

Hi,

I just hit this error when compiling:

$ make
...
In file included from arch/x86/kvm/dsm.h:6:0,
                 from arch/x86/kvm/x86.c:25:
arch/x86/kvm/dsm-util.h: In function ‘jhash32’:
arch/x86/kvm/dsm-util.h:90:9: error: implicit declaration of function ‘jhash’; did you mean ‘jhash32’? [-Werror=implicit-function-declaration]
  return jhash(s, n, JHASH_INITVAL);
         ^~~~~
         jhash32
arch/x86/kvm/dsm-util.h:90:21: error: ‘JHASH_INITVAL’ undeclared (first use in this function); did you mean ‘DSM_INITIAL’?
  return jhash(s, n, JHASH_INITVAL);
                     ^~~~~~~~~~~~~
                     DSM_INITIAL
arch/x86/kvm/dsm-util.h:90:21: note: each undeclared identifier is reported only once for each function it appears in

I managed to fix it with this patch:

diff --git a/arch/x86/kvm/dsm-util.h b/arch/x86/kvm/dsm-util.h
index 7508d950..4cdc8d44 100644
--- a/arch/x86/kvm/dsm-util.h
+++ b/arch/x86/kvm/dsm-util.h
@@ -2,6 +2,7 @@
 #define ARCH_X86_KVM_DSM_UTIL_H
 
 #include <linux/kvm_host.h>
+#include <linux/jhash.h>
 
 #define DSM_INITIAL     0
 #define DSM_INVALID     1

Also, I am trying to compile the kernel using TCP/IP, so this macro is set:

#define USE_KTCP_NETWORK

Is this the right approach?

@moharaka
Copy link
Author

moharaka commented Mar 12, 2020

Update:

I am no longer hitting the problem. The only explanation is that I now have a correct configuration file. With KVM and INFINIBAND set to "yes".

With these modules ON, the "<linux/jhash.h>" header is probably loaded implicitly through them.

Will it still be nice to explicitly add the header?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant