From: TalGloz <glozmantal@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: Linker errors while creating a PostgreSQL C extension function.
Date: Sun, 19 Aug 2018 11:48:36 -0700 (MST)
Message-ID: <1534704516779-0.post@n3.nabble.com> (raw)
In-Reply-To: <2455c526-58ab-4f2b-a9c0-f2b2890ca365@manitou-mail.org>
References: <1534676183995-0.post@n3.nabble.com>
<CAAfz9KOKj2rqsd6fBeqEcvMCMNMvcxK7S7AgF+rtmTiP9z27iQ@mail.gmail.com>
<1534680422044-0.post@n3.nabble.com>
<2455c526-58ab-4f2b-a9c0-f2b2890ca365@manitou-mail.org>
Thanks, that did the trick. But now I'm getting this
g++ -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o
-L/usr/pgsql-10/lib -L/usr/lib64 -Wl,--as-needed
-Wl,-rpath,'/usr/pgsql-10/lib',--enable-new-dtags -L/usr/local/lib -lseal
-pthread
/usr/bin/ld: /usr/lib64/libseal.a(bigpoly.cpp.o): relocation R_X86_64_32
against `.rodata.str1.1' can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(biguint.cpp.o): relocation R_X86_64_32
against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(ciphertext.cpp.o): relocation R_X86_64_32
against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(context.cpp.o): relocation R_X86_64_32
against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(encoder.cpp.o): relocation R_X86_64_32S
against symbol `_ZTVN4seal14IntegerEncoderE' can not be used when making a
shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(encryptionparams.cpp.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared
object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(evaluator.cpp.o): relocation R_X86_64_32
against `.rodata.str1.8' can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(plaintext.cpp.o): relocation R_X86_64_32
against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(randomgen.cpp.o): relocation R_X86_64_32S
against symbol `_ZTVN4seal21StandardRandomAdapterISt13random_deviceEE' can
not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(smallmodulus.cpp.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared
object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(baseconverter.cpp.o): relocation
R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be
used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(globals.cpp.o): relocation R_X86_64_32
against `.bss' can not be used when making a shared object; recompile with
-fPIC
/usr/bin/ld: /usr/lib64/libseal.a(hash.cpp.o): relocation R_X86_64_32
against symbol `_ZN4seal4util12HashFunction17sha3_round_constsE' can not be
used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(mempool.cpp.o): relocation R_X86_64_32S
against symbol `_ZTVN4seal4util12MemoryPoolSTE' can not be used when making
a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(modulus.cpp.o): relocation R_X86_64_32
against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(smallntt.cpp.o): relocation R_X86_64_32
against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(uintarith.cpp.o): relocation R_X86_64_32S
against `.rodata' can not be used when making a shared object; recompile
with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(uintarithsmallmod.cpp.o): relocation
R_X86_64_32 against `.bss' can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: /usr/lib64/libseal.a(uintcore.cpp.o): relocation R_X86_64_32
against `.rodata.str1.1' can not be used when making a shared object;
recompile with -fPIC
Do I have to replace my -shared in the link command with -fPIC?
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: glozmantal@gmail.com
Subject: Re: Linker errors while creating a PostgreSQL C extension function.
In-Reply-To: <1534704516779-0.post@n3.nabble.com>
References: <1534676183995-0.post@n3.nabble.com> <CAAfz9KOKj2rqsd6fBeqEcvMCMNMvcxK7S7AgF+rtmTiP9z27iQ@mail.gmail.com> <1534680422044-0.post@n3.nabble.com> <2455c526-58ab-4f2b-a9c0-f2b2890ca365@manitou-mail.org> <1534704516779-0.post@n3.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox