[llvm-commits] Patch: improve protability of llvm-config

Julien Lerouge jlerouge at apple.com
Wed Nov 5 17:03:48 PST 2008


On Thu, Nov 06, 2008 at 03:30:36AM +0300, Anton Korobeynikov wrote:
> > So, your initial patch is fine assuming all the magic paths like
> > "/volume" have a real folder associated with them in the msys root.
> This seems to be quite 'unnatural' requirement. I think the problem
> can be even worse if there is some magic prefix for volumes, etc. of
> form "/driveprefix/driveletter".

Agreed.

> Another question: how are the paths like "c:/dir1/dir2/dir3" are
> handled? Do they left as-is, or transformed into "/c/dir1/dir2/dir3" ?
> (I don't have mingw box currently and cannot verify by myself). If
> they are left as-is, then resulted binaries /scripts, even having
> paths hardcoded in them, can still be run without msys shell (this is
> how the things work currently).

Good point, running the following perl:

use Cwd;
print STDERR Cwd::realpath("c:/WINDOWS");

* On MSYS/MingW:

$ perl t.pl
opendir(c:/WINDOWS/../..): No such file or directory at t.pl line 2

* For comparison, on cygwin:

$ perl t.pl
/cygdrive/c/WINDOWS

* On ActivePerl:

> t.pl
c:/WINDOWS

So, it's a mess... Path like c:/dir1/dir2 cannot be used on MSYS/MingW,
but they can still be used if using ActivePerl. If running MSYS/MingW,
then posix path have to be used (/c/...) and the /c folder must exist in
the MSYS root.

I think falling back to realpath if the shell doesn't work is the right
way to go.

Hope this helps,
Julien

-- 
Julien Lerouge
PGP Key Id: 0xB1964A62
PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62
PGP Public Key from: keyserver.pgp.com



More information about the llvm-commits mailing list