[Buildroot] [PATCH] bzip2: Rearrange build order

Peter Korsgaard jacmet at uclibc.org
Wed Jun 5 13:50:21 UTC 2013


>>>>> "Markos" == Markos Chandras <markos.chandras at gmail.com> writes:

 Markos> From: Markos Chandras <markos.chandras at imgtec.com>
 Markos> Several object files are shared between the libbz2.so shared library
 Markos> and the libbz2.a static one. MIPS will refuce to build a relocatable
 Markos> object when creating a new shared library with the following error:

 Markos> blocksort.o: relocation R_MIPS_HI16 against `__gnu_local_gp' can not be used
 Markos> when making a shared object; recompile with -fPIC

 Markos> This is because these files are build without -fPIC when creating the
 Markos> static library and later on they are used to build the shared one.

 Markos> This is easily fixed if we add the shared library build rule before
 Markos> creating the static library so object files are always compiled with
 Markos> -fPIC.

This works, but is afaik less efficient for the static lib case.

The real fix is imho to build the object files twice, like how libtool
does it.

If you look at the Debian package, they work around it by adding a
seperate .c -> .sho build rule, which adds -fPIC, and then link the .so
file with the .sho files instead.

-- 
Bye, Peter Korsgaard



More information about the buildroot mailing list