Kernel compiling errors with every modification












0















Whenever I try to work with kernel source (be it upstream to higher Linux stable version, adding features, etc.), it fails on random source files when compiling.



For example, I tried to upstream kernel version from v3.18.110 to 3.18.125 (with one version at a time, of course). I successfully resolved all conflicts which appeared, but when I start building the kernel, the compiler finds error in file which wasn't even in the conflicting files. Solving the error which appears will introduce more errors, either in the same file or in other file.



Other thing I tried is adding a governor. I successfully added the code where it is needed, added the original governor source file, then enabled it in default config and then started compiling. After this, the compiler found some error in the .c file of the governor. Why?



I'm not asking for error resolution, I want to know why errors happen in the first place.



Architecture is arm64, toolchain is:
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9



Example:
I'm trying to add governor by editing these files:




drivers/cpufreq/Kconfig



drivers/cpufreq/Makefile



include/linux/cpufreq.h




Kconfig:



config CPU_FREQ_DEFAULT_GOV_SMARTMAX
bool "smartmax"
select CPU_FREQ_GOV_SMARTMAX
help
Use the CPUFreq governor 'smartmax' as default

config CPU_FREQ_GOV_SMARTMAX
tristate "'smartmax' cpufreq policy governor"
select CPU_FREQ_TABLE
help
'smartmax' combined ondemand and smartass2


Makefile:



obj-$(CONFIG_CPU_FREQ_GOV_SMARTMAX) += cpufreq_smartmax.o


cpufreq.h:



#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTMAX)
extern struct cpufreq_governor cpufreq_gov_smartmax;
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_smartmax)


After that I add the .c file of the governor (which is unmodified and completely original governor code), then add this in default config for my device:



CONFIG_CPU_FREQ_GOV_SMARTMAX=y


Then I go to toolchain folder, open terminal and type this:



export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-android-
export ARCH=arm64 && export SUBARCH=arm64


After this I go to kernel folder and use the following commands:



make clean
make mrproper
make *my_device_config_name*
make -s -j$(nproc --all)


Doing all of this results in the following errors in the governor code:




drivers/cpufreq/cpufreq_smartmax.c: In function 'cpufreq_smartmax_timer':
drivers/cpufreq/cpufreq_smartmax.c:522:3: error: implicit declaration of function '__cpufreq_driver_getavg' [-Werror=implicit-function-declaration]
freq_avg = __cpufreq_driver_getavg(policy, j);



drivers/cpufreq/cpufreq_smartmax.c: In function 'store_debug_mask':
drivers/cpufreq/cpufreq_smartmax.c:607:2: error: implicit declaration of function 'strict_strtoul' [-Werror=implicit-function-declaration]
res = strict_strtoul(buf, 0, &input);











share|improve this question

























  • Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.

    – Sean Pianka
    Nov 15 '18 at 20:48











  • You want to know why the errors happen, but doesn't provide enough details: architecture you use, command line, configuration.. and the error messages themselves. I suggest you to try to compile the kernel without any modification. So you will sure that problem is not in your modifications.

    – Tsyvarev
    Nov 15 '18 at 21:57











  • @Tsyvarev You're right, I forgot to add this information... Edited the question. I already tried to build the source without any modifications, it builds successfully. Adding just small modifications causes errors in the freshly added .c file (if any) or in the currently present source files. I'll add the error message...

    – T. N.
    Nov 15 '18 at 22:38











  • Compilation of file drivers/cpufreq/cpufreq_smartmax.c very depends on content of files drivers/cpufreq/Kconfig and drivers/cpufreq/Makefile which you have modified. Without viewing your modification it is difficult to guess reason of the problem. (Hint: The function __cpufreq_driver_getavg is most likely defined in /drivers/cpufreq/cpufreq.c. Check that given file contains the function and that given file is actually compiled.)

    – Tsyvarev
    Nov 15 '18 at 23:40













  • @Tsyvarev Added what I modified. The function cpufreq_driver_getavg is not defined in cpufreq.c. The file gets compiled.

    – T. N.
    Nov 16 '18 at 12:11
















0















Whenever I try to work with kernel source (be it upstream to higher Linux stable version, adding features, etc.), it fails on random source files when compiling.



