Author: dgilmore
Date: 2012-08-19 20:13:16 -0400 (Sun, 19 Aug 2012)
New Revision: 4010

Modified:
   trunk/osprey-gcc-4.2.0/gcc/configure
   trunk/osprey-gcc-4.2.0/gcc/configure.ac
Log:
Configure fix to handle GNU Gold linker.

Without this change hidden attribute is configured as not being
supported.

We can safely assume that the GNU Gold linker supports this attribute.

I don't know of any Linux distributions that currently use the GOLD
linker by default, we just discovered this issue when /usr/bin/ld was
replaced by a GOLD linker.

CR: David Coakley


Modified: trunk/osprey-gcc-4.2.0/gcc/configure
===================================================================
--- trunk/osprey-gcc-4.2.0/gcc/configure        2012-08-19 23:57:14 UTC (rev 
4009)
+++ trunk/osprey-gcc-4.2.0/gcc/configure        2012-08-20 00:13:16 UTC (rev 
4010)
@@ -7653,7 +7653,7 @@
 else
     ac_prog_version=`$MAKEINFO --version 2>&1 |
                    sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
-  echo "configure:7654: version of makeinfo is $ac_prog_version" >&5
+  echo "configure:7656: version of makeinfo is $ac_prog_version" >&5
   case $ac_prog_version in
     '')     gcc_cv_prog_makeinfo_modern=no;;
     4.[4-9]*)
@@ -13925,6 +13925,7 @@
 echo "${ECHO_T}$gcc_cv_as_hidden" >&6
 
 
+ld_ver_gold=
 echo "$as_me:$LINENO: checking linker for .hidden support" >&5
 echo $ECHO_N "checking linker for .hidden support... $ECHO_C" >&6
 if test "${gcc_cv_ld_hidden+set}" = set; then
@@ -13952,7 +13953,12 @@
     ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
     ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
     ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
-    if test 0"$ld_date" -lt 20020404; then
+    ld_ver_gold=`expr "$ld_ver" : '.* \(gold\) '`
+    if test "$ld_ver_gold" = gold; then
+       # The above patterns do not correctly parse the version string of the 
Gold linker.
+       # We assume that Gold linker supports the .hidden attribute.
+       gcc_cv_ld_hidden=yes
+    elif test 0"$ld_date" -lt 20020404; then
       if test -n "$ld_date"; then
        # If there was date string, but was earlier than 2002-04-04, fail
        gcc_cv_ld_hidden=no
@@ -13984,6 +13990,10 @@
 fi
 echo "$as_me:$LINENO: result: $gcc_cv_ld_hidden" >&5
 echo "${ECHO_T}$gcc_cv_ld_hidden" >&6
+if test "$ld_ver_gold" = gold; then
+  { echo "$as_me:$LINENO: WARNING: assuming gold linker supports hidden 
attribute" >&5
+echo "$as_me: WARNING: assuming gold linker supports hidden attribute" >&2;}
+fi
 libgcc_visibility=no
 
 

Modified: trunk/osprey-gcc-4.2.0/gcc/configure.ac
===================================================================
--- trunk/osprey-gcc-4.2.0/gcc/configure.ac     2012-08-19 23:57:14 UTC (rev 
4009)
+++ trunk/osprey-gcc-4.2.0/gcc/configure.ac     2012-08-20 00:13:16 UTC (rev 
4010)
@@ -886,7 +886,8 @@
 *** Info documentation will not be built.])
   BUILD_INFO=
 else
-  BUILD_INFO=info
+  # KEY: Don't build doc.
+  BUILD_INFO= #info
 fi
 AC_SUBST(BUILD_INFO)
 
@@ -894,7 +895,8 @@
 AC_MSG_CHECKING([for recent Pod::Man])
 if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then
   AC_MSG_RESULT(yes)
-  GENERATED_MANPAGES=generated-manpages
+  # KEY: Don't build man pages.
+  GENERATED_MANPAGES= #generated-manpages
 else
   AC_MSG_RESULT(no)
   GENERATED_MANPAGES=
@@ -2081,6 +2083,7 @@
 [      .hidden foobar
 foobar:])
 
+ld_ver_gold=
 AC_CACHE_CHECK(linker for .hidden support, gcc_cv_ld_hidden,
 [if test $in_tree_ld = yes ; then
   gcc_cv_ld_hidden=no
@@ -2105,7 +2108,12 @@
     ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
     ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
     ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
-    if test 0"$ld_date" -lt 20020404; then
+    ld_ver_gold=`expr "$ld_ver" : '.* \(gold\) '`
+    if test "$ld_ver_gold" = gold; then
+       # The above patterns do not correctly parse the version string of the 
Gold linker.
+       # We assume that Gold linker supports the .hidden attribute.
+       gcc_cv_ld_hidden=yes
+    elif test 0"$ld_date" -lt 20020404; then
       if test -n "$ld_date"; then
        # If there was date string, but was earlier than 2002-04-04, fail
        gcc_cv_ld_hidden=no
@@ -2135,6 +2143,9 @@
     esac
   fi
 fi])
+if test "$ld_ver_gold" = gold; then
+  AC_MSG_WARN(assuming gold linker supports hidden attribute)
+fi
 libgcc_visibility=no
 AC_SUBST(libgcc_visibility)
 GCC_TARGET_TEMPLATE([HAVE_GAS_HIDDEN])


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to