Hi, On 03/29/2018 11:03 AM, Pierre Ducroquet wrote:
Clang is needed to emit the LLVM bitcode required for inlining. The "-emit- llvm" flag is used for that. A dual compilation is required for inlining to work, one compilation with gcc/clang/msvc/… to build the postgresql binary, one with clang to generate the .bc files for inlining. It can be surprising, but there is little way around that (or we accept only clang to build postgresql, but there would be a riot).
Thanks Pierre. Best regards, Jesper
diff --git a/src/backend/jit/README b/src/backend/jit/README index bfed319189..dca4aa761c 100644 --- a/src/backend/jit/README +++ b/src/backend/jit/README @@ -55,6 +55,9 @@ unlikely to be discontinued, because it has a license compatible with PostgreSQL, and because its LLVM IR can be generated from C using the clang compiler. +clang will be used to compile files where LLVM bitcode is required to +inline functions using the -emit-llvm flag. This may cause PostgreSQL +to be compiled with multiple compilers, such as gcc and clang. Shared Library Separation -------------------------