GCC 3.x can't find startup files and libraries under Windows/MINGW32

obry@gnat.com obry@gnat.com
Mon Jun 4 00:28:00 GMT 2001


Hello,

I have proposed a patch that I have modified at the last minute and it
is not quite right as submited. Please find a correct one attached to
this message.

<<
*** gcc.c.orig Sun Jun  3 20:43:14 2001
--- gcc.c Mon Jun  4 09:16:40 2001
***************
*** 3046,3051 ****
--- 3046,3052 ----
    if (gcc_exec_prefix)
      {
        int len = strlen (gcc_exec_prefix);
+       int clen = len;
  
        if (len > (int) sizeof ("/lib/gcc-lib/") - 1
  	  && (IS_DIR_SEPARATOR (gcc_exec_prefix[len-1])))
***************
*** 3056,3061 ****
--- 3057,3065 ----
  	      && IS_DIR_SEPARATOR (temp[4])
  	      && strncmp (temp + 5, "gcc-lib", 7) == 0)
  	    len -= sizeof ("/lib/gcc-lib/") - 1;
+ 	  else
+ 	    /* this is not a /lib/gcc-lib/ ending */
+ 	    clen = 0;
  	}
  
        set_std_prefix (gcc_exec_prefix, len);
***************
*** 3063,3068 ****
--- 3067,3088 ----
  		  PREFIX_PRIORITY_LAST, 0, NULL);
        add_prefix (&startfile_prefixes, gcc_exec_prefix, "GCC",
  		  PREFIX_PRIORITY_LAST, 0, NULL);
+ 
+       /* Add the lib directory just under the root GCC installation
+ 	 directory. This is the directory just above gcc_exec_prefix. This is
+ 	 needed under MINGW32 because most of the libraries and the startup
+ 	 files crt?.o, dllcrt?.o are put into this directory. */
+ 
+       if (clen != 0)
+ 	{
+ 	  char *libdir = (char *) alloca (clen + 1);
+ 	  
+ 	  strcpy (libdir, gcc_exec_prefix);
+ 	  libdir[len + 5] = '\0';
+ 
+ 	  add_prefix (&startfile_prefixes, libdir, "",
+ 		      PREFIX_PRIORITY_LAST, 0, NULL);
+ 	}
      }
  
    /* COMPILER_PATH and LIBRARY_PATH have values
>>

Pascal.



More information about the Gcc-patches mailing list