summaryrefslogtreecommitdiff
path: root/libgfortran/runtime/compile_options.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/runtime/compile_options.c')
-rw-r--r--libgfortran/runtime/compile_options.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libgfortran/runtime/compile_options.c b/libgfortran/runtime/compile_options.c
index dc0da4bcb90..c3e64de33ba 100644
--- a/libgfortran/runtime/compile_options.c
+++ b/libgfortran/runtime/compile_options.c
@@ -58,6 +58,15 @@ backtrace_handler (int signum)
}
+/* Helper function for set_options because we need to access the
+ global variable options which is not seen in set_options. */
+static void
+maybe_find_addr2line (void)
+{
+ if (options.backtrace == -1)
+ find_addr2line ();
+}
+
/* Set the usual compile-time options. */
extern void set_options (int , int []);
export_proto(set_options);
@@ -131,6 +140,8 @@ set_options (int num, int options[])
#if defined(SIGXFSZ)
signal (SIGXFSZ, backtrace_handler);
#endif
+
+ maybe_find_addr2line ();
}
#endif