For example, I tried to upstream kernel version from v3.18.110 to 3.18.125 (with one version at a time, of course). I successfully resolved all conflicts which appeared, but when I start building the kernel, the compiler finds error in file which wasn't even in the conflicting files. Solving the error which appears will introduce more errors, either in the same file or in other file.



Other thing I tried is adding a governor. I successfully added the code where it is needed, added the original governor source file, then enabled it in default config and then started compiling. After this, the compiler found some error in the .c file of the governor. Why?



I'm not asking for error resolution, I want to know why errors happen in the first place.



Architecture is arm64, toolchain is:
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9



Example:
I'm trying to add governor by editing these files:




drivers/cpufreq/Kconfig



drivers/cpufreq/Makefile



include/linux/cpufreq.h




Kconfig:



config CPU_FREQ_DEFAULT_GOV_SMARTMAX
bool "smartmax"
select CPU_FREQ_GOV_SMARTMAX
help
Use the CPUFreq governor 'smartmax' as default

config CPU_FREQ_GOV_SMARTMAX
tristate "'smartmax' cpufreq policy governor"
select CPU_FREQ_TABLE
help
'smartmax' combined ondemand and smartass2


Makefile:



obj-$(CONFIG_CPU_FREQ_GOV_SMARTMAX) += cpufreq_smartmax.o


cpufreq.h:



#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTMAX)
extern struct cpufreq_governor cpufreq_gov_smartmax;
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_smartmax)


After that I add the .c file of the governor (which is unmodified and completely original governor code), then add this in default config for my device:



CONFIG_CPU_FREQ_GOV_SMARTMAX=y


Then I go to toolchain folder, open terminal and type this:



export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-android-
export ARCH=arm64 && export SUBARCH=arm64


After this I go to kernel folder and use the following commands:



make clean
make mrproper
make *my_device_config_name*
make -s -j$(nproc --all)


Doing all of this results in the following errors in the governor code:




drivers/cpufreq/cpufreq_smartmax.c: In function 'cpufreq_smartmax_timer':
drivers/cpufreq/cpufreq_smartmax.c:522:3: error: implicit declaration of function '__cpufreq_driver_getavg' [-Werror=implicit-function-declaration]
freq_avg = __cpufreq_driver_getavg(policy, j);



drivers/cpufreq/cpufreq_smartmax.c: In function 'store_debug_mask':
drivers/cpufreq/cpufreq_smartmax.c:607:2: error: implicit declaration of function 'strict_strtoul' [-Werror=implicit-function-declaration]
res = strict_strtoul(buf, 0, &input);











share|improve this question

























  • Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.

    – Sean Pianka
    Nov 15 '18 at 20:48











  • You want to know why the errors happen, but doesn't provide enough details: architecture you use, command line, configuration.. and the error messages themselves. I suggest you to try to compile the kernel without any modification. So you will sure that problem is not in your modifications.

    – Tsyvarev
    Nov 15 '18 at 21:57











  • @Tsyvarev You're right, I forgot to add this information... Edited the question. I already tried to build the source without any modifications, it builds successfully. Adding just small modifications causes errors in the freshly added .c file (if any) or in the currently present source files. I'll add the error message...

    – T. N.
    Nov 15 '18 at 22:38











  • Compilation of file drivers/cpufreq/cpufreq_smartmax.c very depends on content of files drivers/cpufreq/Kconfig and drivers/cpufreq/Makefile which you have modified. Without viewing your modification it is difficult to guess reason of the problem. (Hint: The function __cpufreq_driver_getavg is most likely defined in /drivers/cpufreq/cpufreq.c. Check that given file contains the function and that given file is actually compiled.)

    – Tsyvarev
    Nov 15 '18 at 23:40













  • @Tsyvarev Added what I modified. The function cpufreq_driver_getavg is not defined in cpufreq.c. The file gets compiled.

    – T. N.
    Nov 16 '18 at 12:11














0












0








0


0






Whenever I try to work with kernel source (be it upstream to higher Linux stable version, adding features, etc.), it fails on random source files when compiling.



For example, I tried to upstream kernel version from v3.18.110 to 3.18.125 (with one version at a time, of course). I successfully resolved all conflicts which appeared, but when I start building the kernel, the compiler finds error in file which wasn't even in the conflicting files. Solving the error which appears will introduce more errors, either in the same file or in other file.



