ppc-linux gcc configury patch

Richard Henderson rth@cygnus.com
Sun May 30 16:59:00 GMT 1999


Cort recently changed the ppc ld emulation for linux to 
make it nicer for AIX to emulate linux.  But this also
means we need to tweek gcc's LINK_SPEC.  But we can only
do that by either requiring binutils upgrades, or adding
nasty configury.

Here's an attempt at the later.  Would someone be so kind
as to try this out with and without current binutils cvs
binaries in your path?


r~



Index: acconfig.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/acconfig.h,v
retrieving revision 1.32
diff -c -p -d -r1.32 acconfig.h
*** acconfig.h	1999/04/23 19:41:00	1.32
--- acconfig.h	1999/05/30 23:53:06
***************
*** 125,128 ****
--- 125,131 ----
  
  /* Define to the version of the distribution.  */
  #undef VERSION
+ 
+ /* Define if you linker supports `-m elf32ppclinux'.  */
+ #undef HAVE_LD_ELF32PPCLINUX
  @TOP@
Index: config.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config.in,v
retrieving revision 1.47
diff -c -p -d -r1.47 config.in
*** config.in	1999/04/23 19:40:57	1.47
--- config.in	1999/05/30 23:53:06
***************
*** 127,132 ****
--- 127,135 ----
  /* Define to the version of the distribution.  */
  #undef VERSION
  
+ /* Define if you linker supports `-m elf32ppclinux'.  */
+ #undef HAVE_LD_ELF32PPCLINUX
+ 
  /* Define if using alloca.c.  */
  #undef C_ALLOCA
  
***************
*** 361,363 ****
--- 364,370 ----
  
  /* Define if you have the i library (-li).  */
  #undef HAVE_LIBI
+ 
+ /*  */
+ #undef HAVE_LD_ELF32PPCLINUX
+ 
Index: configure
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure,v
retrieving revision 1.242.4.1
diff -c -p -d -r1.242.4.1 configure
*** configure	1999/05/26 16:36:16	1.242.4.1
--- configure	1999/05/30 23:53:06
*************** else
*** 1310,1316 ****
  fi
  
  # Find some useful tools
! for ac_prog in mawk gawk nawk awk
  do
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
--- 1310,1316 ----
  fi
  
  # Find some useful tools
! for ac_prog in gawk mawk nawk awk
  do
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
*************** EOF
*** 8175,8180 ****
--- 8175,8231 ----
  	rm -f conftest.s conftest.o
  fi
  echo "$ac_t""$gcc_cv_as_instructions" 1>&6
+ 
+ gcc_cv_ld=
+ gcc_cv_ld_alignment_features=
+ gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gld
+ if test -x "$DEFAULT_LINKER"; then
+ 	gcc_cv_ld="$DEFAULT_LINKER"
+ elif test -x "$LD"; then
+ 	gcc_cv_ld="$LD"
+ elif test -x ld$host_exeext; then
+ 	# Build using assembler in the current directory.
+ 	gcc_cv_ld=./ld$host_exeext
+ elif test -f $gcc_cv_ld_gld_srcdir/configure.in -a -f ../ld/Makefile; then
+ 	# Single tree build which includes binutils.
+ 	for f in $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
+ 	do
+ 		gcc_cv_gld_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
+ 		if test x$gcc_cv_gld_version != x; then
+ 			break
+ 		fi
+ 	done
+ 	gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
+ 	gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
+ elif test x$host = x$target; then
+ 	# Native build.
+ 	gcc_cv_ld=ld$host_exeext
+ fi
+ 
+ if test x$gcc_cv_ld != x; then
+ 	case "$target" in
+ 	  powerpc-*-linux-gnu*)
+ 	    echo $ac_n "checking linker emulations""... $ac_c" 1>&6
+ echo "configure:8210: checking linker emulations" >&5
+             gcc_cv_ld_emul=`$gcc_cv_ld --help 2>&1
+ 		| sed -ne '/supported emulations:/!d
+ 			   s/[         ][      ]*/ /g
+ 			   s/.*supported emulations: *//
+ 			   s/ .*//
+ 			   p'`
+ 	    case "$gcc_cv_ld_emul" in
+ 	      elf32ppclinux)
+ 		cat >> confdefs.h <<\EOF
+ [#define] HAVE_LD_ELF32PPCLINUX ifelse(1, 2, [], 1, 3, [], 1)
+ EOF
+ 
+ 		;;
+ 	    esac
+ 	    echo "$ac_t""$gcc_cv_ld_emul" 1>&6
+ 	  ;;
+ 	esac
+ fi
+ 
  
  # Figure out what language subdirectories are present.
  # Look if the user specified --enable-languages="..."; if not, use
Index: configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.246.4.1
diff -c -p -d -r1.246.4.1 configure.in
*** configure.in	1999/05/26 16:36:19	1.246.4.1
--- configure.in	1999/05/30 23:53:08
*************** if test x$gcc_cv_as != x; then
*** 4009,4014 ****
--- 4009,4064 ----
  fi
  AC_MSG_RESULT($gcc_cv_as_instructions)
  
+ gcc_cv_ld=
+ gcc_cv_ld_alignment_features=
+ gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gld
+ if test -x "$DEFAULT_LINKER"; then
+ 	gcc_cv_ld="$DEFAULT_LINKER"
+ elif test -x "$LD"; then
+ 	gcc_cv_ld="$LD"
+ elif test -x ld$host_exeext; then
+ 	# Build using assembler in the current directory.
+ 	gcc_cv_ld=./ld$host_exeext
+ elif test -f $gcc_cv_ld_gld_srcdir/configure.in -a -f ../ld/Makefile; then
+ 	# Single tree build which includes binutils.
+ 	for f in $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
+ 	do
+ changequote(,)dnl
+ 		gcc_cv_gld_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
+ changequote([,])dnl
+ 		if test x$gcc_cv_gld_version != x; then
+ 			break
+ 		fi
+ 	done
+ changequote(,)dnl
+ 	gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
+ 	gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
+ elif test x$host = x$target; then
+ 	# Native build.
+ 	gcc_cv_ld=ld$host_exeext
+ fi
+ 
+ if test x$gcc_cv_ld != x; then
+ 	case "$target" in
+ 	  powerpc-*-linux-gnu*)
+ 	    AC_MSG_CHECKING(linker emulations)
+             gcc_cv_ld_emul=`$gcc_cv_ld --help 2>&1
+ 		| sed -ne '/supported emulations:/!d
+ 			   s/[         ][      ]*/ /g
+ 			   s/.*supported emulations: *//
+ 			   s/ .*//
+ 			   p'`
+ 	    case "$gcc_cv_ld_emul" in
+ 	      elf32ppclinux)
+ 		AC_DEFINE(HAVE_LD_ELF32PPCLINUX)
+ 		;;
+ 	    esac
+ 	    AC_MSG_RESULT($gcc_cv_ld_emul)
+ 	  ;;
+ 	esac
+ fi
+ 
+ 
  # Figure out what language subdirectories are present.
  # Look if the user specified --enable-languages="..."; if not, use
  # the environment variable $LANGUAGES if defined. $LANGUAGES might


More information about the Gcc-patches mailing list