[loeh@iai.uni-bonn.de: Re: -odir behaviour change in 6.4.1?]

Isaac Jones ijones at syntaxpolice.org
Tue Aug 16 02:54:40 EDT 2005

"Andres Loeh" <loeh at iai.uni-bonn.de> writes:

> Hello again,
Simon Says:
>> Yes, this change was made for consistency (someone else reported the
>> breakage).  I've also patched Cabal, so perhaps you're using a version
>> from before the fix?
> I must be doing something wrong, then.
> /usr/bin/ghc -odir dist/build/foo/foo-tmp/foo -hidir dist/build -c foo/foo.c

That's the wrong part.

> /usr/bin/ghc -odir dist/build/foo/foo-tmp -hidir dist/build/foo/foo-tmp -o dist/build/foo/foo -hide-all-packages --make -i -i. -package base-1.0 dist/build/foo/foo-tmp/foo/foo.o Main.hs
> Chasing modules from: Main.hs
> Compiling Main             ( Main.hs, dist/build/foo/foo-tmp/Main.o )
> Linking ...
> gcc: dist/build/foo/foo-tmp/foo/foo.o: No such file or directory
> The file foo.o is at dist/build/foo/foo-tmp/foo/foo/foo.o ...

Build.hs has this logic:

			   odir | versionBranch ghc_vers >= [6,4,1] = pref
				| otherwise = pref `joinFileName` dirOf c
				-- ghc 6.4.1 fixed a bug in -odir handling
				-- for C compilations.

which is good, but it only does that for libraries, not executables.
Damn.  This needs to get refactored to share code.

I think I fixed this.  Should be in the latest darcs and CVS.  Andres,
can you try this and let me know?



More information about the Glasgow-haskell-users mailing list