-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Undefined symbol _roundeven
#10475
Comments
Thank you! |
The This might have gone unnoticed because of #10110. But it seems the nightly jobs succeeded to build the compiler (artifacts). So it might be an individual issue on your end. I'm currently running a re-activated A quick would obviously be to use --- i/src/float.cr
+++ w/src/float.cr
@@ -156,7 +156,7 @@ struct Float32
def round_even : self
# LLVM 11 introduced llvm.roundeven.* intrinsics which may replace rint in
# the future.
- {% if compare_versions(Crystal::LLVM_VERSION, "11.0.0") >= 0 %}
+ {% if compare_versions(Crystal::LLVM_VERSION, "11.0.0") >= 0 && !flag?(:darwin) %}
LibM.roundeven_f32(self)
{% else %}
LibM.rint_f32(self)
@@ -257,7 +257,7 @@ struct Float64
def round_even : self
# LLVM 11 introduced llvm.roundeven.* intrinsics which may replace rint in
# the future.
- {% if compare_versions(Crystal::LLVM_VERSION, "11.0.0") >= 0 %}
+ {% if compare_versions(Crystal::LLVM_VERSION, "11.0.0") >= 0 && !flag?(:darwin) %}
LibM.roundeven_f64(self)
{% else %}
LibM.rint_f64(self) |
Indeed, the error reproduces on circleci: https://app.circleci.com/pipelines/github/crystal-lang/crystal/5401/workflows/4e3883a7-5f92-4b6c-aa4b-3bf02eb2f086/jobs/58514 I'll try to poke around with SSH on the CI runner. Don't have a mac around. |
I couldn't install LLVM 10 with brew, so I tested with LLVM 9 and that sure works. So the LLVM 10 failure needs more inspection. Could you verify that it is indeed broken? It just seems very unlikely. The patch from #10475 (comment) fixes for LLVM 11 as expected. Oh and the nightly builds still link against LLVM 6 (I think), that's why the nightly job didn't error. |
Can reproduce on darwin (macOS Big Sur), and also ran into it on one of the BSDs when I was testing #10463. (I believe it was OpenBSD. NetBSD might also be affected.) |
Given that using Put another way: let's write a benchmark for |
For reference, this is the feature review at LLVM: https://reviews.llvm.org/D75670 |
Somewhere in the first link it says:
I think it would be great to use |
Just to fill in: I think what's happening is that if LLVM doesn't have an impl for the intrinsic, it lowers to a call to So "Backends should be able to lower them all the same way" doesn't seem to be true, unfortunately. |
Yes, it's the usual unfulfilled promise of "if you use LLVM then you don't need to worry about specific platforms" 😞 |
Hello everyone! May it helps: building Crystal under Alpine, also I built LLVM from sources, release version 11.0.0. (Update: right now I compiled it with LLVM 11.1.0). Using recursive docker build that targets a master branch I got this error (note: with LLVM 11). Now for compiling compiler:
LLVM 11.1 does not supported for now but please note that I got this error also with LLVM 11.0. |
#10413 introduced
Number#round_even
which binds to the LLVM intrinsicroundeven
which was only introduced in LLVM 11. For older LLVM versions it falls back torint
.It seems that the intrinsic is not (yet) available on darwin, for some reason.
I can't compile the compiler anymore :-(
This is on Mac OSX, LLVM 11.1.0
Originally posted by @asterite in #10474 (comment)
The text was updated successfully, but these errors were encountered: