This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] bfd/ld: handle ABI prefixes in version scripts


On Monday, December 13, 2010 17:18:02 Joseph S. Myers wrote:
> On Mon, 13 Dec 2010, Mike Frysinger wrote:
> > i found the right place in configure.ac (there's a "target specific
> > checks" section), but i dont think these gas m4 macros are useful.  the
> > version checking only works when the gas used is in tree, and this
> > functionality cant be detected at the assembler level.  my fixes are
> > only at the linker level,
> 
> Yes, it was an example of the sort of test that exists for binutils
> features and/or versions rather than something that can be directly used
> as-is.
> 
> gcc/configure.ac already contains code that computes a linker version
> number (gcc_cv_gld_major_version and gcc_cv_gld_minor_version).  There is
> also code (e.g. in libstdc++-v3/acinclude.m4) to compute a version of an
> out-of-tree linker (in fact, I think there are rather too many copies of
> such code in different directories that could do with some unification).
> So if you want to test version numbers without any feature tests, there
> should be various existing code to adapt.

thanks.  this patch should do what i need.
-mike

--- a/gcc-4.3/gcc/acinclude.m4
+++ b/gcc-4.3/gcc/acinclude.m4
@@ -424,6 +424,19 @@ AC_DEFUN([gcc_GAS_VERSION_GTE_IFELSE],
 ifelse([$1], elf, [_gcc_GAS_VERSION_GTE_IFELSE($@)],
                   [_gcc_GAS_VERSION_GTE_IFELSE(,$@)])])
 
+dnl # gcc_GLD_VERSION_GTE_IFELSE(major, minor, [command_if_true = :],
+dnl #                            [command_if_false = :])
+dnl # Check to see if the version of GLD is greater than or
+dnl # equal to the specified version.
+AC_DEFUN([gcc_GLD_VERSION_GTE_IFELSE],
+[if test "$gcc_cv_gld_major_version" -eq $1 -a "$gcc_cv_gld_minor_version" -ge $2 \
+	 -o "$gcc_cv_gld_major_version" -gt $1
+ then dnl
+ifelse([$3],,:,[$3])[]dnl
+ifelse([$4],,,[
+  else $4])
+fi])
+
 dnl gcc_GAS_CHECK_FEATURE(description, cv, [[elf,]major,minor,patchlevel],
 dnl [extra switches to as], [assembler input],
 dnl [extra testing logic], [command if feature available])
--- a/gcc-4.3/gcc/configure.ac
+++ b/gcc-4.3/gcc/configure.ac
@@ -1970,6 +1970,14 @@ changequote(,)dnl
 	gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
 changequote([,])dnl
 else
+	if test x"$gnu_ld_flag" = x"yes" -o x"$with_gnu_ld" = x"yes"; then
+		changequote(,)
+		ldver=`$LD --version 2>/dev/null | head -1 | \
+		       sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'`
+		changequote([,])
+		gcc_cv_gld_major_version=`echo $ldver | $AWK -F. '{print $1}'`
+		gcc_cv_gld_minor_version=`echo $ldver | $AWK -F. '{print $2}'`
+	fi
 	AC_MSG_RESULT($gcc_cv_ld)
 	in_tree_ld=no
 fi
@@ -3051,6 +3059,14 @@ x:
     ;;
 esac
 
+# Newer linker changed behavior with version scripts and symbol prefixes
+case "$target" in
+  bfin*-linux-uclibc*)
+    gcc_GLD_VERSION_GTE_IFELSE(2, 22, [:],
+      [AC_MSG_ERROR([GNU binutils 2.22+ needed for version script changes])])
+    ;;
+esac
+
 # Mips and HP-UX need the GNU assembler.
 # Linux on IA64 might be able to use the Intel assembler.
 

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]