[lkml]   [2018]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.14 20/22] arch: define weak abort()
4.14-stable review patch.  If anyone has any objections, please let me know.


From: Sudip Mukherjee <>

commit 7c2c11b208be09c156573fc0076b7b3646e05219 upstream.

gcc toggle -fisolate-erroneous-paths-dereference (default at -O2
onwards) isolates faulty code paths such as null pointer access, divide
by zero etc. If gcc port doesnt implement __builtin_trap, an abort() is
generated which causes kernel link error.

In this case, gcc is generating abort due to 'divide by zero' in

Currently 'frv' and 'arc' are failing. Previously other arch was also
broken like m32r was fixed by commit d22e3d69ee1a ("m32r: fix build

Let's define this weak function which is common for all arch and fix the
problem permanently. We can even remove the arch specific 'abort' after
this is done.

Signed-off-by: Sudip Mukherjee <>
Cc: Alexey Brodkin <>
Cc: Vineet Gupta <>
Cc: Sudip Mukherjee <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
Cc: Evgeniy Didin <>
Signed-off-by: Greg Kroah-Hartman <>

kernel/exit.c | 8 ++++++++
1 file changed, 8 insertions(+)

--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1755,3 +1755,11 @@ Efault:
return -EFAULT;
+__weak void abort(void)
+ BUG();
+ /* if that doesn't kill us, halt */
+ panic("Oops failed to kill thread");

 \ /
  Last update: 2018-02-09 14:56    [W:0.131 / U:0.308 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site