Other thing I tried is adding a governor. I successfully added the code where it is needed, added the original governor source file, then enabled it in default config and then started compiling. After this, the compiler found some error in the .c file of the governor. Why?



I'm not asking for error resolution, I want to know why errors happen in the first place.



Architecture is arm64, toolchain is:
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9



Example:
I'm trying to add governor by editing these files:




drivers/cpufreq/Kconfig



drivers/cpufreq/Makefile



include/linux/cpufreq.h




Kconfig:



config CPU_FREQ_DEFAULT_GOV_SMARTMAX
bool "smartmax"
select CPU_FREQ_GOV_SMARTMAX
help
Use the CPUFreq governor 'smartmax' as default

config CPU_FREQ_GOV_SMARTMAX
tristate "'smartmax' cpufreq policy governor"
select CPU_FREQ_TABLE
help
'smartmax' combined ondemand and smartass2


Makefile:



obj-$(CONFIG_CPU_FREQ_GOV_SMARTMAX) += cpufreq_smartmax.o


cpufreq.h:



#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTMAX)
extern struct cpufreq_governor cpufreq_gov_smartmax;
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_smartmax)


After that I add the .c file of the governor (which is unmodified and completely original governor code), then add this in default config for my device:



CONFIG_CPU_FREQ_GOV_SMARTMAX=y


Then I go to toolchain folder, open terminal and type this:



export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-android-
export ARCH=arm64 && export SUBARCH=arm64


After this I go to kernel folder and use the following commands:



make clean
make mrproper
make *my_device_config_name*
make -s -j$(nproc --all)


Doing all of this results in the following errors in the governor code:




drivers/cpufreq/cpufreq_smartmax.c: In function 'cpufreq_smartmax_timer':
drivers/cpufreq/cpufreq_smartmax.c:522:3: error: implicit declaration of function '__cpufreq_driver_getavg' [-Werror=implicit-function-declaration]
freq_avg = __cpufreq_driver_getavg(policy, j);



drivers/cpufreq/cpufreq_smartmax.c: In function 'store_debug_mask':
drivers/cpufreq/cpufreq_smartmax.c:607:2: error: implicit declaration of function 'strict_strtoul' [-Werror=implicit-function-declaration]
res = strict_strtoul(buf, 0, &input);











share|improve this question
















Whenever I try to work with kernel source (be it upstream to higher Linux stable version, adding features, etc.), it fails on random source files when compiling.



For example, I tried to upstream kernel version from v3.18.110 to 3.18.125 (with one version at a time, of course). I successfully resolved all conflicts which appeared, but when I start building the kernel, the compiler finds error in file which wasn't even in the conflicting files. Solving the error which appears will introduce more errors, either in the same file or in other file.



Other thing I tried is adding a governor. I successfully added the code where it is needed, added the original governor source file, then enabled it in default config and then started compiling. After this, the compiler found some error in the .c file of the governor. Why?



I'm not asking for error resolution, I want to know why errors happen in the first place.



Architecture is arm64, toolchain is:
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9



Example:
I'm trying to add governor by editing these files:




drivers/cpufreq/Kconfig



drivers/cpufreq/Makefile



include/linux/cpufreq.h




Kconfig:



config CPU_FREQ_DEFAULT_GOV_SMARTMAX
bool "smartmax"
select CPU_FREQ_GOV_SMARTMAX
help
Use the CPUFreq governor 'smartmax' as default

config CPU_FREQ_GOV_SMARTMAX
tristate "'smartmax' cpufreq policy governor"
select CPU_FREQ_TABLE
help
'smartmax' combined ondemand and smartass2


Makefile:



obj-$(CONFIG_CPU_FREQ_GOV_SMARTMAX) += cpufreq_smartmax.o


cpufreq.h:



#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTMAX)
extern struct cpufreq_governor cpufreq_gov_smartmax;
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_smartmax)


After that I add the .c file of the governor (which is unmodified and completely original governor code), then add this in default config for my device:



CONFIG_CPU_FREQ_GOV_SMARTMAX=y


Then I go to toolchain folder, open terminal and type this:



export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-android-
export ARCH=arm64 && export SUBARCH=arm64


After this I go to kernel folder and use the following commands:



make clean
make mrproper
make *my_device_config_name*
make -s -j$(nproc --all)


Doing all of this results in the following errors in the governor code:




