Re: Building PosgresSQL with LLVM fails on Solaris 11.4

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Building PosgresSQL with LLVM fails on Solaris 11.4
Дата
Msg-id 20231201194904.7f2iuxnhmmrcqnml@awork3.anarazel.de
обсуждение исходный текст
Ответ на Building PosgresSQL with LLVM fails on Solaris 11.4  (Sacha Hottinger <itdo@cndag.onmicrosoft.com>)
Ответы AW: Building PosgresSQL with LLVM fails on Solaris 11.4  (Sacha Hottinger <itdo@cndag.onmicrosoft.com>)
Список pgsql-hackers
Hi,

On 2023-12-01 17:02:25 +0000, Sacha Hottinger wrote:
> Compiling PostgreSQL 13.13 with option –with-llvm fails with Developer Studio 12.6 as well as with gcc 13.2.0.
> I have installed the developer/llvm/clang" + "developer/llvm/clang-build pkgs (13.0.1).

Uh, huh. I did not expect that anybody would ever really do that on
solaris. Not that the breakage was intentional, that's a separate issue.

Is this on x86-64 or sparc?


I'm somewhat confused that you report this to happen with gcc as well. We
don't use .s files there. Oh, I guess you see a different error
there:

> o With gcc (psql 13.13):
>
> #./configure CC='/usr/bin/gcc -m64' --with-system-tzdata=/usr/share/lib/zoneinfo --with-llvm
>
> # time gmake all
> ...
> -Wl,--as-needed -Wl,-R'/usr/local/pgsql/lib'  -lLLVM-13
> Undefined                       first referenced
> symbol                             in file
> TTSOpsHeapTuple                     llvmjit_deform.o
> pfree                               llvmjit.o
> …
> MemoryContextAllocZero              llvmjit.o
> pkglib_path                         llvmjit.o
> ExecEvalStepOp                      llvmjit_expr.o
> errhidestmt                         llvmjit.o
> ld: warning: symbol referencing errors

This is odd. I think this is when building llvmjit.so - unfortunately there's
not enough details to figure out what's wrong here.

Oh, one thing that might be going wrong is that you just set the C compiler to
be gcc, but not C++ - what happens if you addtionally set CXX to g++?



I did not think about .o files generated from .s when writing the make
infrastructure for JITing.  At first I thought the easiest solution would be
to just add a rule to build .bc from .s - but that doesn't work in the
sunstudio case, because it relies on preprocessor logic that's specific to sun
studio - which clang can't parse. Gah.

Thus the attached hack - I think that should work.  It'd mostly be interesting
to see if this is the only roadblock or if there's more.


To be honest, the only case where .s files matter today is building with sun
studio, and that's a compiler we're planning to remove support for. So I'm not
sure it's worth fixing, if it adds complexity.

Greetings,

Andres Freund

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: Emitting JSON to file using COPY TO
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Dumped SQL failed to execute with ERROR "GROUP BY position -1 is not in select list"