1c342db35SBrad BishopFrom d111fd85b25466f7829ccee34493aa0e3b551308 Mon Sep 17 00:00:00 2001
2c342db35SBrad BishopFrom: Mingli Yu <mingli.yu@windriver.com>
3c342db35SBrad BishopDate: Tue, 23 Apr 2019 19:13:19 -0700
4c342db35SBrad BishopSubject: [PATCH] CheckLib.pm: don't execute the binary
5c342db35SBrad Bishop
6c342db35SBrad BishopDon't execute the binary in build env as the
7c342db35SBrad Bishopbinary which is generated in cross compile env
8c342db35SBrad Bishopmay fail when executed in build env.
9c342db35SBrad Bishop
10c342db35SBrad BishopAnd it's enough to verify the libs via successully
11c342db35SBrad Bishopgenerate the binary which links the libs as below.
12c342db35SBrad 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 \
13c342db35SBrad Bishop  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security \
14c342db35SBrad Bishop  -Werror=format-security --sysroot=/yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/libdbd-mysql-perl/4.050-r0/recipe-sysroot \
15c342db35SBrad 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 \
16c342db35SBrad 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 \
17c342db35SBrad 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
18c342db35SBrad Bishop
19c342db35SBrad BishopExecute the binary in cross compile env as below
20c342db35SBrad Bishopand use the return status to determine the lib's
21c342db35SBrad Bishopchecking status is not appropriate in cross compile env.
22c342db35SBrad Bishop $ /yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/libdbd-mysql-perl/4.050-r0/git/assertlibCOw_eujb
23c342db35SBrad Bishop
24c342db35SBrad BishopUpstream-Status: Inappropriate[oe specific]
25c342db35SBrad Bishop
26c342db35SBrad BishopSigned-off-by: Mingli Yu <mingli.yu@windriver.com>
27c342db35SBrad Bishop---
28c342db35SBrad Bishop lib/Devel/CheckLib.pm | 2 +-
29c342db35SBrad Bishop 1 file changed, 1 insertion(+), 1 deletion(-)
30c342db35SBrad Bishop
31c342db35SBrad Bishopdiff --git a/lib/Devel/CheckLib.pm b/lib/Devel/CheckLib.pm
32*87f5cff0SAndrew Geisslerindex 2e5a252..5c2f0b0 100644
33c342db35SBrad Bishop--- a/lib/Devel/CheckLib.pm
34c342db35SBrad Bishop+++ b/lib/Devel/CheckLib.pm
35*87f5cff0SAndrew Geissler@@ -403,7 +403,7 @@ sub assert_lib {
36*87f5cff0SAndrew Geissler             if ($execute) {
37*87f5cff0SAndrew Geissler                 my $retval = system($absexefile);
38*87f5cff0SAndrew Geissler                 warn "# return value: $retval\n" if $args{debug};
39*87f5cff0SAndrew Geissler-                push @wrongresult, $lib if $retval != 0;
40*87f5cff0SAndrew Geissler+                print "Checking the lib $lib\n" if $retval != 0;
41c342db35SBrad Bishop             }
42*87f5cff0SAndrew Geissler             push @wronganalysis, $lib
43*87f5cff0SAndrew Geissler                 if $analyze_binary and !$analyze_binary->($lib, $exefile);
44c342db35SBrad Bishop--
45*87f5cff0SAndrew Geissler2.25.1
46c342db35SBrad Bishop
47