drivers/cpufreq/cpufreq_smartmax.c: In function 'cpufreq_smartmax_timer':
drivers/cpufreq/cpufreq_smartmax.c:522:3: error: implicit declaration of function '__cpufreq_driver_getavg' [-Werror=implicit-function-declaration]
freq_avg = __cpufreq_driver_getavg(policy, j);



drivers/cpufreq/cpufreq_smartmax.c: In function 'store_debug_mask':
drivers/cpufreq/cpufreq_smartmax.c:607:2: error: implicit declaration of function 'strict_strtoul' [-Werror=implicit-function-declaration]
res = strict_strtoul(buf, 0, &input);








android linux git kernel






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 12:12







T. N.

















asked Nov 15 '18 at 20:41









T. N.T. N.

34




34













  • Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.

    – Sean Pianka
    Nov 15 '18 at 20:48











  • You want to know why the errors happen, but doesn't provide enough details: architecture you use, command line, configuration.. and the error messages themselves. I suggest you to try to compile the kernel without any modification. So you will sure that problem is not in your modifications.

    – Tsyvarev
    Nov 15 '18 at 21:57











  • @Tsyvarev You're right, I forgot to add this information... Edited the question. I already tried to build the source without any modifications, it builds successfully. Adding just small modifications causes errors in the freshly added .c file (if any) or in the currently present source files. I'll add the error message...

    – T. N.
    Nov 15 '18 at 22:38











  • Compilation of file drivers/cpufreq/cpufreq_smartmax.c very depends on content of files drivers/cpufreq/Kconfig and drivers/cpufreq/Makefile which you have modified. Without viewing your modification it is difficult to guess reason of the problem. (Hint: The function __cpufreq_driver_getavg is most likely defined in /drivers/cpufreq/cpufreq.c. Check that given file contains the function and that given file is actually compiled.)

    – Tsyvarev
    Nov 15 '18 at 23:40













  • @Tsyvarev Added what I modified. The function cpufreq_driver_getavg is not defined in cpufreq.c. The file gets compiled.

    – T. N.
    Nov 16 '18 at 12:11



















  • Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.

    – Sean Pianka
    Nov 15 '18 at 20:48











  • You want to know why the errors happen, but doesn't provide enough details: architecture you use, command line, configuration.. and the error messages themselves. I suggest you to try to compile the kernel without any modification. So you will sure that problem is not in your modifications.

    – Tsyvarev
    Nov 15 '18 at 21:57











  • @Tsyvarev You're right, I forgot to add this information... Edited the question. I already tried to build the source without any modifications, it builds successfully. Adding just small modifications causes errors in the freshly added .c file (if any) or in the currently present source files. I'll add the error message...

    – T. N.
    Nov 15 '18 at 22:38











  • Compilation of file drivers/cpufreq/cpufreq_smartmax.c very depends on content of files drivers/cpufreq/Kconfig and drivers/cpufreq/Makefile which you have modified. Without viewing your modification it is difficult to guess reason of the problem. (Hint: The function __cpufreq_driver_getavg is most likely defined in /drivers/cpufreq/cpufreq.c. Check that given file contains the function and that given file is actually compiled.)

    – Tsyvarev
    Nov 15 '18 at 23:40













  • @Tsyvarev Added what I modified. The function cpufreq_driver_getavg is not defined in cpufreq.c. The file gets compiled.

    – T. N.
    Nov 16 '18 at 12:11

















Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.

– Sean Pianka
Nov 15 '18 at 20:48





Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.

– Sean Pianka
Nov 15 '18 at 20:48













You want to know why the errors happen, but doesn't provide enough details: architecture you use, command line, configuration.. and the error messages themselves. I suggest you to try to compile the kernel without any modification. So you will sure that problem is not in your modifications.

– Tsyvarev
Nov 15 '18 at 21:57





You want to know why the errors happen, but doesn't provide enough details: architecture you use, command line, configuration.. and the error messages themselves. I suggest you to try to compile the kernel without any modification. So you will sure that problem is not in your modifications.

– Tsyvarev
Nov 15 '18 at 21:57













@Tsyvarev You're right, I forgot to add this information... Edited the question. I already tried to build the source without any modifications, it builds successfully. Adding just small modifications causes errors in the freshly added .c file (if any) or in the currently present source files. I'll add the error message...

– T. N.
Nov 15 '18 at 22:38





