$NetBSD: patch-gas_configure,v 1.4 2016/02/03 19:56:34 jperkin Exp $

Backport SunOS fix from 2.26.1

--- gas/configure.orig	2016-01-25 08:54:08.000000000 +0000
+++ gas/configure
@@ -765,6 +765,7 @@ enable_largefile
 enable_targets
 enable_checking
 enable_compressed_debug_sections
+enable_x86_relax_relocations
 enable_werror
 enable_build_warnings
 enable_nls
@@ -1415,6 +1416,8 @@ Optional Features:
   --enable-checking       enable run-time checks
   --enable-compressed-debug-sections={all,gas,none}
                           compress debug sections by default]
+  --enable-x86-relax-relocations
+                          generate x86 relax relocations by default
   --enable-werror         treat compile warnings as errors
   --enable-build-warnings enable build-time compiler warnings
   --disable-nls           do not use Native Language Support
@@ -11680,6 +11683,17 @@ if test "${enable_compressed_debug_secti
 esac
 fi
 
+# PR gas/19520
+# Decide if x86 assembler should generate relax relocations.
+ac_default_x86_relax_relocations=unset
+# Provide a configure time option to override our default.
+# Check whether --enable-x86_relax_relocations was given.
+if test "${enable_x86_relax_relocations+set}" = set; then :
+  enableval=$enable_x86_relax_relocations; case "${enableval}" in
+  no)  ac_default_x86_relax_relocations=0 ;;
+esac
+fi
+
 using_cgen=no
 
 
@@ -12085,6 +12099,17 @@ $as_echo "#define STRICTCOFF 1" >>confde
 
 	;;
 
+      i386-*-solaris2 \
+      | x86_64-*-solaris2 \
+      | i386-*-solaris2.[0-9] \
+      | i386-*-solaris2.1[01] \
+      | x86_64-*-solaris2.1[01])
+       if test ${this_target} = $target \
+          && test ${ac_default_x86_relax_relocations} = unset; then
+         ac_default_x86_relax_relocations=0
+       fi
+       ;;
+
       i860-*-*)
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GAS support for ${generic_target} is preliminary and a work in progress" >&5
 $as_echo "$as_me: WARNING: GAS support for ${generic_target} is preliminary and a work in progress" >&2;}
@@ -12505,7 +12530,15 @@ _ACEOF
 
 done
 
-if test x$ac_default_compressed_debug_sections == xyes ; then
+if test ${ac_default_x86_relax_relocations} = unset; then
+  ac_default_x86_relax_relocations=1
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS $ac_default_x86_relax_relocations
+_ACEOF
+
+if test x$ac_default_compressed_debug_sections = xyes ; then
 
 $as_echo "#define DEFAULT_FLAG_COMPRESS_DEBUG 1" >>confdefs.h
 
