Re: Flag warnings show intermediate hscpp filenames on SmartOS

2016-01-10 Thread Alain O'Dea
Configuring GHC with modified hs-cpp-flags works to fix the tests: ./configure --with-hs-cpp-flags="-specs=/opt/local/etc/ghc/overridecpp.spec -E -undef -traditional -x assembler-with-cpp" overridecpp.spec: *cpp: %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} The challenge now is

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2016-01-10 Thread Alain O'Dea
cpphs doesn't currently work for compiling GHC. libraries/base/GHC/Natural.hs uses a macro with arguments inside an if defined preprocessor expression and cpphs tries to expand the macro and errors since there are no arguments provided. This is non-compliant if cpphs is trying to be a C99

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2016-01-09 Thread Alain O'Dea
Progress Update: 1. fixing CPP fixes the majority of the remaining test failures 2. cpphs builds and runs successfully on SmartOS 3. --with-hs-cpp-flags='-specs=overridecpp.spec" can be used in lieu of a wrapper script 3. I am running some experiments with cpphs to see how it works 4. I will run

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2016-01-01 Thread Alain O'Dea
Actually Karel, if "gcc -dumpspecs" shows you that same -P as I get you can override it with spec files as described here: https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html I think this means that you could specify "gcc -specs=/path/to/overridecpp.spec" as --with-hs-cpp when building GHC. I'm

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2016-01-01 Thread Alain O'Dea
Okay Karel. I have a solution that works to make T2464 pass. Create overridecpp.spec: *cpp: %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} Create ghc-cpp and make it executable: #!/bin/bash gcc -spec=/path/to/overridecpp.spec $@ Configure and make GHC with ghc-cpp and run T2464:

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2016-01-01 Thread Karel Gardas
Alain, indeed, on SmartOS you are free to modify the supplied GCC so the fix to remove -P is most natural one. On the other hand I'm not so lucky with binary Solaris 11.x distribution provided by Oracle so I need to use not so clean and nice workarounds... Karel On 01/ 1/16 12:17 AM,

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2016-01-01 Thread Alain O'Dea
True, but I'd still like to find a mutual solution since we're both somewhat at the edge of the supported landscape for GHC. Is installing cpphs and configuring GHC to use that an option on Solaris 11? I haven't built cpphs successfully on SmartOS yet. Supplying a custom C preprocessor may be

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2015-12-31 Thread Karel Gardas
Hi Alain, I guess you are hit by well known issue in GCC's CPP on Solaris. Just verify here: https://gcc.gnu.org/ml/gcc/2014-08/msg00114.html solution in this case is simple: use configure option to set different non buggy CPP as a CPP for GHC. Please let me know if this is the culprit,

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2015-12-31 Thread Karel Gardas
Also related: https://haskell-phabricator.global.ssl.fastly.net/D151 as Solaris is not the only problematic platform with CPP, HVR has started excellent 'RFC: "Native -XCPP" Proposal' thread in the past together with the wiki page: https://ghc.haskell.org/trac/ghc/wiki/Proposal/NativeCpp

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2015-12-31 Thread Ben Gamari
Karel Gardas writes: > Hi Alain, > > I guess you are hit by well known issue in GCC's CPP on Solaris. Just > verify here: > > https://gcc.gnu.org/ml/gcc/2014-08/msg00114.html > > solution in this case is simple: use configure option to set different > non buggy CPP as

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2015-12-31 Thread Alain O'Dea
Thank you Karel. I'll try that tomorrow and report back my results. On Thu, Dec 31, 2015 at 09:00 Ben Gamari wrote: > Karel Gardas writes: > > > Hi Alain, > > > > I guess you are hit by well known issue in GCC's CPP on Solaris. Just > > verify

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2015-12-31 Thread Alain O'Dea
Yes. I can do that. On SmartOS it may not be GCC 3.4.3 causing this. I see this on GCC 4.7.x through 4.9.x. The paths to gcc on SmartOS also differ. I'll have to verify that as part of checking this. I think requiring cpphs on Illumos and Solaris might be a reasonable compromise. I like the idea

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2015-12-31 Thread Karel Gardas
On 12/31/15 01:30 PM, Ben Gamari wrote: Karel Gardas writes: Hi Alain, I guess you are hit by well known issue in GCC's CPP on Solaris. Just verify here: https://gcc.gnu.org/ml/gcc/2014-08/msg00114.html solution in this case is simple: use configure option to set

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2015-12-31 Thread Alain O'Dea
cpphs isn't a direct option. It won't install on SmartOS with Cabal. GCC 4.7 is the earliest GCC supported so I'll have to try something else for SmartOS. It looks like the GCC Specs are the problem. On Ubuntu the Spec for cpp is: *cpp: %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT} On

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2015-12-31 Thread Karel Gardas
On 12/31/15 07:41 PM, Alain O'Dea wrote: Yes. I can do that. On SmartOS it may not be GCC 3.4.3 causing this. I see this on GCC 4.7.x through 4.9.x. The paths to gcc on SmartOS also differ. I'll have to verify that as part of checking this. This is misunderstanding. GCC 3.4.3 provides

Re: Flag warnings show intermediate hscpp filenames on SmartOS

2015-12-31 Thread Alain O'Dea
Thanks for the clarification. I understand now. On Thu, Dec 31, 2015 at 16:52 Karel Gardas wrote: > On 12/31/15 07:41 PM, Alain O'Dea wrote: > > Yes. I can do that. > > > > On SmartOS it may not be GCC 3.4.3 causing this. I see this on GCC 4.7.x > > through 4.9.x. The

Flag warnings show intermediate hscpp filenames on SmartOS

2015-12-30 Thread Alain O'Dea
On SmartOS GHC flag warnings show up like this: /tmp/ghc72341_0/ghc_1.hscpp:7:16: Warning: -fffi is deprecated: use -XForeignFunctionInterface or pragma {-# LANGUAGE ForeignFunctionInterface #-} instead It appears that this line in DriverPipeline leads to the correct filename in warnings on