@Tsyvarev You're right, I forgot to add this information... Edited the question. I already tried to build the source without any modifications, it builds successfully. Adding just small modifications causes errors in the freshly added .c file (if any) or in the currently present source files. I'll add the error message...

– T. N.
Nov 15 '18 at 22:38













Compilation of file drivers/cpufreq/cpufreq_smartmax.c very depends on content of files drivers/cpufreq/Kconfig and drivers/cpufreq/Makefile which you have modified. Without viewing your modification it is difficult to guess reason of the problem. (Hint: The function __cpufreq_driver_getavg is most likely defined in /drivers/cpufreq/cpufreq.c. Check that given file contains the function and that given file is actually compiled.)

– Tsyvarev
Nov 15 '18 at 23:40







Compilation of file drivers/cpufreq/cpufreq_smartmax.c very depends on content of files drivers/cpufreq/Kconfig and drivers/cpufreq/Makefile which you have modified. Without viewing your modification it is difficult to guess reason of the problem. (Hint: The function __cpufreq_driver_getavg is most likely defined in /drivers/cpufreq/cpufreq.c. Check that given file contains the function and that given file is actually compiled.)

– Tsyvarev
Nov 15 '18 at 23:40















@Tsyvarev Added what I modified. The function cpufreq_driver_getavg is not defined in cpufreq.c. The file gets compiled.

– T. N.
Nov 16 '18 at 12:11





@Tsyvarev Added what I modified. The function cpufreq_driver_getavg is not defined in cpufreq.c. The file gets compiled.

– T. N.
Nov 16 '18 at 12:11












1 Answer
1






active

oldest

votes


















0














The smartmax cpufreq governor was designed for older Linux kernels (likely pre-3.4). Hence, it still references several outdated kernel APIs and functions. Since these APIs are no longer in Linux 3.18, compilation errors occur.






drivers/cpufreq/cpufreq_smartmax.c: In function 'cpufreq_smartmax_timer': drivers/cpufreq/cpufreq_smartmax.c:522:3: error: implicit declaration of function '__cpufreq_driver_getavg' [-Werror=implicit-function-declaration] freq_avg = __cpufreq_driver_getavg(policy, j);




Specifically, this error is caused by the governor utilizing the __cpufreq_driver_getavg() function, which is no longer present in Linux 3.18. In fact, the function was removed in Linux 3.12, 5 years ago in 2013. To fix the compilation error, you could revert that commit and resolve any Git conflicts. However, there may still be other issues (compatibility, compilation, etc.) along the way.




drivers/cpufreq/cpufreq_smartmax.c: In function 'store_debug_mask': drivers/cpufreq/cpufreq_smartmax.c:607:2: error: implicit declaration of function 'strict_strtoul' [-Werror=implicit-function-declaration] res = strict_strtoul(buf, 0, &input);




Similarly, strict_strtoul() is another function that is no longer in Linux 3.18, but is still utilized by the smartmax governor. Thankfully, this issue is trivial to fix. You can simply replace any uses of strict_strtoul with kstrtoul, which serves pretty much the same purpose.





I am fairly certain that there are other outdated or removed kernel APIs and functions that the smartmax governor depends on. You could attempt to update the governor for Linux 3.18, but it may not be worth the time and effort.






share|improve this answer


























  • Wow, didn't even think of this... Well, that's useful to know. Thank you. So, probably the only thing which I'm wondering now, is why when I upgrade the kernel version from 3.18.120 to 3.18.125 it gives some error which I don't know how to fix, will you help me if I share it?

    – T. N.
    Nov 16 '18 at 13:30











  • I'll see what I can help you with if you share it.

    – zwliew
    Nov 16 '18 at 13:57











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53327594%2fkernel-compiling-errors-with-every-modification%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














The smartmax cpufreq governor was designed for older Linux kernels (likely pre-3.4). Hence, it still references several outdated kernel APIs and functions. Since these APIs are no longer in Linux 3.18, compilation errors occur.






drivers/cpufreq/cpufreq_smartmax.c: In function 'cpufreq_smartmax_timer': drivers/cpufreq/cpufreq_smartmax.c:522:3: error: implicit declaration of function '__cpufreq_driver_getavg' [-Werror=implicit-function-declaration] freq_avg = __cpufreq_driver_getavg(policy, j);




