mirror of https://github.com/OpenIPC/firmware.git
29 lines
1.0 KiB
Diff
29 lines
1.0 KiB
Diff
diff -drupN a/include/linux/init.h b/include/linux/init.h
|
|
--- a/include/linux/init.h 2018-08-06 17:23:04.000000000 +0300
|
|
+++ b/include/linux/init.h 2022-06-12 05:28:14.000000000 +0300
|
|
@@ -150,6 +150,15 @@ extern bool initcall_debug;
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
+#ifdef CONFIG_LTO_CLANG
|
|
+ /* prepend the variable name with __COUNTER__ to ensure correct ordering */
|
|
+ #define ___initcall_name2(c, fn, id) __initcall_##c##_##fn##id
|
|
+ #define ___initcall_name1(c, fn, id) ___initcall_name2(c, fn, id)
|
|
+ #define __initcall_name(fn, id) ___initcall_name1(__COUNTER__, fn, id)
|
|
+#else
|
|
+ #define __initcall_name(fn, id) __initcall_##fn##id
|
|
+#endif
|
|
+
|
|
/*
|
|
* initcalls are now grouped by functionality into separate
|
|
* subsections. Ordering inside the subsections is determined
|
|
@@ -167,7 +176,7 @@ extern bool initcall_debug;
|
|
*/
|
|
|
|
#define __define_initcall(fn, id) \
|
|
- static initcall_t __initcall_##fn##id __used \
|
|
+ static initcall_t __initcall_name(fn, id) __used \
|
|
__attribute__((__section__(".initcall" #id ".init"))) = fn;
|
|
|
|
/*
|