This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

gas feature probing bug


I don't know if this one still is present, but I needed the below
patch with a version of the compiler from mid 1999 to get the cross
compilers to produce reproducible binaries across multiple hosts.  The
bug can be spotted in newer compilers by:

   grep p2align build.log

If one gets:

checking assembler alignment features... .p2align including maximum skip
checking assembler alignment features... .balign and .p2align

the bug is present, if one gets:

checking assembler alignment features... .p2align including maximum skip
checking assembler alignment features... .p2align including maximum skip

the the bug isn't present.  This is in a single source tree build.

The code is slightly changed in the top of the tree, but the style of
change remains the same.  I found the bug originally on a x86 style
cross compiler hosted on a solaris 2.7 machine, though, the probing
should indicate the problem on almost any host/target.


Doing diffs in configure.in.~1~:
*** configure.in.~1~	Thu Apr 19 15:20:18 2001
--- configure.in	Thu Apr 19 15:59:43 2001
*************** fi
*** 4015,4022 ****
  
  # Figure out what assembler alignment features are present.
  AC_MSG_CHECKING(assembler alignment features)
! gcc_cv_as=
! gcc_cv_as_alignment_features=
  gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
  if test -x "$DEFAULT_ASSEMBLER"; then
  	gcc_cv_as="$DEFAULT_ASSEMBLER"
--- 4015,4022 ----
  
  # Figure out what assembler alignment features are present.
  AC_MSG_CHECKING(assembler alignment features)
! if test "$gcc_cv_as_alignment_features" = ""; then
! if test x$gcc_cv_as = x ]; then
  gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
  if test -x "$DEFAULT_ASSEMBLER"; then
  	gcc_cv_as="$DEFAULT_ASSEMBLER"
*************** changequote([,])dnl
*** 4045,4057 ****
  		# bytes to skip when using .p2align.
  		if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 6 -o "$gcc_cv_gas_major_version" -gt 2; then
  			gcc_cv_as_alignment_features=".balign and .p2align"
- 			AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
  		fi
  		# Gas version 2.8 and later support specifying the maximum
  		# bytes to skip when using .p2align.
  		if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 8 -o "$gcc_cv_gas_major_version" -gt 2; then
  			gcc_cv_as_alignment_features=".p2align including maximum skip"
- 			AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
  		fi
  	fi
  elif test x$host = x$target; then
--- 4045,4055 ----
*************** elif test x$host = x$target; then
*** 4106,4118 ****
  		fi
  	done
  fi
  if test x$gcc_cv_as != x; then
  	# Check if we have .balign and .p2align
  	echo ".balign  4" > conftest.s
  	echo ".p2align  2" >> conftest.s
  	if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
  		gcc_cv_as_alignment_features=".balign and .p2align"
! 		AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
  	fi
  	rm -f conftest.s conftest.o
  	# Check if specifying the maximum bytes to skip when
--- 4104,4117 ----
  		fi
  	done
  fi
+ fi
  if test x$gcc_cv_as != x; then
  	# Check if we have .balign and .p2align
  	echo ".balign  4" > conftest.s
  	echo ".p2align  2" >> conftest.s
  	if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
  		gcc_cv_as_alignment_features=".balign and .p2align"
! 		
  	fi
  	rm -f conftest.s conftest.o
  	# Check if specifying the maximum bytes to skip when
*************** if test x$gcc_cv_as != x; then
*** 4120,4130 ****
  	echo ".p2align 4,,7" > conftest.s
  	if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
  		gcc_cv_as_alignment_features=".p2align including maximum skip"
- 		AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
  	fi
  	rm -f conftest.s conftest.o
  fi
  AC_MSG_RESULT($gcc_cv_as_alignment_features)
  
  AC_MSG_CHECKING(assembler subsection support)
  gcc_cv_as_subsections=
--- 4119,4135 ----
  	echo ".p2align 4,,7" > conftest.s
  	if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
  		gcc_cv_as_alignment_features=".p2align including maximum skip"
  	fi
  	rm -f conftest.s conftest.o
  fi
+ fi
  AC_MSG_RESULT($gcc_cv_as_alignment_features)
+ if test "$gcc_cv_as_alignment_features" = ".balign and .p2align"; then
+   AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
+ elif test "$gcc_cv_as_alignment_features" = ".p2align including maximum skip"; then
+   AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
+   AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
+ fi
  
  AC_MSG_CHECKING(assembler subsection support)
  gcc_cv_as_subsections=
--------------


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