Specifically, this error is caused by the governor utilizing the __cpufreq_driver_getavg() function, which is no longer present in Linux 3.18. In fact, the function was removed in Linux 3.12, 5 years ago in 2013. To fix the compilation error, you could revert that commit and resolve any Git conflicts. However, there may still be other issues (compatibility, compilation, etc.) along the way.




drivers/cpufreq/cpufreq_smartmax.c: In function 'store_debug_mask': drivers/cpufreq/cpufreq_smartmax.c:607:2: error: implicit declaration of function 'strict_strtoul' [-Werror=implicit-function-declaration] res = strict_strtoul(buf, 0, &input);




Similarly, strict_strtoul() is another function that is no longer in Linux 3.18, but is still utilized by the smartmax governor. Thankfully, this issue is trivial to fix. You can simply replace any uses of strict_strtoul with kstrtoul, which serves pretty much the same purpose.





I am fairly certain that there are other outdated or removed kernel APIs and functions that the smartmax governor depends on. You could attempt to update the governor for Linux 3.18, but it may not be worth the time and effort.






share|improve this answer


























  • Wow, didn't even think of this... Well, that's useful to know. Thank you. So, probably the only thing which I'm wondering now, is why when I upgrade the kernel version from 3.18.120 to 3.18.125 it gives some error which I don't know how to fix, will you help me if I share it?

    – T. N.
    Nov 16 '18 at 13:30











  • I'll see what I can help you with if you share it.

    – zwliew
    Nov 16 '18 at 13:57
















0














The smartmax cpufreq governor was designed for older Linux kernels (likely pre-3.4). Hence, it still references several outdated kernel APIs and functions. Since these APIs are no longer in Linux 3.18, compilation errors occur.






drivers/cpufreq/cpufreq_smartmax.c: In function 'cpufreq_smartmax_timer': drivers/cpufreq/cpufreq_smartmax.c:522:3: error: implicit declaration of function '__cpufreq_driver_getavg' [-Werror=implicit-function-declaration] freq_avg = __cpufreq_driver_getavg(policy, j);




Specifically, this error is caused by the governor utilizing the __cpufreq_driver_getavg() function, which is no longer present in Linux 3.18. In fact, the function was removed in Linux 3.12, 5 years ago in 2013. To fix the compilation error, you could revert that commit and resolve any Git conflicts. However, there may still be other issues (compatibility, compilation, etc.) along the way.




drivers/cpufreq/cpufreq_smartmax.c: In function 'store_debug_mask': drivers/cpufreq/cpufreq_smartmax.c:607:2: error: implicit declaration of function 'strict_strtoul' [-Werror=implicit-function-declaration] res = strict_strtoul(buf, 0, &input);




Similarly, strict_strtoul() is another function that is no longer in Linux 3.18, but is still utilized by the smartmax governor. Thankfully, this issue is trivial to fix. You can simply replace any uses of strict_strtoul with kstrtoul, which serves pretty much the same purpose.





I am fairly certain that there are other outdated or removed kernel APIs and functions that the smartmax governor depends on. You could attempt to update the governor for Linux 3.18, but it may not be worth the time and effort.






share|improve this answer


























  • Wow, didn't even think of this... Well, that's useful to know. Thank you. So, probably the only thing which I'm wondering now, is why when I upgrade the kernel version from 3.18.120 to 3.18.125 it gives some error which I don't know how to fix, will you help me if I share it?

    – T. N.
    Nov 16 '18 at 13:30











  • I'll see what I can help you with if you share it.

    – zwliew
    Nov 16 '18 at 13:57














0












0








0







The smartmax cpufreq governor was designed for older Linux kernels (likely pre-3.4). Hence, it still references several outdated kernel APIs and functions. Since these APIs are no longer in Linux 3.18, compilation errors occur.






drivers/cpufreq/cpufreq_smartmax.c: In function 'cpufreq_smartmax_timer': drivers/cpufreq/cpufreq_smartmax.c:522:3: error: implicit declaration of function '__cpufreq_driver_getavg' [-Werror=implicit-function-declaration] freq_avg = __cpufreq_driver_getavg(policy, j);




Specifically, this error is caused by the governor utilizing the __cpufreq_driver_getavg() function, which is no longer present in Linux 3.18. In fact, the function was removed in Linux 3.12, 5 years ago in 2013. To fix the compilation error, you could revert that commit and resolve any Git conflicts. However, there may still be other issues (compatibility, compilation, etc.) along the way.




