Revert "ANDROID: init: ensure initcall ordering with LTO"
This reverts commit 6c5ad8b10e
as the LTO
feature causes merge issues with 5.8-rc1. So remove it for now and
allow the developer to add the latest version of the patches later on.
Cc: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I0b67a8a0d4b54c5be30f0bfc5abdd1422b7ab2f1
This commit is contained in:
@@ -192,32 +192,10 @@ extern bool initcall_debug;
|
||||
".long " #fn " - . \n" \
|
||||
".previous \n");
|
||||
#else
|
||||
#ifdef CONFIG_LTO_CLANG
|
||||
/*
|
||||
* With LTO, the compiler doesn't necessarily obey link order for
|
||||
* initcalls, and the initcall variable needs to be globally unique
|
||||
* to avoid naming collisions. In order to preserve the correct
|
||||
* order, we add each variable into its own section and generate a
|
||||
* linker script (in scripts/link-vmlinux.sh) to ensure the order
|
||||
* remains correct. We also add a __COUNTER__ prefix to the name,
|
||||
* so we can retain the order of initcalls within each compilation
|
||||
* unit, and __LINE__ to make the names more unique.
|
||||
*/
|
||||
#define ___lto_initcall(c, l, fn, id, __sec) \
|
||||
static initcall_t __initcall_##c##_##l##_##fn##id __used \
|
||||
__attribute__((__section__( #__sec \
|
||||
__stringify(.init..##c##_##l##_##fn)))) = fn;
|
||||
#define __lto_initcall(c, l, fn, id, __sec) \
|
||||
___lto_initcall(c, l, fn, id, __sec)
|
||||
|
||||
#define ___define_initcall(fn, id, __sec) \
|
||||
__lto_initcall(__COUNTER__, __LINE__, fn, id, __sec)
|
||||
#else
|
||||
#define ___define_initcall(fn, id, __sec) \
|
||||
#define ___define_initcall(fn, id, __sec) \
|
||||
static initcall_t __initcall_##fn##id __used \
|
||||
__attribute__((__section__(#__sec ".init"))) = fn;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define __define_initcall(fn, id) ___define_initcall(fn, id, .initcall##id)
|
||||
|
||||
@@ -258,7 +236,7 @@ extern bool initcall_debug;
|
||||
#define __exitcall(fn) \
|
||||
static exitcall_t __exitcall_##fn __exit_call = fn
|
||||
|
||||
#define console_initcall(fn) ___define_initcall(fn, con, .con_initcall)
|
||||
#define console_initcall(fn) ___define_initcall(fn,, .con_initcall)
|
||||
|
||||
struct obs_kernel_param {
|
||||
const char *str;
|
||||
|
Reference in New Issue
Block a user