Summary: | R_PPC_REL24 relocs are not allowed in ppc32 shared libs | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Olaf Hering <gentoo> |
Component: | Current packages | Assignee: | Jonathan Nall <nall> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | azarah, nall |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | PPC | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Olaf Hering
2003-01-01 12:14:48 UTC
Thanks Olaf, will look into this stuff :) a workaround that can be applied right away on 4.2 looks like that. 4.3pre does still need it, too. But it already has some infrastructure to pass -fPIC depending on the arch, its just poorly used or buggy. Index: config/cf/Library.tmpl =================================================================== RCS file: /cvs/xc/config/cf/Library.tmpl,v retrieving revision 3.20 diff -u -r3.20 Library.tmpl --- config/cf/Library.tmpl 2002/11/25 14:04:47 3.20 +++ config/cf/Library.tmpl 2003/01/02 12:34:17 @@ -304,8 +304,8 @@ _NormalLibMkdir() @@\ _ExtraLibMkdir() @@\ @@\ -_CompileObj(.c.Osuf:,$(_NOOP_)) @@\ -_CompileObjCplusplus(.SRCsuf.Osuf:,$(_NOOP_)) @@\ +_CompileObj(.c.Osuf:,$(PICFLAGS)) @@\ +_CompileObjCplusplus(.SRCsuf.Osuf:,$(CXXPICFLAGS)) @@\ @@\ clean:: @@\ _DebuggedCleanDir() @@\ Ahh yep thanks. This is fixed up in the xfree-4.2.1-r2 ebuild, but is still not set to ppc 'stable' yet (working on some strange keycode issue with it still) Once 4.2.1-r2 makes stable I will close this Thanks again Olaf the patch posted above doesnt solve much, this one works better for the time being: --- xfree-4.2.1-r2.ebuild 2002-12-30 18:23:06.000000000 +0100 +++ xfree-4.2.1-r3.ebuild 2003-01-03 16:11:34.000000000 +0100 @@ -302,6 +302,21 @@ einfo "Building XFree86..." emake World || die + cd lib + my_NOFPIC_LIBS=$((find * -name "*.a" | grep -v module ; find * -name unshared -type d ) | xargs -n1 dirname | sort -u) + echo "possible libs without -fPIC: $my_NOFPIC_LIBS" + for i in $my_NOFPIC_LIBS lbxutil/{delta,image,lbx_zlib}; do + oPWD=$PWD + cd $i + pwd + rm -fv *.o unshared/*.o + cp -av Makefile Makefile.without.fPIC + sed 's#\(-fsigned-char\|-pipe\)#& -fPIC#' < Makefile > Makefile.fPIC + mv -v Makefile.fPIC Makefile + cd $oPWD + done + make + if [ -n "`use nls`" ] then cd ${S}/nls there are alot more libs without fPIC: for i in $(find /gentoo/usr/ -type f -name "*.a" | grep -vw modules) ; do objdump -r $i | grep -qw R_PPC_REL24 && echo $i ; done | sort | o -S Olaf: I'm passing this one off to nall as he is much more knowledgable on this than I am it is incorrect to check the .a files for R_PPC_REL24 relocs. But there should be a post-build check for .so files, like that: find $BUILD_ROOT -type f -name "*.*so" | xargs -n1 objdump -R | grep -wq R_PPC_REL24 && exit 1 You can run that one to check how many libs miss -fPIC: for i in `find /lib/ /usr/lib/ /usr/X11R6/lib/ /usr/kde /usr/qt -name "*.*so*" -type f` ; do objdump -R $i 2>/dev/null | grep -wq R_PPC_REL24 && echo $i ; done /usr/lib/perl5/site_perl/5.6.1/powerpc-linux/auto/PDL/Slatec/Slatec.so /usr/qt/3/lib/libqt-mt.so.3.1.0 /usr/qt/3/plugins/designer/libcppeditor.so Ahh ok. That was the sme info we found as well, was just applicable for .so files. Err, ok, what is the status on this ? Is -fPIC patches in -r2 not sufficient enouth ? Did you recompile QT after xfree, as it will be needed (if I remember correctly, it link to the static version of xinerama lib, but ask Cretin about this ...)? 4.2-r2 has a libXinerama.a without -fPIC 4.3pre has it with -fPIC I did recompile qt after building all .a files with -fPIC and a selfcompiled KDE 3.1rc6 does not fail with reloc errors. It would be the best to compile only the really needed .a files with -fPIC, libXinerama.a is an candidate for that. I do not see any patch to build libXinerama.a with -fPIC. I have only a few packages compiled, are there other .so files that do still have these R_PPC_REL24 relocs? I have 2 left (but they do not cause problems for me): /usr/lib/perl5/site_perl/5.6.1/powerpc-linux/auto/PDL/Slatec/Slatec.so /usr/qt/3/plugins/designer/libcppeditor.so libcppeditor.so is linked static with /usr/qt/3/lib/libeditor.a this smells like a qt bug. Slatec.so comes from FORTRAN sources: /var/tmp/portage/PDL-2.3.2-r2/work/PDL-2.3.2/Lib/Slatec g77 -c -o slatec/xgetua.o -O slatec/xgetua.f Ill see if I can backport the Imakefile fixes from 4.3 to 4.2.1 as soon as I get the time. Olaf: I've built a little tool to test pacakges for this, and from what I can see the other 2 small ones that don't cause problems are the only other two that are currently around, and I have a large amount of pkgs tested now. There is an upcoming xfree-4.2.1-r3 ebuild that should have most of this stuff fixed up. Also kde-3.1_rc6 did have some other problems wrt this stuff (even compiled against a good xfree). Did some sanity checking before trying to prelink and noticed these problems. We're working on things though :) Thanks for your time on this stuff again i have a local portage that will perform ARCH-specific tests on an install area before merging it. if it finds errors (such as this), it will throw an error and tell the user to file a bug here. i'll file a bug against portage to get this functionality. this is fixed in CVS. thanks so much for the info on this, olaf. we're integrating this into our QA testing. |