Skip to content

Commit 7c2c11b

Browse files
sudipm-mukherjeetorvalds
authored andcommitted
arch: define weak abort()
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 lib/mpi/mpih-div.c. Currently 'frv' and 'arc' are failing. Previously other arch was also broken like m32r was fixed by commit d22e3d6 ("m32r: fix build failure"). 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. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Sudip Mukherjee <[email protected]> Cc: Alexey Brodkin <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Sudip Mukherjee <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4837fe3 commit 7c2c11b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

kernel/exit.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,3 +1755,11 @@ COMPAT_SYSCALL_DEFINE5(waitid,
17551755
return -EFAULT;
17561756
}
17571757
#endif
1758+
1759+
__weak void abort(void)
1760+
{
1761+
BUG();
1762+
1763+
/* if that doesn't kill us, halt */
1764+
panic("Oops failed to kill thread");
1765+
}

0 commit comments

Comments
 (0)