From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Korsgaard Date: Wed, 05 Jun 2013 15:50:21 +0200 Subject: [Buildroot] [PATCH] bzip2: Rearrange build order In-Reply-To: <1370436976-746-1-git-send-email-markos.chandras@gmail.com> (Markos Chandras's message of "Wed, 5 Jun 2013 13:56:16 +0100") References: <1370436976-746-1-git-send-email-markos.chandras@gmail.com> Message-ID: <877gi8ekf6.fsf@dell.be.48ers.dk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net >>>>> "Markos" == Markos Chandras writes: Markos> From: Markos Chandras 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