JIT on FreeBSD ARMv7

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Andres Freund <andres(at)anarazel(dot)de>
Subject: JIT on FreeBSD ARMv7
Date: 2019-02-23 02:12:29
Message-ID: 87imxbgtm9.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This seems to be the cleanest way to get a JIT build working on FreeBSD
on the armv7 platform. Without this, it fails because the ABI functions
__aeabi_ldivmod and so on are not found by the symbol lookup for JITted
code.

It's completely unclear who (llvm, freebsd, or us) is at fault here for
it not working before; some of the LLVM code contains special-case
symbol lookups for the ARM __aeabi funcs, but only enabled when
compiling on Android; the response I got from asking about it on
#bsdmips (which despite its name is the main freebsd/arm hangout) was
"this is an ongoing mess that isn't really getting worked on". And
honestly I suspect the set of people actually trying to use LLVM for JIT
on freebsd/arm is negligible; I only did it because testing weird edge
cases is often useful.

This patch should be harmless on any 32-bit arm platform where JIT
already works, because all it's doing is forcibly preloading symbols.

Test platform details:
FreeBSD 12.0-STABLE r344243 arm
CPU: ARM Cortex-A7 (Raspberry Pi 2B)
LLVM 7.0.1 (known to fail on LLVM 6 unless you patch LLVM itself)

./configure --prefix=/data/small/andrew/pgsql \
--with-includes=/usr/local/include \
--with-libs=/usr/local/lib \
--with-openssl \
--enable-debug \
--enable-depend \
--enable-cassert \
--with-llvm \
LLVM_CONFIG=llvm-config70 \
CC="ccache clang70" \
CLANG="ccache clang70" \
CXX="ccache clang++70" \
CFLAGS="-O2 -mcpu=cortex-a7"

--
Andrew (irc:RhodiumToad)

Attachment Content-Type Size
armjit.patch text/x-patch 2.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2019-02-23 03:49:17 Re: proposal: variadic argument support for least, greatest function
Previous Message Chapman Flack 2019-02-23 01:53:51 Re: proposal: variadic argument support for least, greatest function