diff mbox

[2/2] microperl: install host-microperl in $(HOST_DIR)/opt/perl

Message ID CAFbHwiS_oCLGfi5Pt4UGqVKsjT5j_bG5MTOKm7rGJm9+Pi_wAA@mail.gmail.com
State Accepted, archived
Headers show

Commit Message

Will Newton March 28, 2012, 2 p.m. UTC
On Wed, Mar 28, 2012 at 2:18 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Le Wed, 28 Mar 2012 14:01:56 +0100,
> Will Newton <will.newton@gmail.com> a écrit :
>
>> [win@lemeta01 buildroot]$ env | grep LD_LIBRARY
>> [win@lemeta01 buildroot]$ ./output/host/usr/bin/arm-linux-readelf -a
>> ./output/host/usr/lib/perl/auto/XML/Parser/Expat/Expat.so | grep RPATH
>> [win@lemeta01 buildroot]$
>
> Ah, ah, this is our problem.
>
>> Although the makefiles do mention rpath, but that one does not seem to
>> be getting used either:
>
> We have a rpath set in HOST_LDFLAGS, but this variable doesn't seem to
> be used when building host-libxml-parser-perl. However, by
> Expat/Makefile contains LD_RUN_PATH="/opt/outputs/perl/host/usr/lib" in
> the environment when calling ld:
>
> LD_RUN_PATH="/opt/outputs/perl/host/usr/lib" cc  -shared -O2 -g -L/usr/local/lib -fstack-protector Expat.o  -o ../blib/arch/auto/XML/Parser/Expat/Expat.so      \
>           -L/opt/outputs/perl/host/usr/lib -lexpat
>
> And LD_RUN_PATH is used by ld as the RPATH when no -rpath option is
> used. I guess this LD_RUN_PATH is set because we run the Makefile.PL
> script with INSTALLSITELIB=/opt/outputs/perl/host/usr/lib/perl.
>
> Could you post the output of:
>
> rm -rf output/build/host-libxml-parser-perl*
> make

I think I may have a solution. It looks like Red Hat (and hence
CentOS) remove support for LD_RUN_PATH by default:

https://bugzilla.redhat.com/show_bug.cgi?id=136009

However there is a flag to turn it back on. Setting this seems to get
me a sane runpath. Does this look ok? I assume it will silently do
nothing on non-RH systems.


From 30095fd0568c4e46e4a89e858fd184fd535c4bde Mon Sep 17 00:00:00 2001
From: Will Newton <will.newton@imgtec.com>
Date: Wed, 28 Mar 2012 14:55:59 +0100
Subject: [PATCH] libxml-parser-perl: Pass USE_MM_LD_RUN_PATH to MakeMaker.

Red Hat versions of perl do not honour the setting of LD_RUN_PATH
without this option. This leads to perl shared objects being installed
without an rpath set which causes problems for target tools when
searching for dependant shared libraries.

Signed-off-by: Will Newton <will.newton@imgtec.com>
---
 package/libxml-parser-perl/libxml-parser-perl.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Thomas Petazzoni March 28, 2012, 3:46 p.m. UTC | #1
Le Wed, 28 Mar 2012 15:00:36 +0100,
Will Newton <will.newton@gmail.com> a écrit :

> I think I may have a solution. It looks like Red Hat (and hence
> CentOS) remove support for LD_RUN_PATH by default:
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=136009
> 
> However there is a flag to turn it back on. Setting this seems to get
> me a sane runpath. Does this look ok? I assume it will silently do
> nothing on non-RH systems.

Ah, ah, it looks like a very good solution indeed.

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Thanks for the time you have spent investigating this problem!

Thomas
diff mbox

Patch

diff --git a/package/libxml-parser-perl/libxml-parser-perl.mk
b/package/libxml-parser-perl/libxml-parser-perl.mk
index 9e6f2ec..70d0918 100644
--- a/package/libxml-parser-perl/libxml-parser-perl.mk
+++ b/package/libxml-parser-perl/libxml-parser-perl.mk
@@ -18,6 +18,7 @@  define HOST_LIBXML_PARSER_PERL_CONFIGURE_CMDS
         INSTALLDIRS=site \
         INSTALLSITELIB=$(HOST_DIR)/usr/lib/perl \
         INSTALLSITEARCH=$(HOST_DIR)/usr/lib/perl \
+	USE_MM_LD_RUN_PATH=1 \
  )
 endef