drivers/cpufreq/cpufreq_smartmax.c: In function 'store_debug_mask': drivers/cpufreq/cpufreq_smartmax.c:607:2: error: implicit declaration of function 'strict_strtoul' [-Werror=implicit-function-declaration] res = strict_strtoul(buf, 0, &input);




Similarly, strict_strtoul() is another function that is no longer in Linux 3.18, but is still utilized by the smartmax governor. Thankfully, this issue is trivial to fix. You can simply replace any uses of strict_strtoul with kstrtoul, which serves pretty much the same purpose.





I am fairly certain that there are other outdated or removed kernel APIs and functions that the smartmax governor depends on. You could attempt to update the governor for Linux 3.18, but it may not be worth the time and effort.






share|improve this answer















The smartmax cpufreq governor was designed for older Linux kernels (likely pre-3.4). Hence, it still references several outdated kernel APIs and functions. Since these APIs are no longer in Linux 3.18, compilation errors occur.






drivers/cpufreq/cpufreq_smartmax.c: In function 'cpufreq_smartmax_timer': drivers/cpufreq/cpufreq_smartmax.c:522:3: error: implicit declaration of function '__cpufreq_driver_getavg' [-Werror=implicit-function-declaration] freq_avg = __cpufreq_driver_getavg(policy, j);




Specifically, this error is caused by the governor utilizing the __cpufreq_driver_getavg() function, which is no longer present in Linux 3.18. In fact, the function was removed in Linux 3.12, 5 years ago in 2013. To fix the compilation error, you could revert that commit and resolve any Git conflicts. However, there may still be other issues (compatibility, compilation, etc.) along the way.




drivers/cpufreq/cpufreq_smartmax.c: In function 'store_debug_mask': drivers/cpufreq/cpufreq_smartmax.c:607:2: error: implicit declaration of function 'strict_strtoul' [-Werror=implicit-function-declaration] res = strict_strtoul(buf, 0, &input);




Similarly, strict_strtoul() is another function that is no longer in Linux 3.18, but is still utilized by the smartmax governor. Thankfully, this issue is trivial to fix. You can simply replace any uses of strict_strtoul with kstrtoul, which serves pretty much the same purpose.





I am fairly certain that there are other outdated or removed kernel APIs and functions that the smartmax governor depends on. You could attempt to update the governor for Linux 3.18, but it may not be worth the time and effort.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 16 '18 at 13:27

























answered Nov 16 '18 at 12:49









zwliewzwliew

3423




3423













  • Wow, didn't even think of this... Well, that's useful to know. Thank you. So, probably the only thing which I'm wondering now, is why when I upgrade the kernel version from 3.18.120 to 3.18.125 it gives some error which I don't know how to fix, will you help me if I share it?

    – T. N.
    Nov 16 '18 at 13:30











  • I'll see what I can help you with if you share it.

    – zwliew
    Nov 16 '18 at 13:57



















  • Wow, didn't even think of this... Well, that's useful to know. Thank you. So, probably the only thing which I'm wondering now, is why when I upgrade the kernel version from 3.18.120 to 3.18.125 it gives some error which I don't know how to fix, will you help me if I share it?

    – T. N.
    Nov 16 '18 at 13:30











  • I'll see what I can help you with if you share it.

    – zwliew
    Nov 16 '18 at 13:57

















Wow, didn't even think of this... Well, that's useful to know. Thank you. So, probably the only thing which I'm wondering now, is why when I upgrade the kernel version from 3.18.120 to 3.18.125 it gives some error which I don't know how to fix, will you help me if I share it?

– T. N.
Nov 16 '18 at 13:30





Wow, didn't even think of this... Well, that's useful to know. Thank you. So, probably the only thing which I'm wondering now, is why when I upgrade the kernel version from 3.18.120 to 3.18.125 it gives some error which I don't know how to fix, will you help me if I share it?

– T. N.
Nov 16 '18 at 13:30













I'll see what I can help you with if you share it.

– zwliew
Nov 16 '18 at 13:57





I'll see what I can help you with if you share it.

– zwliew
Nov 16 '18 at 13:57




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53327594%2fkernel-compiling-errors-with-every-modification%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine