-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[flang] Adjust _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT for Solaris #74590
[flang] Adjust _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT for Solaris #74590
Conversation
Even after 13e2200 (Solaris lacks `femode_t`, too), the Solaris flang build is still broken: /vol/llvm/src/llvm-project/local/flang/runtime/exceptions.cpp:87:5: error: static assertion failed due to requirement 'sizeof(fenv_t) <= sizeof(int) * 8': increase ieee_status_type size 87 | sizeof(fenv_t) <= sizeof(int) * _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /vol/llvm/src/llvm-project/local/flang/runtime/exceptions.cpp:87:20: note: expression evaluates to '200 <= 32' 87 | sizeof(fenv_t) <= sizeof(int) * _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT, | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This patch fixes this by adjusting `_FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT` accordingly. Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
@llvm/pr-subscribers-flang-runtime Author: Rainer Orth (rorth) ChangesEven after 13e2200 (Solaris lacks
This patch fixes this by adjusting Tested on Full diff: https://github.com/llvm/llvm-project/pull/74590.diff 1 Files Affected:
diff --git a/flang/include/flang/Runtime/magic-numbers.h b/flang/include/flang/Runtime/magic-numbers.h
index d00d5027d4ed2..cebf9f3a65478 100644
--- a/flang/include/flang/Runtime/magic-numbers.h
+++ b/flang/include/flang/Runtime/magic-numbers.h
@@ -107,6 +107,6 @@ as int arrays with the following extents to allow build time validation of
these sizes in cross compilation environments.
#endif
#define _FORTRAN_RUNTIME_IEEE_FEMODE_T_EXTENT 2
-#define _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT 8
+#define _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT 50
#endif
|
@rorth Thanks for addressing this problem. If the solaris sizeof(fenv_t) is actually 50*4=200 bytes, that is larger than other systems. This value increase will affect memory use for all systems. Does removing this assert in
If yes, that would be a better choice for now. |
Sorry for the delay in replying: github notifications somehow don't work for me. Just removing the assertion fixes the Solaris build indeed: the testsuite results are identical to those with my patch. How should we do this properly: just add a comment in |
There is already a comment at the end of My original code for this was an assert in the compiler rather than the runtime. That nicely solves all existing issues. The problem is that we would eventually like to support cross compilation, where a front end assert doesn't work. One way to resolve this would be to allocate these objects dynamically at runtime, although that would penalize typical compilations. Eventually we might want to generate different code for local compilation vs. cross compilation. Bottom line - I'm still looking at this. For now I can live with something that allows builds to succeed. |
I can't tell from the build logs what the problem is with the solaris build invocation of lit test ieee_festatus.f90. Depending on what that problem is, you could either fix it, or disable the test for solaris if that is possible. |
I've updated the patch accordingly.
Ah, understood. Coming from GCC where the target is fixed at compiler build time, I keep forgetting that LLVM is different in this regard.
The revised patch did just that: re-tested on |
I had only seen that failure the first time I built with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working through this build issue. I'll look for a longer term fix.
Thanks.
Even after 13e2200 (Solaris lacks
femode_t
, too), the Solaris flang build is still broken:This patch fixes this by adjusting
_FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT
accordingly.Tested on
amd64-pc-solaris2.11
andsparcv9-sun-solaris2.11
.