Closed theory closed 4 months ago
The error message is LLVM reporting the backend can't handle the particular form of "probe-stack" attribute in the input LLVM IR. So this is likely a bug in the way postgres is generating LLVM IR: please file a bug against Postgres. (Feel free to reopen if you have some reason to believe the issue is on the LLVM side.)
Thanks. I took that back to them, and @anarazel figured it out right away. Turns out I was using Homebrew LLVM but macOS Clang in /usr/bin
. Passing CLANG=/opt/homebrew/opt/llvm/bin/clang
to configure
fixed the issue.
Kinda wish now the LLVM shipped with the Mac developer tools.
I don't remember the exact history, but the reason we historically allowed these to diverge is that it historically wasn't easy to get clang matching LLVM versions. There were platforms where the available clang used a different version of LLVM than the available libllvm to link against. Also, historically, the breakages on the bitcode level seemed far less frequent these days, so using a different clang than the llvm version used to cause a lot fewer issues...
I found #57171, but I think that's included in recent releases, yes? I'm using llvm 18.1.7 (installed via Homebrew) and seeing this runtime error crashing Postgres during
make check
.I'm building from postgres/postgres@81d20fb but also saw it in postgres/postgres@REL_16_STABLE (the Postgres 16 stable branch), so I don't believe it's an issue in Postres.
Build on a MacBook Pro with M1 CPU using Homebrew-installed libraries for readline, openssl, libxml2, ICU, and LLVM. The build script:
All tests pass with this configuration. However, if I uncomment the LLVM lines,
make check
fails:The only oddity I noticed during compilation was this warning (repeated many times):
Not sure if that's related. I also upgraded from llvm 18.1.6 to 18.1.7 and tried again, with the same results. See the successful build, the failed build, the upgrade of llvm, and another failed build in this gist:
https://gist.github.com/theory/347540b8c9bec569971c9f5661df69c3
I don't know where to find a crash log, alas. Its log output is:
Other details: