Closed mppf closed 2 years ago
@carlocab - that's great, thanks. I see that #106925 went in but I'm not understanding what happened to fix the problem. Could you summarize? Thanks. Also I am understanding that we should be able to remove the workaround now from Chapel, so please speak up if I'm misunderstanding.
Regarding the ncurses
linkage, ncurses
itself is not a direct dependency for Chapel. And, when I check a local build or the Homebrew chpl
on an Intel Mac with otool -L
(which has different format from what you show above), I'm not seeing it. I see that the Homebrew LLVM 14 libLLVM.dylib itself depends on ncurses
, though. Maybe whatever produced the output you showed above is including the transitive dependency? (If that is the case, perhaps the ncurses
dependency was dropped for M1 when LLVM 14 went from llvm
to llvm@14
in #106925, for some reason).
I can confirm that the reproducer in this issue is no longer misbehaving for me with the updated LLVM 14 or 15 Homebrew packages.
I see that #106925 went in but I'm not understanding what happened to fix the problem. Could you summarize?
That's this one: https://github.com/Homebrew/homebrew-core/commit/d3999fcadc162f4f55b3237d5636ef3e6355738a (plus a little extra here, since I am bad at atomic commits)
brew info llvm
will also give you another hint.
Also I am understanding that we should be able to remove the workaround now from Chapel, so please speak up if I'm misunderstanding.
I think so; if by workaround you mean what you have in place to try to avoid linkage with both LLVM libc++ and Apple libc++.
Regarding the
ncurses
linkage,ncurses
itself is not a direct dependency for Chapel. And, when I check a local build or the Homebrewchpl
on an Intel Mac withotool -L
(which has different format from what you show above), I'm not seeing it. I see that the Homebrew LLVM 14 libLLVM.dylib itself depends onncurses
, though. Maybe whatever produced the output you showed above is including the transitive dependency? (If that is the case, perhaps thencurses
dependency was dropped for M1 when LLVM 14 went fromllvm
tollvm@14
in #106925, for some reason).
Yea, maybe, but all our builds of libLLVM (14, 15, ARM, Intel) link with ncurses
, so not really sure what's going on there.
See, for example, the output of brew linkage
on Monterey ARM, and Monterey Intel for both LLVM 14 and 15.
I see that #106925 went in but I'm not understanding what happened to fix the problem. Could you summarize?
That's this one: d3999fc (plus a little extra here, since I am bad at atomic commits)
brew info llvm
will also give you another hint.
OK, so the LLVM libc++ is being installed into a different directory from the LLVM install (e.g. /usr/local/opt/llvm/lib/c++
vs just /usr/local/opt/llvm/lib
).
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I'm one of the developers for the upstream Chapel project. Chapel was working with
llvm@11
but we were running into strange problems withllvm@12
andllvm@13
(see https://github.com/chapel-lang/chapel/issues/19217 ).It took me a long time but I eventually figured out that the problem was due to mixing libc++ versions. The Chapel compiler,
chpl
was linking with the libc++ included in the Homebrew LLVM package; but the LLVM and Clang libraries were linking with a libc++ provided by the system. This will occur with any program that is linking with llvm or clang libraries using the usual commands to add a-L
path for/usr/local/Cellar/llvm/13.0.1_1/lib
, including using the output of/usr/local/opt/llvm@13/bin/llvm-config --ldflags
.I have included a small reproducer example in the step-by-step section below.
What happened (include all command output)?
With the test program provided below, I get this output
What did you expect to happen?
I expected this output from the test program provided below (without the workaround):
Step-by-step reproduction instructions (by running
brew
commands)Then, I have saved the following to
pretend-in-llvm.cpp
and within it are the commands to reproduce this problem.