arm64: LLVMLinux: Add missing abort() for AARCH64
PATCH 1/1 arm64: LLVMLinux: Add missing abort() for AARCH64
From: Mark Charlebois <[email protected]>
Add missing abort for arch aarch64.
This patch makes the aarch64 kernel able to compile with gcc or clang.
--- arch/arm64/kernel/traps.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm64/kernel/traps.c +9 -0
@@ -349,6 +349,15 @@ void __pgd_error(const char *file, int line, unsigned long val)pr_crit ("%s:%d: bad pgd %016lx.\n" , file, line, val); } +void abort (void ) +{ +BUG (); + +/* if that doesn't kill us, halt */ +panic ("Oops failed to kill thread" ); +} +EXPORT_SYMBOL (abort); +void __init trap_init (void ) {return ;
Signature · 1 line
1.9.1
Quoted 8 lines · On Friday 05 September 2014 16:21:42 behanw at converseincode.com wrote:
From: Mark Charlebois <[email protected]>
Add missing abort for arch aarch64.
This patch makes the aarch64 kernel able to compile with gcc or clang.
Signed-off-by Mark Charlebois <[email protected]>Signed-off-by Behan Webster <[email protected]>
You don't describe why this is needed. When does clang emit an abort() call? Is that the expected behavior when not linking against a full C library?
Quoted 9 lines
arch/arm64/kernel/traps.c | 9 +++++++++ 1 file changed, 9 insertions(+)arch/arm64/kernel/traps.c +0
-0@@ -349,6 +349,15 @@ void __pgd_error(const char *file, int line, unsigned long val)pr_crit ("%s:%d: bad pgd %016lx.\n" , file, line, val);
arch/arm64/kernel/traps.c void __pgd_error(const char *file, int line, unsigned long val) · line 359
Quoted 10 lines
arch/arm64/kernel/traps.c +8
-0} +void abort (void ) +{ +BUG (); + +/* if that doesn't kill us, halt */ +panic ("Oops failed to kill thread" ); +} +EXPORT_SYMBOL (abort);
I don't see the point in doing both BUG() and panic(). Doesn't panic() already print all the information you want in this case?
Arnd
Quoted 5 lines · Arnd Bergmann
Quoted 4 lines · On Friday 05 September 2014 16:21:42 behanw at converseincode.com wrote:
From: Mark Charlebois <[email protected]>
Add missing abort for arch aarch64.
Quoted 8 lines
Quoted 4 lines
This patch makes the aarch64 kernel able to compile with gcc or clang.
Signed-off-by Mark Charlebois <[email protected]>Signed-off-by Behan Webster <[email protected]>You don't describe why this is needed. When does clang emit an
abort()call? Is that the expected behavior when not linking against a full C library?
I just tried recompiling for vexpress64 without the abort call and it seems the patch is no longer needed. When I added this I mimicked the behavior of abort for arm which at the time was defined in the kernel code.
Sorry for the churn.
-Mark
Quoted 25 lines
Quoted 10 lines
arch/arm64/kernel/traps.c | 9 +++++++++ 1 file changed, 9 insertions(+)arch/arm64/kernel/traps.c +0
-0@@ -349,6 +349,15 @@ void __pgd_error(const char *file, int line, unsigned long val)pr_crit ("%s:%d: bad pgd %016lx.\n" , file, line, val);arch/arm64/kernel/traps.c void __pgd_error(const char *file, int line, unsigned long val) · line 359
Quoted 10 lines
arch/arm64/kernel/traps.c +8
-0} +void abort (void ) +{ +BUG (); + +/* if that doesn't kill us, halt */ +panic ("Oops failed to kill thread" ); +} +EXPORT_SYMBOL (abort);I don't see the point in doing both
BUG()andpanic(). Doesn'tpanic()already print all the information you want in this case?Arnd