The "Use GCC option -fPIC for shared objects, please." is an error from uClibc 
(you can disable it, but it's not ideal).

The 66_all_binutils-2.17.50.0.2-warn-textrel.patch, if it's the alt-linux 
patch, only warns for shared textrel at link time, but doesn't cause an 
error.

I apologies for not getting this fixed. My day job is busy in the summer, I 
worked during my normal vacation time, so I haven't found the time. I'm still 
fairly sure this is from libssp_nonshared.a... it needs to be compiled 
with -fpic from the cocoon, and again in butterfly, so shared libraries can 
use it.

I think -fpic should be added to libssp_nonshared.a, and libiberty, via the 
gcc-fpie patch. I vaguely remember getting around the libbfd.so error, and 
then getting another error when compiling gcc/xgcc, caused by libiberty.a.

robert

On Saturday July 28 2007 03:13:29 pm Rob van Dam wrote:
> Robert Connolly schreef:
> > You can use the pax-utils-0.1.15 package, and 'scanelf -qT' on libbfd.so.
> > Also see http://www.gentoo.org/proj/en/hardened/pic-fix-guide.xml
> > I think you'll find the textrel is from ssp_local.c, which is compiled in
> > libssp_nonshared.a and then linked to libbfd.so.
> >
> > I can't remember for sure, but I think it may also be caused by the
> > non-pic libiberty.a being linked to libssp_nonshared.a. The GCC build
> > system builds two libiberty's, and uses the static one for static
> > libraries and for exe programs. The build system uses the local copy of
> > libiberty's, not the one in /tools/lib or /usr/lib, but uses the
> > installed copy of libssp_nonshared.a.
> >
> > When I had this problem I got distracted by installing a shared
> > libiberty.so and adding libssp to uClibc, so I don't think I ever found a
> > fix for it.
> >
> > I think the fix is in adding -fpic to libssp/Makefile.in and installing
> > the new pic version of libssp_nonshared.a. libssp/ depends on libiberty/,
> > and maybe libcpp/... so for a workaround I suggest you try
> > adding -fno-stack-protector to the butterfly CFLAGS so it can build
> > without textrels, then build 'make configure-target-libssp' and 'make
> > all-target-libssp', and install libssp_nonshared.a to /tools/lib by hand.
> > Then retry building butterfly normally, with -fpic in libssp/Makefile.in.
> > I'm not sure this will be successful.
> >
> > The gcc fpie patch uses -fpic only if -shared, -nostdlib, or
> > -nostartfiles are used, so it might be passing -fpie to
> > libssp_nonshared.a, which is causing -fpie to find its way into
> > libbfd.so.
> >
> > Sorry I can't help with this better, I'm still on the Bash/headers
> > problem.
> >
> > robert
>
> I tried out two patches from a similar gentoo uclibc project:
>
> http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.17/
>
> I used the following patches:
> 66_all_binutils-2.17.50.0.2-warn-textrel.patch
> 91_all_libiberty-pic.patch
>
> These patches need some tweaking to work. Now the buildprocess stops in
> a later stadium with a similar error:
>
> /./ld -O2 -O2 -g -O2   -DIN_GCC    -W -Wall -Wwrite-strings
> -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
> -isystem ./include  -I. -I. -I../../butterfly-toolchain/gcc
> -I../../butterfly-toolchain/gcc/.
> -I../../butterfly-toolchain/gcc/../include -I./../intl
> -I../../butterfly-toolchain/gcc/../libcpp/include   -g0
> -finhibit-size-directive -fno-inline-functions -fno-exceptions
> -fno-stack-protector -fno-zero-initialized-in-bss -fno-unit-at-a-time
> -fno-PIE -fPIC -fno-omit-frame-pointer \
>           -c ../../butterfly-toolchain/gcc/crtstuff.c -DCRT_BEGIN \
>           -o crtbegin.o
> Can't modify /sources/butterfly-build/bfd/.libs/libbfd-2.17.so's text
> section. Use GCC option -fPIC for shared objects, please.
> make[2]: *** [crtbegin.o] Error 1
>
> Is this of any help?
>
> Rob


Attachment: pgpbQQialy9gT.pgp
Description: PGP signature

-- 
http://linuxfromscratch.org/mailman/listinfo/hlfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to