<div dir="ltr">Okay Karel.  I have a solution that works to make T2464 pass.<div><br></div><div>Create overridecpp.spec:</div><div><br></div><div><div>*cpp:</div><div>%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}</div></div><div><br></div><div>Create ghc-cpp and make it executable:</div><div><br></div><div>#!/bin/bash</div><div>gcc -spec=/path/to/overridecpp.spec $@</div><div><br></div><div>Configure and make GHC with ghc-cpp and run T2464:</div><div><br></div><div>./configure --with-hs-cpp=/path/to/ghc-cpp</div><div>make -j8</div><div>make TEST=T2464 test</div><div><br></div><div>This should work on Solaris 11 as well.</div><div><br></div><div>So GHC could ship a GCC Specs file like this and that wrapper script as an interim solution.  In the interim I'll include these as patches in PKGSRC and get a GHC 7.10.3 built with them applied.  I'm going to hold off on PKGSRC stuff until I get fixes for more of the failing tests though.</div><div><br></div><div>Does this seem like a reasonable solution to you?</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jan 1, 2016 at 4:58 PM Alain O'Dea <<a href="mailto:alain.odea@gmail.com">alain.odea@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Actually Karel, if "gcc -dumpspecs" shows you that same -P as I get you can override it with spec files as described here:<div><a href="https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html" target="_blank">https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html</a><br></div><div><br></div><div>I think this means that you could specify "gcc -specs=/path/to/overridecpp.spec" as --with-hs-cpp when building GHC.  I'm trying that now.  I've already gotten a strawman example based on your post to the GCC list working, and I'm going to try to expand on it.</div></div><div dir="ltr"><div dir="ltr"><div><br><div><div class="gmail_quote"><div dir="ltr">On Fri, Jan 1, 2016 at 3:08 PM Alain O'Dea <<a href="mailto:alain.odea@gmail.com" target="_blank">alain.odea@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="white-space:pre-wrap">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.<br><br>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 your best bet and using GCC 3.4's works for you.   If I can get cpphs working that may be the common ground needed to keep Illumos and Solaris support from diverging.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jan 1, 2016 at 7:52 AM Karel Gardas <<a href="mailto:karel.gardas@centrum.cz" target="_blank">karel.gardas@centrum.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Alain,<br>
<br>
indeed, on SmartOS you are free to modify the supplied GCC so the fix to<br>
remove -P is most natural one. On the other hand I'm not so lucky with<br>
binary Solaris 11.x distribution provided by Oracle so I need to use not<br>
so clean and nice workarounds...<br>
<br>
Karel<br>
<br>
On 01/ 1/16 12:17 AM, Alain O'Dea wrote:<br>
> cpphs isn't a direct option.  It won't install on SmartOS with Cabal.<br>
> GCC 4.7 is the earliest GCC supported so I'll have to try something else<br>
> for SmartOS.<br>
><br>
> It looks like the GCC Specs are the problem.<br>
><br>
> On Ubuntu the Spec for cpp is:<br>
><br>
> *cpp:<br>
> %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}<br>
><br>
> On SmartOS the Spec for cpp is:<br>
><br>
> *cpp:<br>
> %{,assembler-with-cpp:-P} %(cpp_subtarget)<br>
><br>
> I think this is how the -P gets injected.  I think this is correctable.<br>
> I had a similar issue with -std=c99 which is the default for C compiling<br>
> on Ubuntu but not on SmartOS leading to issues with compiling source<br>
> that isn't old school C (like persistent-sqlite).<br>
><br>
> Anyways I must retire from this and entertain my guests.  Happy New Year<br>
> folks.<br>
><br>
><br>
> On Thu, Dec 31, 2015 at 5:19 PM Alain O'Dea <<a href="mailto:alain.odea@gmail.com" target="_blank">alain.odea@gmail.com</a><br>
> <mailto:<a href="mailto:alain.odea@gmail.com" target="_blank">alain.odea@gmail.com</a>>> wrote:<br>
><br>
>     Thanks for the clarification. I understand now.<br>
>     On Thu, Dec 31, 2015 at 16:52 Karel Gardas <<a href="mailto:karel.gardas@centrum.cz" target="_blank">karel.gardas@centrum.cz</a><br>
>     <mailto:<a href="mailto:karel.gardas@centrum.cz" target="_blank">karel.gardas@centrum.cz</a>>> wrote:<br>
><br>
>         On 12/31/15 07:41 PM, Alain O'Dea wrote:<br>
>          > Yes. I can do that.<br>
>          ><br>
>          > On SmartOS it may not be GCC 3.4.3 causing this. I see this<br>
>         on GCC 4.7.x<br>
>          > through 4.9.x. The paths to gcc on SmartOS also differ. I'll<br>
>         have to<br>
>          > verify that as part of checking this.<br>
><br>
>         This is misunderstanding. GCC 3.4.3 provides *correct* CPP behavior,<br>
>         while all 4.x provides broken CPP. That means as a workaround<br>
>         when GCC<br>
>         3.4.3 is installed I set it as GHC's CPP automatically on<br>
>         Solaris. When<br>
>         it is not available, then GHC behaves like you've seen when<br>
>         using CPP...<br>
><br>
>         Hopefully this is more clear now,<br>
><br>
>         Karel<br>
><br>
<br>
</blockquote></div></blockquote></div></div></div></div></div></blockquote></div>