|
RE: -fvia-c doesn't work: msg#00079lang.haskell.glasgow.bugs
On 29 September 2004 16:49, Malcolm Wallace wrote: >>> $ ghc-6.2.1 -c -fvia-c /tmp/ghcbug.hs >>> In file included from /usr/include/stdlib.h:414, >>> from >>> >>> /usr/malcolm/local/lib/ghc-6.2.1/include/Stg.h:200, from >>> /tmp/ghc1723.hc:3: /usr/include/sys/types.h:190: conflicting >>> types for `int8_t' stdint.h:33: previous declaration of `int8_t' >> >> Weirdly, -fvia-c works just fine today, with all versions of ghc >> installed locally. It must have been something in my local machine >> config, even though I haven't changed anything since! > > OK, after a couple more strange experiences, whereby -fvia-c sometimes > worked and sometimes did not, depending on what directory I was in, > I finally determined that the failure happened only when I had a file > called "stdint.h" in the current directory. > > So apparently, since a straight call of gcc does not display the same > problem, the search path given to gcc by ghc somehow has . before > the standard location of /usr/include? Thanks for tracking this down. For a workaround, you can say ghc -I- ... this causes ghc to pass '-I-' to gcc, which causes gcc to interpret all the include paths as applying only to includes of the form #include "...". Includes of the form #include <...> will be searched for in the system directories only. Put the -I- after any other -I options on the ghc command line. I've made this change in GHC, but I probably won't merge it into 6.2.2 because it's only of those changes that could easily cause something else to break, so we need plenty of testing. Cheers, Simon
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-1037485 ] compiled program reports internal error when you hit ctrl-C, SourceForge.net |
|---|---|
| Next by Date: | [ ghc-Bugs-1037485 ] compiled program reports internal error when you hit ctrl-C, SourceForge.net |
| Previous by Thread: | Re: -fvia-c doesn't work, Malcolm Wallace |
| Next by Thread: | making ghc of september 26, Serge D. Mechveliani |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |