+FATAL: fatal llvm error: Relocation type not implemented yet! +server closed the connection unexpectedly + This probably means the server terminated abnormally + before or while processing the request. +connection to server was lost This should be specific to riscv. USE=llvm enables llvm orc jit. The llvm orc jit api is fully (or nearly) supported on riscv since llvm 14.0.1, but unfortunately in both postgresql and inside orc jit abi, it uses llvm helper function LLVMGetHostCPUFeatures to detect host cpu features (e.g. https://github.com/postgres/postgres/blob/5bcc4d09332844ae369bcf99f18ace1c982b7301/src/backend/jit/llvm/llvmjit.c#L818) LLVMGetHostCPUFeatures is not implemented at all on riscv, therefore no feature will be enabled except the most generic ones for rv[64|32]-generic. Reproducible: Always
Created attachment 779168 [details] emerge --info
Created attachment 779171 [details] build log
Created attachment 779174 [details] regression diffs
Looking more into the code. "Relocation type not implemented yet" comes from uostream using the old jit linker RTDyldObjectLinkingLayer, which is in maintainence mode and has no riscv support. https://github.com/postgres/postgres/blob/07d683b54af854098cc559d4b8640905f9efa0ea/src/backend/jit/llvm/llvmjit.c#L1161 We need to wait upstream to upgrade to jitlink that is a newer replacement for rtdylib.