From fb5e332483a6f180bfbfe8bac33edf1b7b386b1a Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Mon, 4 Oct 2010 23:34:06 +0200 Subject: error_handler: add no_native compiler directive As suggested by Mikael Pettersson: "I agree there _may_ be a recursion between the native-traps-to-beam mechanism and the error_handler module. However, the real problem is that the chosen mechanism (point to target MFA's BEAM code) isn't flexible enough to handle newer features like on_load or (apparently) a native-mode error_handler. My planned fix is to make remote calls link to the target's Export* instead, just like BEAM does, which should solve the problems. This will however require HiPE to use different kinds of trap-to-beam stubs for remote and local calls, since local calls must not and often cannot go via Export entries. A simpler workaround for the error_handler issue (which I couldn't reproduce) is to just never compile error_handler to native code. It's not like there's a lot to gain by doing that. Please try the patch below." Patch has been tested and confirmed to make --enable-native-libs useable. Signed-off-by: Mikael Pettersson Acked-by: Tuncer Ayaz --- lib/kernel/src/error_handler.erl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/kernel/src/error_handler.erl b/lib/kernel/src/error_handler.erl index 17dd02acd4..885eeb2b0f 100644 --- a/lib/kernel/src/error_handler.erl +++ b/lib/kernel/src/error_handler.erl @@ -17,6 +17,11 @@ %% %CopyrightEnd% %% -module(error_handler). +%% FIXME: remove no_native directive after HiPE has been changed to make +%% remote calls link to the target's Export* like BEAM does. +%% For a detailed explanation see the commit titled +%% "error_handler: add no_native compiler directive" +-compile(no_native). %% A simple error handler. -- cgit v1.2.3