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]
Other format: [Raw text]

PATCH mingw32 Changes to allow mainline to bootstrap.


The two patches below need to be applied to allow mainine to bootstrap on i686-pc-mingw32. In addition, the patch discussed at http://gcc.gnu.org/ml/gcc-patches/2004-05/msg01610.html needs to be applied as well. Until any general mechanism is adopted to opt-in/opt-out platforms from libmudflap, or support is implemented for mingw32, I think its reasonable that the build do the right thing by default.

Patch #1:

vfail in libbanshee/engine/util.c calls fflush(stdin), as well as
sync(), and fsync() for each of the standard file descriptors.
In addition, fflush(stdin) is undefined, and sync() and fsync()
are not portable.  I don't think, in the general case, any of
this is necessary to ensure the streams will be printed.

2004-05-28 Aaron W. LaFramboise <aaronraolete36@aaronwl.com>

* engine/util.c (vfail): Remove unnecessary sync, fsync, and fflush.

Index: gcc/libbanshee/engine/util.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libbanshee/engine/util.c,v
retrieving revision 1.3
diff -c -3 -p -r1.3 util.c
*** gcc/libbanshee/engine/util.c    24 May 2004 13:20:52 -0000    1.3
--- gcc/libbanshee/engine/util.c    28 May 2004 09:38:54 -0000
*************** static void vfail(const char *fmt, va_li
*** 44,56 ****
static void vfail(const char *fmt, va_list args)
{
  vfprintf(stderr, fmt, args);
-   fflush(stdin);
  fflush(stderr);
  fflush(stdout);
-   sync();
-   fsync(STDIN_FILENO);
-   fsync(STDERR_FILENO);
-   fsync(STDOUT_FILENO);
  abort();
  while (1); /* Work around stupid gcc-2.96-85 bug */
}
--- 44,51 ----


Patch #2:
Fixes this warning for mingw. While I realize this code may disappear entirely, I think it would be nice if GCC were able to bootstrap until that happens.


stage1/xgcc.exe -Bstage1/ -B/usr/i686-pc-mingw32/bin/ -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../../../../src/cvs/mainline/gcc/gcc -I../../../../../src/cvs/mainline/gcc/gcc/. -I../../../../../src/cvs/mainline/gcc/gcc/../include -I../../../../../src/cvs/mainline/gcc/gcc/../libcpp/include -I../../../../../src/cvs/mainline/gcc/gcc/../libbanshee/libcompat -I../../../../../src/cvs/mainline/gcc/gcc/../libbanshee -I../../../../../src/cvs/mainline/gcc/gcc/../libbanshee/points-to \
-DPREFIX=\"/usr\" \
-c ../../../../../src/cvs/mainline/gcc/gcc/prefix.c -o prefix.o
../../../../../src/cvs/mainline/gcc/gcc/prefix.c: In function `lookup_key':
../../../../../src/cvs/mainline/gcc/gcc/prefix.c:160: warning: pointer targets in passing arg 5 of `RegQueryValueExA' differ in signedness
../../../../../src/cvs/mainline/gcc/gcc/prefix.c:164: warning: pointer targets in passing arg 5 of `RegQueryValueExA' differ in signedness


2004-05-28 Aaron W. LaFramboise <aaronraolete36@aaronwl.com>

* prefix.c (lookup_key): Cast buffer to LPBYTE.

Index: gcc/gcc/prefix.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/prefix.c,v
retrieving revision 1.43
diff -c -3 -p -r1.43 prefix.c
*** gcc/gcc/prefix.c    15 May 2004 15:16:44 -0000    1.43
--- gcc/gcc/prefix.c    28 May 2004 10:12:04 -0000
*************** lookup_key (char *key)
*** 157,167 ****
  size = 32;
  dst = xmalloc (size);

!   res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size);
  if (res == ERROR_MORE_DATA && type == REG_SZ)
    {
      dst = xrealloc (dst, size);
!       res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size);
    }

  if (type != REG_SZ || res != ERROR_SUCCESS)
--- 157,167 ----
  size = 32;
  dst = xmalloc (size);

! res = RegQueryValueExA (reg_key, key, 0, &type, (LPBYTE) dst, &size);
if (res == ERROR_MORE_DATA && type == REG_SZ)
{
dst = xrealloc (dst, size);
! res = RegQueryValueExA (reg_key, key, 0, &type, (LPBYTE) dst, &size);
}


if (type != REG_SZ || res != ERROR_SUCCESS)


Aaron W. LaFramboise



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