Re: Segfault in jit tuple deforming on arm64 due to LLVM issue

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-10-31T05:48:54Z
Lists: pgsql-hackers

Attachments

On Thu, Oct 17, 2024 at 10:41 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> Thanks!  I'm going to go ahead and commit this.

(Sorry for the delay, I got distracted by pgconf.eu.)

Today I set out to commit this patch, and wrote a proper commit
message to explain the code provenance, circumstances that led to it,
and the future conditions that will allow us to delete it in a few
years.  Please see attached.  In the process I struck a potential
snag:

https://llvm.org/LICENSE.txt
https://en.wikipedia.org/wiki/Apache_License

There are a couple of cases of dual-licensed code in our tree where we
explicitly used the Boost alternative instead of Apache 2.  I plead
complete ignorance of this topic and defer to those who know about
such things: can we actually do this?  I guess at a minimum a copy of
the licence would need to appear somewhere -- perhaps under
src/backend/jit/llvm?  4d says that if you modified the code you have
to say so prominently, but I did that at the top (and the changes are
completely trivial, just some #ifdef swizzling to massage some
function prototypes to suit older LLVMs).  Otherwise I understand it
to be generally "BSD-like" (sans advert clause) but there is also some
stuff about patents, which surely aren't relevant to this in
practice... but I know that some projects object to it on principle
and because it smells like contract law, or something.... not an area
I am well informed about.  Who should I be asking? (Naively, I
wondered: could there be some kind of fair use concept for
back-patching fixes to broken libraries that you're merely a user of
where you can be excused from the burdens of a distributor?  Yeah
wishful thinking I'm sure.)

Commits

  1. Monkey-patch LLVM code to fix ARM relocation bug.