public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH' RFA] MIPS embedded targets' handling of crt0.o.
@ 2002-07-26 14:57 cgd
       [not found] ` <mailpost.1027717930.24758@news-sj1-1>
  0 siblings, 1 reply; 2+ messages in thread
From: cgd @ 2002-07-26 14:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: echristo, geoffk

This follows from:

	http://gcc.gnu.org/ml/gcc-patches/2002-07/msg01364.html

which was applied then reverted because it broke the mips-elf
regression tester quite thoroughly.  8-)  The theory there as to why
this is safe still applied.

Anyway, this updated patch seems to be safe for use at least with the
regression tester.  I believe (and have tested 8-) that it should
adequately handle:

	* in-tree libgloss (with and without the libgloss patch to
          consistently use STARTUP directives applied),

	* already-installed libgloss, again with and without
          consistent use of STARTUP directives.

and i've looked at the regression tester scripts and exchanged mail
with Geoff and the result is that, really, I think it won't hose down
the tester this time.  8-)


Do i need approval for the configury bits from anybody but Eric (since
they're MIPS-specific)?


chris
===================================================================
2002-07-26  Chris Demetriou  <cgd@broadcom.com>

	* configure.in (mips*-*-*): Add a test to see if MIPS libgloss
	linker scripts use STARTUP directives consistently.
	* configure: Regenerate.
	* config.in: Regenerate.
	* config/mips/elf.h (STARTFILE_SPEC): Define conditionally, based
	on whether HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES is defined.
	* config/mips/elf64.h (STARTFILE_SPEC): Likewise.
	* config/mips/isa3264.h (STARTFILE_SPEC): Do not redefine if
	HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES is set; the result
	will be the same.

Index: configure.in
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/configure.in,v
retrieving revision 1.610
diff -u -p -r1.610 configure.in
--- configure.in	14 Jul 2002 01:59:13 -0000	1.610
+++ configure.in	26 Jul 2002 20:59:05 -0000
@@ -2172,6 +2172,36 @@ if test x"$gcc_cv_ld_eh_frame_hdr" = xye
 fi
 AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
 
+# Miscellaneous target-specific checks.
+case "$target" in
+  mips*-*-*)
+    AC_MSG_CHECKING(whether libgloss uses STARTUP directives consistently)
+    gcc_cv_mips_libgloss_startup=no
+    gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
+    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
+    for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_alias/lib/idt.ld
+    do
+      if grep '^STARTUP' $f > /dev/null 2>&1; then
+        gcc_cv_mips_libgloss_startup=yes
+        break
+      fi
+    done
+    if test x"$gcc_cv_mips_libgloss_startup" = xyes; then
+      AC_DEFINE(HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES, 1,
+        [Define if your MIPS libgloss linker scripts consistently include STARTUP directives.])
+    fi
+    AC_MSG_RESULT($gcc_cv_mips_libgloss_startup)
+    ;;
+esac
+
 if test "$prefix" != "/usr" && test "$prefix" != "/usr/local" ; then
   AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include")
 fi
Index: config/mips/elf.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/mips/elf.h,v
retrieving revision 1.40
diff -u -p -r1.40 elf.h
--- config/mips/elf.h	25 Jul 2002 05:14:21 -0000	1.40
+++ config/mips/elf.h	26 Jul 2002 20:59:07 -0000
@@ -255,7 +255,11 @@ void FN ()                              
 #define LIB_SPEC ""
 
 #undef  STARTFILE_SPEC
+#ifdef HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES
+#define STARTFILE_SPEC "crti%O%s crtbegin%O%s"
+#else
 #define STARTFILE_SPEC "crti%O%s crtbegin%O%s %{!mno-crt0:crt0%O%s}"
+#endif
 
 #undef  ENDFILE_SPEC
 #define ENDFILE_SPEC "crtend%O%s crtn%O%s"
Index: config/mips/elf64.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/mips/elf64.h,v
retrieving revision 1.47
diff -u -p -r1.47 elf64.h
--- config/mips/elf64.h	25 Jul 2002 10:15:59 -0000	1.47
+++ config/mips/elf64.h	26 Jul 2002 20:59:08 -0000
@@ -225,7 +225,11 @@ void FN ()                              
 #define LIB_SPEC ""
 
 #undef  STARTFILE_SPEC
+#ifdef HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES
+#define STARTFILE_SPEC "crti%O%s crtbegin%O%s"
+#else
 #define STARTFILE_SPEC "crti%O%s crtbegin%O%s %{!mno-crt0:crt0%O%s}"
+#endif
 
 #undef  ENDFILE_SPEC
 #define ENDFILE_SPEC "crtend%O%s crtn%O%s"
Index: config/mips/isa3264.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/mips/isa3264.h,v
retrieving revision 1.8
diff -u -p -r1.8 isa3264.h
--- config/mips/isa3264.h	25 Jul 2002 10:15:59 -0000	1.8
+++ config/mips/isa3264.h	26 Jul 2002 20:59:08 -0000
@@ -33,9 +33,13 @@ Boston, MA 02111-1307, USA.  */
 
 #include "mips/elf.h"
 
+#ifndef HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES
+/* Once HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES is always true, this code
+   can be GC'd.  */
 #if MIPS_ABI_DEFAULT == ABI_MEABI
 /* For MEABI, don't link with crt0 files, let the linker start files specify
    the appropriate crt0 file.  */
 #undef  STARTFILE_SPEC
-#define STARTFILE_SPEC "crti%O%s crtbegin%O%s %{!mno-crt0: }"
+#define STARTFILE_SPEC "crti%O%s crtbegin%O%s"
+#endif
 #endif

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH' RFA] MIPS embedded targets' handling of crt0.o.
       [not found] ` <mailpost.1027717930.24758@news-sj1-1>
@ 2002-07-29 15:22   ` cgd
  0 siblings, 0 replies; 2+ messages in thread
From: cgd @ 2002-07-29 15:22 UTC (permalink / raw)
  To: gcc-patches; +Cc: echristo, geoffk

At Fri, 26 Jul 2002 21:12:10 +0000 (UTC), cgd@broadcom.com wrote:
> 2002-07-26  Chris Demetriou  <cgd@broadcom.com>
> 
> 	* configure.in (mips*-*-*): Add a test to see if MIPS libgloss
> 	linker scripts use STARTUP directives consistently.
> 	* configure: Regenerate.
> 	* config.in: Regenerate.
> 	* config/mips/elf.h (STARTFILE_SPEC): Define conditionally, based
> 	on whether HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES is defined.
> 	* config/mips/elf64.h (STARTFILE_SPEC): Likewise.
> 	* config/mips/isa3264.h (STARTFILE_SPEC): Do not redefine if
> 	HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES is set; the result
> 	will be the same.

Eric approved this off-list, and i've checked it in.

based on http://gcc.gnu.org/cvswrite.html#policies "Maintainers of a
port maintain the files in config/port/, the configure fragments for
the port, ..." i _think_ that means that I don't need additional
approval for the configure.in change.

If that's incorrect...  feel free to flame me, but also please update
the docs.  8-)



cgd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-07-29 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-26 14:57 [PATCH' RFA] MIPS embedded targets' handling of crt0.o cgd
     [not found] ` <mailpost.1027717930.24758@news-sj1-1>
2002-07-29 15:22   ` cgd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).