changeset 21553:f80b46f7d3d8

Force linking in libgomp if OpenMP enabled (bug #41699, bug #47372). * configure.ac: If OpenMP is enabled then force gcc to link in libgomp.
author Rik <rik@octave.org>
date Mon, 28 Mar 2016 17:16:37 -0700
parents 102b33b53ea4
children 8014bba57c2b
files configure.ac
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Mon Mar 28 20:00:37 2016 +1100
+++ b/configure.ac	Mon Mar 28 17:16:37 2016 -0700
@@ -511,6 +511,9 @@
 dnl AX_OPENMP is not empty.
 if test $ENABLE_OPENMP = yes; then
   AC_DEFINE(OCTAVE_ENABLE_OPENMP, 1, [Define if OpenMP is enabled.])
+  if test "$GCC" = yes; then
+    WARN_LDFLAGS="$WARN_LDFLAGS -Wl,--no-as-needed,-lgomp,--as-needed";
+  fi
 fi
 ## Set these for any other tests that may require them.  They will be
 ## reset before output files are generated.