summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2010-07-02 10:12:34 +0000
committerRainer Orth <ro@gcc.gnu.org>2010-07-02 10:12:34 +0000
commit49ea7a0ef9fec0eecb2eb9ed60bfdc5630f23ad8 (patch)
tree2485a81d15975a9f6f3bcd7cea6ddd05d1c6d03f /libgfortran
parentc18dc5cceab24096cbb83deacabb75b77d57a9df (diff)
downloadgcc-49ea7a0ef9fec0eecb2eb9ed60bfdc5630f23ad8.tar.gz
configure.ac: Check for Sun symbol versioning.
* configure.ac: Check for Sun symbol versioning. * configure: Regenerate. * Makefile.am [LIBGFOR_USE_SYMVER]: Protect version_arg with LIBGFOR_USE_SYMVER_GNU. Add version_dep. [LIBGFOR_USE_SYMVER_SUN]: Handle Sun symbol versioning. [!LIBGFOR_USE_SYMVER]: Add version_dep. (libgfortran_la_DEPENDENCIES): Set to $(version_dep). * Makefile.in: Regenerate. From-SVN: r161697
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog13
-rw-r--r--libgfortran/Makefile.am18
-rw-r--r--libgfortran/Makefile.in16
-rwxr-xr-xlibgfortran/configure71
-rw-r--r--libgfortran/configure.ac21
5 files changed, 128 insertions, 11 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 0e5eb36da5f..4e4120f94fb 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,16 @@
+2010-07-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac: Check for Sun symbol versioning.
+ * configure: Regenerate.
+
+ * Makefile.am [LIBGFOR_USE_SYMVER]: Protect version_arg with
+ LIBGFOR_USE_SYMVER_GNU.
+ Add version_dep.
+ [LIBGFOR_USE_SYMVER_SUN]: Handle Sun symbol versioning.
+ [!LIBGFOR_USE_SYMVER]: Add version_dep.
+ (libgfortran_la_DEPENDENCIES): Set to $(version_dep).
+ * Makefile.in: Regenerate.
+
2010-06-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/43298
diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
index bd767a2e679..9940caf57ba 100644
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -8,9 +8,26 @@ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
## Symbol versioning (copied from libssp).
if LIBGFOR_USE_SYMVER
+if LIBGFOR_USE_SYMVER_GNU
version_arg = -Wl,--version-script=$(srcdir)/gfortran.map
+version_dep = $(srcdir)/gfortran.map
+endif
+if LIBGFOR_USE_SYMVER_SUN
+version_arg = -Wl,-M,gfortran.map-sun
+version_dep = gfortran.map-sun
+gfortran.map-sun : $(srcdir)/gfortran.map \
+ $(top_srcdir)/../contrib/make_sunver.pl \
+ $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
+ perl $(top_srcdir)/../contrib/make_sunver.pl \
+ $(srcdir)/gfortran.map \
+ $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+ `echo $(libgfortran_la_LIBADD) | \
+ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+ > $@ || (rm -f $@ ; exit 1)
+endif
else
version_arg =
+version_dep =
endif
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
@@ -19,6 +36,7 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
toolexeclib_LTLIBRARIES = libgfortran.la
libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) -lm $(extra_ldflags_libgfortran) $(version_arg)
+libgfortran_la_DEPENDENCIES = $(version_dep)
myexeclib_LTLIBRARIES = libgfortranbegin.la
myexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
index 9c39ea25d2a..880d00de167 100644
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -453,13 +453,18 @@ top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I .. -I ../config
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
@LIBGFOR_USE_SYMVER_FALSE@version_arg =
-@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/gfortran.map
+@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/gfortran.map
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,-M,gfortran.map-sun
+@LIBGFOR_USE_SYMVER_FALSE@version_dep =
+@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = $(srcdir)/gfortran.map
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = gfortran.map-sun
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
-no-undefined -bindir "$(bindir)"
toolexeclib_LTLIBRARIES = libgfortran.la
libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) -lm $(extra_ldflags_libgfortran) $(version_arg)
+libgfortran_la_DEPENDENCIES = $(version_dep)
myexeclib_LTLIBRARIES = libgfortranbegin.la
myexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
libgfortranbegin_la_SOURCES = fmain.c
@@ -5472,6 +5477,15 @@ uninstall-am: uninstall-myexeclibLTLIBRARIES \
uninstall-myexeclibLTLIBRARIES \
uninstall-toolexeclibLTLIBRARIES
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@gfortran.map-sun : $(srcdir)/gfortran.map \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ perl $(top_srcdir)/../contrib/make_sunver.pl \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(srcdir)/gfortran.map \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ `echo $(libgfortran_la_LIBADD) | \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ > $@ || (rm -f $@ ; exit 1)
# Turn on vectorization and loop unrolling for matmul.
$(patsubst %.c,%.lo,$(notdir $(i_matmul_c))): AM_CFLAGS += -ftree-vectorize -funroll-loops
diff --git a/libgfortran/configure b/libgfortran/configure
index 002bc497ca0..b1a98f81992 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -630,6 +630,10 @@ RANLIB
AR
AS
SECTION_FLAGS
+LIBGFOR_USE_SYMVER_SUN_FALSE
+LIBGFOR_USE_SYMVER_SUN_TRUE
+LIBGFOR_USE_SYMVER_GNU_FALSE
+LIBGFOR_USE_SYMVER_GNU_TRUE
LIBGFOR_USE_SYMVER_FALSE
LIBGFOR_USE_SYMVER_TRUE
AM_CFLAGS
@@ -4414,13 +4418,13 @@ fi
# Check for symbol versioning (copied from libssp).
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symbol versioning is supported" >&5
$as_echo_n "checking whether symbol versioning is supported... " >&6; }
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
cat > conftest.map <<EOF
FOO_1.0 {
global: *foo*; bar; local: *;
};
EOF
-save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
if test x$gcc_no_link = xyes; then
as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
@@ -4437,16 +4441,47 @@ main ()
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- gfortran_use_symver=yes
+ gfortran_use_symver=gnu
+else
+ gfortran_use_symver=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test x$gfortran_use_symver = xno; then
+ LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+ # Sun ld cannot handle wildcards and treats all entries as undefined.
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: foo; local: *;
+};
+EOF
+ if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gfortran_use_symver=sun
else
gfortran_use_symver=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+fi
LDFLAGS="$save_LDFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gfortran_use_symver" >&5
$as_echo "$gfortran_use_symver" >&6; }
- if test "x$gfortran_use_symver" = xyes; then
+ if test "x$gfortran_use_symver" != xno; then
LIBGFOR_USE_SYMVER_TRUE=
LIBGFOR_USE_SYMVER_FALSE='#'
else
@@ -4454,6 +4489,22 @@ else
LIBGFOR_USE_SYMVER_FALSE=
fi
+ if test "x$gfortran_use_symver" = xgnu; then
+ LIBGFOR_USE_SYMVER_GNU_TRUE=
+ LIBGFOR_USE_SYMVER_GNU_FALSE='#'
+else
+ LIBGFOR_USE_SYMVER_GNU_TRUE='#'
+ LIBGFOR_USE_SYMVER_GNU_FALSE=
+fi
+
+ if test "x$gfortran_use_symver" = xsun; then
+ LIBGFOR_USE_SYMVER_SUN_TRUE=
+ LIBGFOR_USE_SYMVER_SUN_FALSE='#'
+else
+ LIBGFOR_USE_SYMVER_SUN_TRUE='#'
+ LIBGFOR_USE_SYMVER_SUN_FALSE=
+fi
+
# Figure out whether the compiler supports "-ffunction-sections -fdata-sections",
# similarly to how libstdc++ does it
@@ -11307,7 +11358,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11310 "configure"
+#line 11361 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11413,7 +11464,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11416 "configure"
+#line 11467 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -25091,6 +25142,14 @@ if test -z "${LIBGFOR_USE_SYMVER_TRUE}" && test -z "${LIBGFOR_USE_SYMVER_FALSE}"
as_fn_error "conditional \"LIBGFOR_USE_SYMVER\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${LIBGFOR_USE_SYMVER_GNU_TRUE}" && test -z "${LIBGFOR_USE_SYMVER_GNU_FALSE}"; then
+ as_fn_error "conditional \"LIBGFOR_USE_SYMVER_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBGFOR_USE_SYMVER_SUN_TRUE}" && test -z "${LIBGFOR_USE_SYMVER_SUN_FALSE}"; then
+ as_fn_error "conditional \"LIBGFOR_USE_SYMVER_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: ${CONFIG_STATUS=./config.status}
ac_write_fail=0
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index e7e34a6fec2..5f78a8b2d2c 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -138,17 +138,30 @@ AC_SUBST(CFLAGS)
# Check for symbol versioning (copied from libssp).
AC_MSG_CHECKING([whether symbol versioning is supported])
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
cat > conftest.map <<EOF
FOO_1.0 {
global: *foo*; bar; local: *;
};
EOF
-save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
-AC_TRY_LINK([int foo;],[],[gfortran_use_symver=yes],[gfortran_use_symver=no])
+AC_TRY_LINK([int foo;],[],[gfortran_use_symver=gnu],[gfortran_use_symver=no])
+if test x$gfortran_use_symver = xno; then
+ LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
+ # Sun ld cannot handle wildcards and treats all entries as undefined.
+ cat > conftest.map <<EOF
+FOO_1.0 {
+ global: foo; local: *;
+};
+EOF
+ AC_TRY_LINK([int foo;],[],[gfortran_use_symver=sun],[gfortran_use_symver=no])
+fi
LDFLAGS="$save_LDFLAGS"
AC_MSG_RESULT($gfortran_use_symver)
-AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" = xyes])
+AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" != xno])
+AM_CONDITIONAL(LIBGFOR_USE_SYMVER_GNU, [test "x$gfortran_use_symver" = xgnu])
+AM_CONDITIONAL(LIBGFOR_USE_SYMVER_SUN, [test "x$gfortran_use_symver" = xsun])
# Figure out whether the compiler supports "-ffunction-sections -fdata-sections",
# similarly to how libstdc++ does it