1*c342db35SBrad BishopFrom d111fd85b25466f7829ccee34493aa0e3b551308 Mon Sep 17 00:00:00 2001
2*c342db35SBrad BishopFrom: Mingli Yu <mingli.yu@windriver.com>
3*c342db35SBrad BishopDate: Tue, 23 Apr 2019 19:13:19 -0700
4*c342db35SBrad BishopSubject: [PATCH] CheckLib.pm: don't execute the binary
5*c342db35SBrad Bishop
6*c342db35SBrad BishopDon't execute the binary in build env as the
7*c342db35SBrad Bishopbinary which is generated in cross compile env
8*c342db35SBrad Bishopmay fail when executed in build env.
9*c342db35SBrad Bishop
10*c342db35SBrad BishopAnd it's enough to verify the libs via successully
11*c342db35SBrad Bishopgenerate the binary which links the libs as below.
12*c342db35SBrad Bishop  $ /yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/libdbd-mysql-perl/4.050-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc \
13*c342db35SBrad Bishop  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security \
14*c342db35SBrad Bishop  -Werror=format-security --sysroot=/yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/libdbd-mysql-perl/4.050-r0/recipe-sysroot \
15*c342db35SBrad Bishop  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/perl/5.28.1-r1=/usr/src/debug/perl/5.28.1-r1 \
16*c342db35SBrad Bishop  -fdebug-prefix-map=/yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/perl/5.28.1-r1=/usr/src/debug/perl/5.28.1-r1 \
17*c342db35SBrad Bishop  -fdebug-prefix-map=/yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/libdbd-mysql-perl/4.050-r0/recipe-sysroot= -fdebug-prefix-map=/yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/libdbd-mysql-perl/4.050-r0/recipe-sysroot-native= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 assertlibEhx19yuY.c -L/yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/libdbd-mysql-perl/4.050-r0/recipe-sysroot/usr/lib -lcrypto -fstack-protector-strong -o assertlibCOw_eujb
18*c342db35SBrad Bishop
19*c342db35SBrad BishopExecute the binary in cross compile env as below
20*c342db35SBrad Bishopand use the return status to determine the lib's
21*c342db35SBrad Bishopchecking status is not appropriate in cross compile env.
22*c342db35SBrad Bishop $ /yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/libdbd-mysql-perl/4.050-r0/git/assertlibCOw_eujb
23*c342db35SBrad Bishop
24*c342db35SBrad BishopUpstream-Status: Inappropriate[oe specific]
25*c342db35SBrad Bishop
26*c342db35SBrad BishopSigned-off-by: Mingli Yu <mingli.yu@windriver.com>
27*c342db35SBrad Bishop---
28*c342db35SBrad Bishop lib/Devel/CheckLib.pm | 2 +-
29*c342db35SBrad Bishop 1 file changed, 1 insertion(+), 1 deletion(-)
30*c342db35SBrad Bishop
31*c342db35SBrad Bishopdiff --git a/lib/Devel/CheckLib.pm b/lib/Devel/CheckLib.pm
32*c342db35SBrad Bishopindex e45cfb4..d228bb5 100644
33*c342db35SBrad Bishop--- a/lib/Devel/CheckLib.pm
34*c342db35SBrad Bishop+++ b/lib/Devel/CheckLib.pm
35*c342db35SBrad Bishop@@ -424,7 +424,7 @@ sub assert_lib {
36*c342db35SBrad Bishop             my $absexefile = File::Spec->rel2abs($exefile);
37*c342db35SBrad Bishop             $absexefile = '"'.$absexefile.'"' if $absexefile =~ m/\s/;
38*c342db35SBrad Bishop             if (!$not_execute && system($absexefile) != 0) {
39*c342db35SBrad Bishop-                push @wrongresult, $lib;
40*c342db35SBrad Bishop+                print "Checking the lib $lib\n";
41*c342db35SBrad Bishop             }
42*c342db35SBrad Bishop             else {
43*c342db35SBrad Bishop                 if ($analyze_binary) {
44*c342db35SBrad Bishop--
45*c342db35SBrad Bishop2.17.1
46*c342db35SBrad Bishop
47