<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Greg,<div><br></div><div>Unfortunately there is no API to avoid the error message. The only way to avoid it would be to patch LLVM 8. The patch itself is simple: On OrcCBindingsStack.h line 455 (See <a href="https://github.com/llvm/llvm-project/blob/89de0d8dfbb9a6ff1f8b141ed70b563ecc094878/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h#L455">https://github.com/llvm/llvm-project/blob/89de0d8dfbb9a6ff1f8b141ed70b563ecc094878/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h#L455</a>) you just need to replace</div><div><br></div><div><font face="monospace">logAllUnhandledErrors(CCMgr.takeError(), errs(), "ORC error: ");</font><br></div><div><br></div><div>with</div><div><br></div><div><font face="monospace">consumeError(CCMgr.takeError());</font></div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">It seems to me that the newer ORC APIs only exist in LLVM10. Were the older ORC APIs deprecated in LLVM10 only?</blockquote><div><br></div><div>Yes. The old APIs were deprecated in 10 and will remain deprecated (but present) in LLVM 11. I aim to remove them before LLVM 12. </div></div><div><br></div><div>Regards,</div><div>Lang.</div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 20, 2020 at 2:19 AM Greg Nancarrow <<a href="mailto:gregn4422@gmail.com">gregn4422@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi Lang,<br>
<br>
Thanks for your reply.<br>
I work on a product that is largely based on Postgres but we do<br>
contribute the odd fix/improvement/feature to the open-source Postgres<br>
where we can.<br>
<br>
It seems to me that the newer ORC APIs only exist in LLVM10.<br>
Were the older ORC APIs deprecated in LLVM10 only?<br>
Unfortunately our product has a dependency on LLVM8 (e.g. on RHEL8 on<br>
the systemz platform, the default LLVM version installed by the system<br>
package manager "yum" is version 8).<br>
For LLVM8, is there any other API that can be used to avoid the LLVM<br>
"No callback manager available" error seen on systemz?<br>
<br>
Regards,<br>
Greg<br>
<br>
On Thu, Jul 9, 2020 at 2:29 PM Lang Hames <<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>> wrote:<br>
><br>
> Hi Greg,<br>
><br>
> Thanks for your patience.<br>
><br>
>> Looking through the LLVM source code, it appears that for the<br>
>> "systemz" architecture, there is currently no local CCMgr<br>
>> implementation available, and this then prevents indirection support<br>
>> and COD layer support. BUT - apparently it can still function (maybe<br>
>> less efficiently?) without these?<br>
>> Is somebody able to clarify exactly what that error message means and<br>
>> what the limitations are? Is it unwise to use LLVM on architectures on<br>
>> which this error is reported?<br>
>> I looked through the LLVM V10 source code and there still seems to be<br>
>> this issue for systemz.<br>
><br>
><br>
> You are correct: The error is generated when a call is made to the createLocalCompileCallbackManager function. Platforms that don't support a callback manager (yet) can not use lazy compilation, but can still JIT whole modules.<br>
><br>
> I suspect that postgres is using the older ORC C bindings. These always try to enable lazy compilation support and direct any errors to stderr. Postgress probably isn't using the lazy compilation support anyway, which is why everything works just fine despite the error.<br>
><br>
> These older APIs are deprecated, so the best solution would be for postgres to move to the newer C APIs (see <a href="https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm-c/Orc.h" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm-c/Orc.h</a>).<br>
><br>
> Are you working on Postgres yourself, or just building it?<br>
><br>
> Regards,<br>
> Lang.<br>
><br>
> On Thu, Jun 25, 2020 at 4:49 AM Greg Nancarrow via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> Hi LLVM Developers,<br>
>><br>
>> I have a query about an LLVM error message that I'm encountering and I<br>
>> hope it's appropriate to post to this mailing list about it.<br>
>><br>
>> Postgres can be built with LLVM-based JIT support.<br>
>> I find that when running on Linux (RHEL8) on IBM Z hardware, using<br>
>> LLVM8+, I'm seeing many instances of the following LLVM error message<br>
>> appearing in the Postgres server log:<br>
>><br>
>> ORC error: No callback manager available for s390x-ibm-linux<br>
>><br>
>> (strangely, it otherwise doesn't seem to be causing any problems)<br>
>><br>
>> Looking through the LLVM source code, it appears that for the<br>
>> "systemz" architecture, there is currently no local CCMgr<br>
>> implementation available, and this then prevents indirection support<br>
>> and COD layer support. BUT - apparently it can still function (maybe<br>
>> less efficiently?) without these?<br>
>> Is somebody able to clarify exactly what that error message means and<br>
>> what the limitations are? Is it unwise to use LLVM on architectures on<br>
>> which this error is reported?<br>
>> I looked through the LLVM V10 source code and there still seems to be<br>
>> this issue for systemz.<br>
>><br>
>> Secondly, LLVM sends this error message to standard error. As a caller<br>
>> of the LLVM library, it would be nice to be able to redirect such<br>
>> messages from the library - is it possible?<br>
>><br>
>> Hope you can advise,<br>
>> Greg<br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>