Patchwork [3/5] perl-native: fix ExtUtils::Liblist::Kid library check for cross-build

login
register
mail settings
Submitter Roman Khimov
Date Dec. 25, 2010, 10:48 a.m.
Message ID <1293274109-15695-3-git-send-email-khimov@altell.ru>
Download mbox | patch
Permalink /patch/128/
State Accepted
Headers show

Comments

Roman Khimov - Dec. 25, 2010, 10:48 a.m.
MakeMaker uses it to check for libraries presence and if the library is not
found in host dirs (/lib, /usr/lib, etc) it fails with messages like:

Note (probably harmless): No library found for -lpcap

Unfortunately it's not harmless, since MakeMaker removes such libs from flags
passed to link target modules which obviously breaks them.

As I don't know exact semantic and all use-cases of libpth config variable
I've workarounded this issue by prepending ldflags (and this does contain the
right path) to lib flags.

Signed-off-by: Roman I Khimov <khimov@altell.ru>
---
 .../perl-5.10.1/perl-fix-cross-library-check.patch |   19 +++++++++++++++++++
 recipes/perl/perl-native_5.10.1.bb                 |    3 ++-
 2 files changed, 21 insertions(+), 1 deletions(-)
 create mode 100644 recipes/perl/perl-5.10.1/perl-fix-cross-library-check.patch
Khem Raj - Dec. 25, 2010, 5:33 p.m.
On 12/25/2010 2:48 AM, Roman I Khimov wrote:
> MakeMaker uses it to check for libraries presence and if the library is not
> found in host dirs (/lib, /usr/lib, etc) it fails with messages like:
>
> Note (probably harmless): No library found for -lpcap
>
> Unfortunately it's not harmless, since MakeMaker removes such libs from flags
> passed to link target modules which obviously breaks them.
>
> As I don't know exact semantic and all use-cases of libpth config variable
> I've workarounded this issue by prepending ldflags (and this does contain the
> right path) to lib flags.
>
> Signed-off-by: Roman I Khimov<khimov@altell.ru>

is this a problem for perl-native or target perl ?

> ---
>   .../perl-5.10.1/perl-fix-cross-library-check.patch |   19 +++++++++++++++++++
>   recipes/perl/perl-native_5.10.1.bb                 |    3 ++-
>   2 files changed, 21 insertions(+), 1 deletions(-)
>   create mode 100644 recipes/perl/perl-5.10.1/perl-fix-cross-library-check.patch
>
> diff --git a/recipes/perl/perl-5.10.1/perl-fix-cross-library-check.patch b/recipes/perl/perl-5.10.1/perl-fix-cross-library-check.patch
> new file mode 100644
> index 0000000..1c51609
> --- /dev/null
> +++ b/recipes/perl/perl-5.10.1/perl-fix-cross-library-check.patch
> @@ -0,0 +1,19 @@
> +Index: perl-5.10.1/lib/ExtUtils/Liblist/Kid.pm
> +===================================================================
> +--- perl-5.10.1.orig/lib/ExtUtils/Liblist/Kid.pm	2010-11-23 13:54:41.000000000 +0300
> ++++ perl-5.10.1/lib/ExtUtils/Liblist/Kid.pm	2010-11-23 14:18:13.000000000 +0300
> +@@ -33,6 +33,14 @@
> + 	$potential_libs .= " " if $potential_libs;
> + 	$potential_libs .= $Config{perllibs};
> +     }
> ++
> ++    if ($Config{ldflags}) {
> ++	# Dynamic libraries are not transitive, so we may need including
> ++	# the libraries linked against perl.dll again.
> ++
> ++	$potential_libs = $Config{ldflags} . " " . $potential_libs;
> ++    }
> ++
> +     return ("", "", "", "", ($give_libs ? [] : ())) unless $potential_libs;
> +     warn "Potential libraries are '$potential_libs':\n" if $verbose;
> +
> diff --git a/recipes/perl/perl-native_5.10.1.bb b/recipes/perl/perl-native_5.10.1.bb
> index 8b275a2..c523974 100644
> --- a/recipes/perl/perl-native_5.10.1.bb
> +++ b/recipes/perl/perl-native_5.10.1.bb
> @@ -3,7 +3,7 @@ HOMEPAGE = "http://www.perl.org/"
>   SECTION = "libs"
>   LICENSE = "Artistic|GPLv1+"
>   DEPENDS = "virtual/db-native gdbm-native"
> -PR = "r7"
> +PR = "r8"
>   NATIVE_INSTALL_WORKS = "1"
>
>   # Not tested enough
> @@ -21,6 +21,7 @@ SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz;name=perl-${PV} \
>              file://perl-configpm-switch.patch \
>              file://native-nopacklist.patch \
>              file://native-perlinc.patch \
> +	   file://perl-fix-cross-library-check.patch \
>   	   "
>
>   SRC_URI[perl-5.10.1.md5sum] = "b9b2fdb957f50ada62d73f43ee75d044"
Roman Khimov - Dec. 25, 2010, 6:05 p.m.
? ????????? ?? ??????? 25 ??????? 2010 20:33:36 ????? Khem Raj ???????:
> On 12/25/2010 2:48 AM, Roman I Khimov wrote:
> > MakeMaker uses it to check for libraries presence and if the library is
> > not found in host dirs (/lib, /usr/lib, etc) it fails with messages like:
> >
> > Note (probably harmless): No library found for -lpcap
> >
> > Unfortunately it's not harmless, since MakeMaker removes such libs from
> > flags passed to link target modules which obviously breaks them.
> >
> > As I don't know exact semantic and all use-cases of libpth config
> > variable I've workarounded this issue by prepending ldflags (and this
> > does contain the right path) to lib flags.
> >
> > Signed-off-by: Roman I Khimov<khimov@altell.ru>
> 
> is this a problem for perl-native or target perl ?

