Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#1110 closed merge (fixed)

Setting PATH needed in Windows Vista

Reported by: br1@… Owned by: igloo
Priority: high Milestone: 6.8.3
Component: Driver Version: 6.8.1
Keywords: Cc:
Operating System: Windows Architecture: x86_64 (amd64)
Type of failure: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

I'm running Windows Vista 64 bits and GHC 6.6. I needed to put both ghc/bin and ghc/gcc-lib in my path for it to work, or I got cc1/as not found errors.

Attachments (2)

z.cmd.txt (3.4 KB) - added by br1 8 years ago.
Output from cmd console
z.cygwin.txt (3.4 KB) - added by br1 8 years ago.
Output from cygwin console

Download all attachments as: .zip

Change History (22)

comment:1 Changed 8 years ago by igloo

  • Milestone set to 6.6.1

comment:2 Changed 8 years ago by simonmar

  • Priority changed from normal to high

Vista support is a high prio for 6.6.1.

comment:3 Changed 8 years ago by igloo

I'm not sure what the problem is here, as we should be passing full paths. Perhaps it is a directory separator issue?

Can someone please attach to this bug report the output of something simple that shows the problem, perhaps like

echo 'main = putStrLn "Foo"' > z.hs
ghc -v z.hs -O -o z

and also please say what sort of terminal you are running from.

Changed 8 years ago by br1

Output from cmd console

Changed 8 years ago by br1

Output from cygwin console

comment:4 Changed 8 years ago by br1

I attached the requested output. I made sure cygwin's native gcc is not interfering with the one in ghc by nukeing PATH.

comment:5 Changed 8 years ago by igloo

OK, so your (cygwin) log looks like this:

D:\programas\ghc-6.6\gcc -BD:\programas\ghc-6.6\gcc-lib/ ...
...
 cc1 -quiet ...
gcc: installation problem, cannot exec `cc1': No such file or directory

(the -B option tells gcc where to find its internal executables etc) whereas mine looks like this:

c:\ghc\ghc-6.6\gcc -Bc:\ghc\ghc-6.6\gcc-lib/ ...
...
 c:/ghc/ghc-6.6/gcc-lib/cc1.exe -quiet ...
...

Both claim to be gcc version 3.4.5 (mingw special).

My guess is that on Vista gcc has decided that the -B directory we give it doesn't exist, presumably because it's getting confused by directory separators.

Is someone with Vista able to see if they can work out what we need to pass please? You should be able to test with something like

c:/ghc/ghc-6.6/gcc q.c -o q -v -Bc:\\ghc\\ghc-6.6\\gcc-lib/

at a cygwin prompt (note the escaped '\'s), where q.c is just something like

int main(void) {
    return 0;
}

comment:6 Changed 8 years ago by simonmar

It's a bug in MinGW (and/or gcc). Here's the latest thread I could find:

http://thread.gmane.org/gmane.comp.gnu.mingw.user/21709/focus=21711

it doesn't look like the MinGW folks have a fix checked in yet. So we could be hosed. One temporary fix could be to set the GCC_EXEC_PREFIX env var from GHC, I'll try that here and see if it works.

comment:7 Changed 8 years ago by igloo

  • Owner set to simonmar

comment:8 Changed 8 years ago by simonmar

  • Resolution set to fixed
  • Status changed from new to closed

Now fixed and merged.

comment:9 Changed 8 years ago by simonmar

  • difficulty changed from Unknown to Easy (1 hr)
  • Milestone changed from 6.6.1 to 6.8
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening because I forgot to apply the workaround to ld too.

comment:10 Changed 8 years ago by simonmar

  • Resolution set to fixed
  • Status changed from reopened to closed

Now fixed.

Fri Jun  1 16:19:32 BST 2007  Simon Marlow <[email protected]>
  * FIX #1110: the linker also needs the workaround

comment:11 Changed 8 years ago by igloo

  • Milestone changed from 6.8 branch to 6.8.1

comment:12 Changed 8 years ago by bchallenor

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 6.6 to 6.8.1

I'm seeing this bug in Vista using "Version 6.8.1, for Haskell 98, stage 3 booted by GHC version 6.6".

I try to compile a file generated using Alex that needs the preprocessor and get the following error: "gcc: installation problem, cannot exec `cc1': No such file or directory". As suggested, adding gcc-lib to the Path fixes it, but that's a bad hack.

comment:13 Changed 8 years ago by bchallenor

Sorry, I should have mentioned that this is on x86 (Intel). I hope this is a good place to file the bug.

comment:14 Changed 8 years ago by simonmar

urgh, I think I know what the problem is. Can you confirm that using the -cpp option causes the failure? Try compiling a small source file with and without -cpp.

comment:15 Changed 8 years ago by simonmar

  • Milestone changed from 6.8.1 to 6.8.3

comment:16 Changed 8 years ago by bchallenor

I can confirm that without gcc-lib on the command line, the file "main = return 42" compiles fine without any switches, but dies immediately with the -cpp switch.

comment:17 Changed 8 years ago by bchallenor

Oops, I meant Path.

comment:18 Changed 8 years ago by simonmar

  • Owner changed from simonmar to igloo
  • Status changed from reopened to new
  • Type changed from bug to merge

Fixed, to merge:

Wed Dec  5 07:02:30 PST 2007  Simon Marlow <[email protected]>
  * FIX #1110: hackery also needed when running gcc for CPP

comment:19 Changed 8 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

Merged

comment:20 Changed 6 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.