-fPIE -pie builds fail

Ondřej Surý ondrej at sury.org
Tue Mar 29 03:56:15 EDT 2011


Hi,

I am trying to enable hardening-wrapper for cyrus-imapd-2.4
(http://wiki.debian.org/Hardening) and I had to disable HARDENING_PIE
because the build failed on:

gcc -L/usr/lib -L/usr/lib  -lpthread -o sievec sievec.o libsieve.a
../lib/libcyrus.a ../lib/libcyrus_min.a  libsieve.a -L/usr/lib
-lsasl2  -ldl  -lfl   -L/usr/lib  -ldb-5.1 -lssl -lcrypto -lz
/usr/lib/libcom_err.a
/usr/bin/ld.bfd.real: /usr/lib/libcom_err.a(error_message.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
/usr/lib/libcom_err.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

It looks like the problem is linking to a static libcom_err.a library.
Does anyone remember why you need to link to a static library here?

I guess you want a static lib from the configure.in comment:

COM_ERR_LIBS="-lcom_err" # hope it's not shared

Ondrej
-- 
Ondřej Surý <ondrej at sury.org>


More information about the Cyrus-devel mailing list