Compiling via LLVM and active LTO

From: Sapd <sapd(at)sapd(dot)eu>
To: pgsql-general(at)postgresql(dot)org
Subject: Compiling via LLVM and active LTO
Date: 2020-02-17 10:48:57
Message-ID: 1581936537572-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I want to do some performance measures and have problems compiling postgres
with LTO activated. I tried it with postgresql 12.0 and 12.2, yielding both
the same result. The errors seem to relate to languages and
encoding-functions. The linker simply seems unable to find them. Also it
does not matter, wether I use the thin LTO or the full LLVM LTO.

Normal compilation (without any additional CFLAGS) works.

-------- System data
Mac OS X Catalina
llvm 8
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0

-------- Configuration
./configure --prefix=../dist CFLAGS="-flto=thin -O3"

-------- Error message (created by linker)
undef: _pg_mic2ascii
undef: _check_encoding_conversion_args
undef: _pg_ascii2mic
Undefined symbols for architecture x86_64:
"_pg_mic2ascii", referenced from:
_mic_to_ascii in lto.o
"_check_encoding_conversion_args", referenced from:
_ascii_to_mic in lto.o
_mic_to_ascii in lto.o
"_pg_ascii2mic", referenced from:
_ascii_to_mic in lto.o
----
undef: _LocalToUtf
undef: _check_encoding_conversion_args
undef: _UtfToLocal
Undefined symbols for architecture x86_64:
"_LocalToUtf", referenced from:
_koi8r_to_utf8 in lto.o
_koi8u_to_utf8 in lto.o
"_check_encoding_conversion_args", referenced from:
_utf8_to_koi8r in lto.o
_koi8r_to_utf8 in lto.o
_utf8_to_koi8u in lto.o
_koi8u_to_utf8 in lto.o
"_UtfToLocal", referenced from:
_utf8_to_koi8r in lto.o
_utf8_to_koi8u in lto.o

--
Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

Browse pgsql-general by date

  From Date Subject
Next Message Nick Renders 2020-02-17 11:32:29 Re: PL/pgSQL question about EXCEPTION clause & corrupt records
Previous Message Loai Abdallatif 2020-02-17 09:50:01 Postgres error