Patch: Fix regression in make_relative_prefix

Danny Smith danny_r_smith_2001@yahoo.co.nz
Tue Dec 3 17:27:00 GMT 2002


Reference: http://gcc.gnu.org/ml/gcc-patches/2002-11/msg01826.html

Hi: 
Could this patch be reviewed. In the movemnt of make_relative_prefix from gcc.c
to libiberty, a define got lost.   This causes a regression on win32 targets
when gcc.exe needs to search the path for its location.

The problem is here at line 276 in make-relative-prefix.c:
#ifdef HAVE_HOST_EXECUTABLE_SUFFIX
                      || ! access (strcat (nstore, HOST_EXECUTABLE_SUFFIX),
X_OK)
#endif

HAVE_HOST_EXECUTABLE_SUFFIX is never defined in libiberty.

Danny

> In make_relative_prefix, checking X_OK access of prognames with an
> HOST_EXECUTABLE_SUFFIX is conditional on HAVE_HOST_EXECUTABLE_SUFFIX. However
> this is not defined in libiberty code (although it was and still is defined
in
> gcc.c).

> This patch defines it for those targets that need it.

libiberty/ChangeLog

2002-12-04  Danny Smith  <dannysmith@users.sourceforge.net>

	* make-relative-prefix.c (HAVE_HOST_EXECUTABLE_SUFFIX):
	Define for hosts with HOST_EXECUTABLE_SUFFIX.

*** make-relative-prefix.c.orig	Thu Nov 28 02:31:29 2002
--- make-relative-prefix.c	Thu Nov 28 03:16:37 2002
*************** can be found, return @code{NULL}.
*** 67,72 ****
--- 67,73 ----
  #if defined (_WIN32) || defined (__MSDOS__) \
      || defined (__DJGPP__) || defined (__OS2__)
  #  define HAVE_DOS_BASED_FILE_SYSTEM
+ #  define HAVE_HOST_EXECUTABLE_SUFFIX
  #  define HOST_EXECUTABLE_SUFFIX ".exe"
  #  ifndef DIR_SEPARATOR_2 
  #    define DIR_SEPARATOR_2 '\\'


http://www.yahoo.promo.com.au/hint/ - Yahoo! Hint Dropper
- Avoid getting hideous gifts this Christmas with Yahoo! Hint Dropper!



More information about the Gcc-patches mailing list