Skip to content

For s390x issue a warning if LLVM 9 or older is used

For s390x the GHC calling convention is implemented in LLVM commit 22f9429149a which will be included in the upcoming LLVM version 10.

The s390x backend of LLVM silently fallbacks to the C calling convention for any calling convention which is not implemented. Thus, prior to LLVM 10, any function using GHC calling convention will be silently translated using C calling convention. This obviously leads to broken object files which will result in segfaults at run-time.

Issuing a warning in case LLVM version 9 or older is used, might help users. I decided to issue a warning at run-time and not at compile-time e.g. via autotools since the llc/opt commands may be overwritten at run-time (see -pgmlc and -pgmlo). I decided against throwing an error since I'm not sure if someone will backport the LLVM GHC CC to any version older than 10. Any comments?

Merge request reports