I got this error when building 3.3.4 on Fedora rawhide:
/bin/sh ../libtool --tag=CC --mode=link gcc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DWITH_OPENLDAP -I/usr/include/nspr4 -I/usr/include/nss3 -I/usr/include/nspr4 -DUSE_OPENLDAP -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -llber -lldap_r -lverto -lkrad -pie -Wl,-z,relro -Wl,-z,now -o ipa-otpd bind.o forward.o main.o parse.o query.o queue.o stdio.o -lkrad -lkrb5 libtool: link: gcc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DWITH_OPENLDAP -I/usr/include/nspr4 -I/usr/include/nss3 -I/usr/include/nspr4 -DUSE_OPENLDAP -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pie -Wl,-z -Wl,relro -Wl,-z -Wl,now -o ipa-otpd bind.o forward.o main.o parse.o query.o queue.o stdio.o -llber -lldap_r -lverto -lkrad -lkrb5 /usr/bin/ld: bind.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC bind.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status make[3]: *** [ipa-otpd] Error 1
attachment build.log
Lukas, you have proven knowledge in a C build process. Any advise on this one?
compiler falgs "-fPIC -DPIC" are missing, but only in subdirectory /freeipa-3.3.4/daemons/ipa-otpd
It is really strange. I try to rebuild freeipa-3.3.4-1.fc20.src.rpm in mock and there aren't any errors. I also executed scratch build without any problem with architecture x86_64 http://koji.fedoraproject.org/koji/taskinfo?taskID=6463776
I would try to build one more time :-)
I sent a message to the list about it:
https://lists.fedoraproject.org/pipermail/devel/2014-January/194807.html
There is difference between official rawhide build http://koji.fedoraproject.org/koji/taskinfo?taskID=6464096 and my scratch build http://koji.fedoraproject.org/koji/taskinfo?taskID=6463776
My scratch build contains additional argument in CFLAGS "-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1"
This file should be provided by package
rpm -qf /usr/lib/rpm/redhat/redhat-hardened-cc1 redhat-rpm-config-9.1.0-56.fc21.noarch
Package was installed in both builds. I don't why additional argument was not included into CFLAGS
See related discussion on freeipa-devel.
In the end, this was fixed in ipa-3-3 branch by removing explicit hardening flags (already done in master):
ipa-3-3:[[BR]] 2d90c13 Include LDFLAGS provided by rpmbuild in global LDFLAGS in the spec file.[[BR]]
Metadata Update from @mkosek: - Issue assigned to lslebodn - Issue set to the milestone: FreeIPA 3.3.x - 2014/01 (bug fixing)
Login to comment on this ticket.