Luis Lavena wrote:
> On Sat, Apr 19, 2008 at 12:57 AM, John E. / TDM <tdragon@...> wrote:
>> You might try discovering the new semantics of the access() function. It's
>> defined in the MinGW header io.h, and under Vista you need to make sure to
>> #define __USE_MINGW_ACCESS before including it. It is in fact a wrapper
>> around the MSVCRT's _access(), documented at
>> http://msdn2.microsoft.com/en-us/library/1w06ktdy(VS.80).aspx . If you can
>> figure out in what circumstances access("path\to\file.exe", *) in MinGW
>> returns nonzero even though path\to\file.exe exists and is a valid
>> executable, and in what circumstances it returns zero as expected, that
>> would probably be helpful.
> what is the valued of mode? you supplied a wildcard, should I try 0
> (existance), and 04 (read mode) only?
I would say try all possible modes, just so we can know.
> And was a hit!
> It worked and made possible to compile hello.c, as you could see from
> gcc-compile-output.txt (gcc -v hello.c > file 2>&1)
> Looks like is possible will work, but before I confirm it will test
> running the Ruby build recipes and see what happens.
You don't know how glad I am it finally worked...
This will necessitate patching make-relative-prefix.c in libiberty and
creating yet another 3.4.5 release.
To the MinGW admins and devs:
In creating this version that Luis Lavena has been testing, I had
incorporated a patch I've been working on for more current versions of
GCC which corrects the behavior of make_relative_prefix() on Win32. It
may or may not have been necessary for this particular situation, but it
does fix the little-known bug which I hypothesized as a cause previously
in this thread -- and which is still present in all subsequent versions
of GCC up to and including 4.3.0 (I haven't looked at 4.4, but I imagine
it's there too).
I would like to apply my changes as they stand to create a new 3.4.5
release that works fully on Vista. I believe the new semantics from
these changes are now as correct as possible for running in Windows. The
implementation replaces access() with stat() from sys/stat.h because
access() didn't seem to be working on Vista; there might be a better
method but I don't see that as critical in any way. Because I am not
familiar with the ins and outs of other similar systems (DJGPP? OS/2?)
that might benefit from these changes, I have guarded the changes with
I would also recommend that this or a similar fix be submitted to the
GCC sources by someone with an FSF copyright assignment.
I have attached a diff of make-relative-prefix.c to show the changes I
made. Questions or concerns?