On 03/07/2014 10:04 PM, Ken Moffat wrote: > On Fri, Mar 07, 2014 at 05:37:22PM +0000, Ken Moffat wrote: >> On Fri, Mar 07, 2014 at 04:17:29PM +0100, Sergei Antonov wrote: >>> Hello! >>> I follow this instruction to build Cyrus SASL-2.1.26: >>> http://www.linuxfromscratch.org/blfs/view/svn/postlfs/cyrus-sasl.html >>> >>> "make -j1" results in a link error about PIC: >>> >>> libtool: link: gcc -shared -fPIC -DPIC .libs/sasldb.o >>> .libs/sasldb_init.o .libs/plugin_common.o -Wl,--whole-archive >>> ../sasldb/.libs/libsasldb.a -Wl,--no-whole-archive -ldb -lresolv -O2 >>> -Wl,-soname -Wl,libsasldb.so.3 -o .libs/libsasld >>> b.so.3.0.0 >>> /usr/bin/ld: ../sasldb/.libs/libsasldb.a(allockey.o): relocation >>> R_X86_64_32 against `.rodata.str1.1' can not be used when making a >>> shared object; recompile with -fPIC >>> ../sasldb/.libs/libsasldb.a(allockey.o): could not read symbols: Bad value >>> collect2: error: ld returned 1 exit status >>> >>> What may cause this? >>> >> The cause is as it says. On 32-bit x86 you can build shared >> objects using static libs compiled without -fPIC, on 64-nit x86 you >> cannot. I guess that whoever originally updated the book was using >> i686. Once upon a time, many packages had similar problems, but most >> have now been fixed upstream. >> >> I did notice that I build it by passing CFLAGS=-fPIC at the end of >> my configure command, but I forgot to check if that was necessary >> (it isn't a package I _use_). >> >> My bad, seems something like that _is_ needed on x86_64. > > And looking back, we had CFLAGS=-fPIC at the end of configure in > BLFS-7.4, but without an explanation. > > It fell out in r12739 when Fernando applied a fix from Armin. The > fPIC seems to have come in at r11674, amongst some tagging for 7.4. > I'll put it back, and add an explanation. >>> >>> And a slight correction: && is missing after "pushd saslauthd" and >>> "popd" build commands. >> >> Yes, for consistency. >> >> Unless anyone else is interested I'll take a look, maybe some time >> this weekend. >> >> ĸen >> -- >> das eine Mal als Tragödie, dieses Mal als Farce >> -- >> http://linuxfromscratch.org/mailman/listinfo/blfs-support >> FAQ: http://www.linuxfromscratch.org/blfs/faq.html >> Unsubscribe: See the above information page >
I still can't reproduce it. I have -fPIC in my cflags even if I don't specify them. make[2]: Entering directory '/home/armin/src/cyrus-sasl-2.1.26/sasldb' /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -DOBSOLETE_CRAM_ATTR=1 -Wall -W -g -O2 -MT allockey.lo -MD -MP -MF .deps/allockey.Tpo -c -o allockey.lo allockey.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -DOBSOLETE_CRAM_ATTR=1 -Wall -W -g -O2 -MT allockey.lo -MD -MP -MF .deps/allockey.Tpo -c allockey.c -fPIC -DPIC -o .libs/allockey.o mv -f .deps/allockey.Tpo .deps/allockey.Plo /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -DOBSOLETE_CRAM_ATTR=1 -Wall -W -g -O2 -MT db_berkeley.lo -MD -MP -MF .deps/db_berkeley.Tpo -c -o db_berkeley.lo db_berkeley.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -DOBSOLETE_CRAM_ATTR=1 -Wall -W -g -O2 -MT db_berkeley.lo -MD -MP -MF .deps/db_berkeley.Tpo -c db_berkeley.c -fPIC -DPIC -o .libs/db_berkeley.o mv -f .deps/db_berkeley.Tpo .deps/db_berkeley.Plo /bin/sh ../libtool --tag=CC --mode=link gcc -Wall -W -g -O2 -o libsasldb.la allockey.lo db_berkeley.lo -ldb -lresolv libtool: link: ar cru .libs/libsasldb.a .libs/allockey.o .libs/db_berkeley.o libtool: link: ranlib .libs/libsasldb.a libtool: link: ( cd ".libs" && rm -f "libsasldb.la" && ln -s "../libsasldb.la" "libsasldb.la" ) -- Note: My last name is not Krejzi. -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page