This is the mail archive of the gcc-patches@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]

configure bug



gcc's configure script attempts to determine what features are supported
by the assembler.

This has mostly worked, with one important bug -- the configure process
searched the user's path first rather than the compiler's built-in paths.
Also note that the built-in paths include those based on the prefix, target
& version and those based on the definition of MD_EXEC_PREFIX (arghh!).

As a result, the configure process may find an assembler with different
features than would be found during the build or when the compiler was
actually installed.

You can see the results of this by doing a slowaris bootstrap after
configuring with --prefix=/nowhere but with a recent copy of gnu-as in
your path.

The configure process will detect the gnu-as in your path and assume that
you have "subsection -1" support.

Then when you actually try to build the compiler will find the assembler 
in /usr/ccs/bin/as before searching your path.  The slowaris assembler does
not support "subsection -1" and will barf when the compiler tries to use
that feature.


We need to put this on the list of things to clean up with the configure/make
revamp after gcc-2.95.

In the mean time, this patch fixes the problem about as well as it can be
fixed at the current time.

	* configure.in (native gas tests): Search for an assembler in the
	same manner that the installed compiler will.
	* configure: Rebuilt.

Index: configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.246.4.1
diff -c -3 -p -r1.246.4.1 configure.in
*** configure.in	1999/05/26 16:36:19	1.246.4.1
--- configure.in	1999/05/31 09:17:18
*************** changequote([,])dnl
*** 3934,3940 ****
  	fi
  elif test x$host = x$target; then
  	# Native build.
! 	gcc_cv_as=as$host_exeext
  fi
  if test x$gcc_cv_as != x; then
  	# Check if we have .balign and .p2align
--- 3934,3988 ----
  	fi
  elif test x$host = x$target; then
  	# Native build.
! 	# Search the same directories that the installed compiler will
! 	# search.  Else we may find the wrong assembler and lose.  If we
! 	# do not find a suitable assembler binary, then try the user's
! 	# path.
! 	#
! 	# Also note we have to check MD_EXEC_PREFIX before checking the
! 	# user's path.  Unfortunately, there is no good way to get at the
! 	# value of MD_EXEC_PREFIX here.  So we do a brute force search
! 	# through all the known MD_EXEC_PREFIX values.  Ugh.  This needs
! 	# to be fixed as part of the make/configure rewrite too.
! 
! 	if test "x$exec_prefix" = xNONE; then
! 		if test "x$prefix" = xNONE; then
! 			test_prefix=/usr/local
! 		else
! 			test_prefix=$prefix
! 		fi
! 	else
! 		test_prefix=$exec_prefix
! 	fi
! 
! 	# If the loop below does not find an assembler, then use whatever
! 	# one we can find in the users's path.
! 	# user's path.
! 	as=as$host_exeext
! 
! 	test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \
! 		   $test_prefix/lib/gcc-lib/$target \
! 		   /usr/lib/gcc/$target/$gcc_version \
! 		   /usr/lib/gcc/$target \
! 		   $test_prefix/$target/bin/$target/$gcc_version \
! 		   $test_prefix/$target/bin \
! 		   /usr/libexec \
! 		   /usr/ccs/gcc \
! 		   /usr/ccs/bin \
! 		   /udk/usr/ccs/bin \
! 		   /bsd43/usr/lib/cmplrs/cc \
! 		   /usr/cross64/usr/bin \
! 		   /usr/lib/cmplrs/cc \
! 		   /sysv/usr/lib/cmplrs/cc \
! 		   /svr4/usr/lib/cmplrs/cc \
! 		   /usr/bin"
! 
! 	for dir in $test_dirs; do
! 		if test -f $dir/as$host_exeext; then
! 			gcc_cv_as=$dir/as$host_exeext
! 			break;
! 		fi
! 	done
  fi
  if test x$gcc_cv_as != x; then
  	# Check if we have .balign and .p2align








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