For target perl libraries. Seen that on Net::PCAP, the package built fine, but 
the actual library wasn't linked to pcap, thus not working. But in order for 
target perl libraries to build properly native perl needs to be patched.
Khem Raj - Dec. 25, 2010, 7:55 p.m.
On 12/25/2010 10:05 AM, Roman I Khimov wrote:
> ? ????????? ?? ??????? 25 ??????? 2010 20:33:36 ????? Khem Raj ???????:
>> On 12/25/2010 2:48 AM, Roman I Khimov wrote:
>>> MakeMaker uses it to check for libraries presence and if the library is
>>> not found in host dirs (/lib, /usr/lib, etc) it fails with messages like:
>>>
>>> Note (probably harmless): No library found for -lpcap
>>>
>>> Unfortunately it's not harmless, since MakeMaker removes such libs from
>>> flags passed to link target modules which obviously breaks them.
>>>
>>> As I don't know exact semantic and all use-cases of libpth config
>>> variable I've workarounded this issue by prepending ldflags (and this
>>> does contain the right path) to lib flags.
>>>
>>> Signed-off-by: Roman I Khimov<khimov@altell.ru>
>>
>> is this a problem for perl-native or target perl ?
>
> For target perl libraries. Seen that on Net::PCAP, the package built fine, but
> the actual library wasn't linked to pcap, thus not working. But in order for
> target perl libraries to build properly native perl needs to be patched.

got it.

Acked-by: Khem Raj <raj.khem@gmail.com>

>
>
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Patch

diff --git a/recipes/perl/perl-5.10.1/perl-fix-cross-library-check.patch b/recipes/perl/perl-5.10.1/perl-fix-cross-library-check.patch
new file mode 100644
index 0000000..1c51609
--- /dev/null
+++ b/recipes/perl/perl-5.10.1/perl-fix-cross-library-check.patch
@@ -0,0 +1,19 @@ 
+Index: perl-5.10.1/lib/ExtUtils/Liblist/Kid.pm
+===================================================================
+--- perl-5.10.1.orig/lib/ExtUtils/Liblist/Kid.pm	2010-11-23 13:54:41.000000000 +0300
++++ perl-5.10.1/lib/ExtUtils/Liblist/Kid.pm	2010-11-23 14:18:13.000000000 +0300
+@@ -33,6 +33,14 @@
+ 	$potential_libs .= " " if $potential_libs;
+ 	$potential_libs .= $Config{perllibs};
+     }
++
++    if ($Config{ldflags}) { 
++	# Dynamic libraries are not transitive, so we may need including
++	# the libraries linked against perl.dll again.
++
++	$potential_libs = $Config{ldflags} . " " . $potential_libs;
++    }
++
+     return ("", "", "", "", ($give_libs ? [] : ())) unless $potential_libs;
+     warn "Potential libraries are '$potential_libs':\n" if $verbose;
+ 
diff --git a/recipes/perl/perl-native_5.10.1.bb b/recipes/perl/perl-native_5.10.1.bb
index 8b275a2..c523974 100644
--- a/recipes/perl/perl-native_5.10.1.bb
+++ b/recipes/perl/perl-native_5.10.1.bb
@@ -3,7 +3,7 @@  HOMEPAGE = "http://www.perl.org/"
 SECTION = "libs"
 LICENSE = "Artistic|GPLv1+"
 DEPENDS = "virtual/db-native gdbm-native"
-PR = "r7"
+PR = "r8"
 NATIVE_INSTALL_WORKS = "1"
 
 # Not tested enough
@@ -21,6 +21,7 @@  SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz;name=perl-${PV} \
            file://perl-configpm-switch.patch \
            file://native-nopacklist.patch \
            file://native-perlinc.patch \
+	   file://perl-fix-cross-library-check.patch \
 	   "
 
 SRC_URI[perl-5.10.1.md5sum] = "b9b2fdb957f50ada62d73f43ee75d044"