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]

Patch to fix alphaev6-dec-osf4.0f bootstrap


Attempting to bootstrap on Dec Alpha fails with:

Bootstrap comparison failure!
crtfastmath.o differs
make[1]: *** [compare] Error 1

due to how gcc generates constructors.

This patch allows Dec Alpha to bootstrap and passes
make bootstrap and make check Solaris 7 x86.

ChangeLog:

Thu Sep 13 13:21:01 EDT 2001  John Wehle  (john@feith.com)

	* tree.c (append_random_chars): Generate the random
	characters in a reproducable fashion.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/tree.c.ORIGINAL	Tue Sep 11 15:03:45 2001
--- gcc/tree.c	Thu Sep 13 10:09:50 2001
*************** append_random_chars (template)
*** 4533,4551 ****
    static unsigned HOST_WIDE_INT value;
    unsigned HOST_WIDE_INT v;
  
! #ifdef HAVE_GETTIMEOFDAY
!   struct timeval tv;
! #endif
  
!   template += strlen (template);
  
! #ifdef HAVE_GETTIMEOFDAY
!   /* Get some more or less random data.  */
!   gettimeofday (&tv, NULL);
!   value += ((unsigned HOST_WIDE_INT) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
! #else
!   value += getpid ();
! #endif
  
    v = value;
  
--- 4533,4553 ----
    static unsigned HOST_WIDE_INT value;
    unsigned HOST_WIDE_INT v;
  
!   if (! value)
!     {
!       struct stat st;
  
!       /* VALUE should be unique for each file and must
! 	 not change between compiles since this can cause
! 	 bootstrap comparison errors.  */
! 
!       if (stat (main_input_filename, &st) < 0)
! 	abort ();
  
!       value = st.st_dev ^ st.st_ino ^ st.st_mtime;
!     }
! 
!   template += strlen (template);
  
    v = value;
  
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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