<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">FWIW the environments file causing my problem is created by "cabal install --lib ..."</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 15, 2023 at 12:15 PM George Colpitts <<a href="mailto:george.colpitts@gmail.com">george.colpitts@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Thanks for everybody's help, I have closed the <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/23211" target="_blank">issue</a>. Sorry for bothering everyone. As I wrote in the bug:</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><p dir="auto"><a title="" href="http:///adamse" target="_blank">@adamse</a>, <a title="Matthew Pickering" href="http:///mpickering" target="_blank">@mpickering</a>. You are right, there is something wrong about my environment file default. When I remove it I can compile with</p>
<div>
<pre lang="plaintext" id="m_-661189544208575052gmail-code-16"><code><span lang="plaintext" id="m_-661189544208575052gmail-LC1"> ghc -static -prof -fprof-auto hello.hs</span></code></pre>
<button type="button"></button>
</div>
<p dir="auto">The need for -static is not documented as far as I know so I will file a doc bug. My apologies for not debugging this earlier. I will keep an eye out to see when an environment file gets created. Thanks again !</p></div></blockquote></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 15, 2023 at 9:11 AM George Colpitts <<a href="mailto:george.colpitts@gmail.com" target="_blank">george.colpitts@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Forgot to add that my current workaround is to compile with "-static -package-env=-" i.e.</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">ghc  -static -package-env=- -prof -fprof-auto  hello.hs <br></div></blockquote></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Adding  just  -package-env=- i.e. gives me the same error as compiling without it. </div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"> ghc   -package-env=- -prof -fprof-auto  hello.hs <br>[1 of 2] Compiling Main             ( hello.hs, hello.o )<br><br>hello.hs:1:1: error:<br>    Could not find module ‘Prelude’<br>    Perhaps you haven't installed the "p_dyn" libraries for package ‘base-4.18.0.0’?<br>    Use -v (or `:set -v` in ghci) to see a list of the files searched for.<br>  |<br>1 | <br>  | ^<br></div></blockquote></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Adding just -static gives </div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"> ghc   -static -prof -fprof-auto  hello.hs <br>Loaded package environment from /Users/gcolpitts/.ghc/x86_64-darwin-9.6.1/environments/default<br>[1 of 2] Compiling Main             ( hello.hs, hello.o ) [Missing object file]<br>[2 of 2] Linking hello<br>ld: warning: directory not found for option '-L/opt/local/lib/'<br>ld: library not found for -lHStxmth-0.12.7.1-f954854b_p<br>clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>ghc-9.6.1: `gcc' failed in phase `Linker'. (Exit code: 1)<br></div></blockquote></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">I can't find any doc saying that -static is required for profiling on the Mac but perhaps that is the case?</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 14, 2023 at 3:43 PM George Colpitts <<a href="mailto:george.colpitts@gmail.com" target="_blank">george.colpitts@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><div class="gmail_default">Is anybody on 9.6.1 having problems profiling on a Mac? As I reported in <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/23211" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/issues/23211</a> </div><div class="gmail_default" style="font-family:Arial,Helvetica,sans-serif;font-size:small"><blockquote style="font-family:"times new roman",serif;font-size:large;margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default"><h2 dir="auto"></h2><p dir="auto"><code>ghc -prof -fprof-auto hello.hs</code><br></p></div></blockquote><font face="times new roman, serif" size="4">where the file hello.hs consists of the line: </font></div><div class="gmail_default" style="font-family:Arial,Helvetica,sans-serif;font-size:small"><font face="times new roman, serif" size="4"><br></font></div><blockquote style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default"><font face="times new roman, serif" size="4">main = print "hello"</font></div><br></blockquote><div class="gmail_default">gets the error:</div><div class="gmail_default"><br></div><blockquote style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:"times new roman",serif"><span style="font-family:Arial,Helvetica,sans-serif"><font size="4">Could not find module ‘Prelude’</font></span></div></blockquote><blockquote style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px 40px;border:none;padding:0px"><font size="4"> Perhaps you haven't installed the "p_dyn" libraries for package ‘base-4.18.0.0’?</font></blockquote><blockquote style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div></blockquote><div class="gmail_default" style="font-family:Arial,Helvetica,sans-serif;font-size:small"><font face="times new roman, serif" size="4">It seems to me like a regression of the closed bug </font><span style="font-family:"times new roman",serif;font-size:large"><a href="https://gitlab.haskell.org/ghc/ghc/-/issues/20707" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/issues/20707</a>. </span></div><div class="gmail_default" style="font-family:Arial,Helvetica,sans-serif;font-size:small"><span style="font-family:"times new roman",serif;font-size:large"><br></span></div><div class="gmail_default" style="font-family:Arial,Helvetica,sans-serif;font-size:small"><span style="font-family:"times new roman",serif;font-size:large">Thanks</span></div><div class="gmail_default" style="font-family:Arial,Helvetica,sans-serif;font-size:small"><span style="font-family:"times new roman",serif;font-size:large">George</span></div><blockquote style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px 40px;border:none;padding:0px"><br></blockquote></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>