summaryrefslogtreecommitdiff
path: root/libgfortran/runtime/error.c
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-04 08:44:29 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-04 08:44:29 +0000
commit76875ccba880127fc80d845c9926c298a4f49446 (patch)
tree2baeb30ac5f592018a46140e8a34f178598a67b6 /libgfortran/runtime/error.c
parent5f1220947c1397909f7faa88331c7875c6e03810 (diff)
downloadgcc-76875ccba880127fc80d845c9926c298a4f49446.tar.gz
PR libfortran/22298
* runtime/main.c (stupid_function_name_for_static_linking): New function. * runtime/error.c (internal_error): Call stupid_function_name_for_static_linking. * libgfortran.h: Add prototype for stupid_function_name_for_static_linking. * gcc/testsuite/lib/target-supports.exp (check_effective_target_static_libgfortran): New static_libgfortran effective target. * gcc/testsuite/gfortran.dg/static_linking_1.f: New test. * gcc/testsuite/gfortran.dg/static_linking_1.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106484 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime/error.c')
-rw-r--r--libgfortran/runtime/error.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c
index cdaa54255c2..64a062ab330 100644
--- a/libgfortran/runtime/error.c
+++ b/libgfortran/runtime/error.c
@@ -353,6 +353,13 @@ internal_error (const char *message)
recursion_check ();
show_locus ();
st_printf ("Internal Error: %s\n", message);
+
+ /* This function call is here to get the main.o object file included
+ when linking statically. This works because error.o is supposed to
+ be always linked in (and the function call is in internal_error
+ because hopefully it doesn't happen too often). */
+ stupid_function_name_for_static_linking();
+
sys_exit (3);
}