blob: f79b15811476148818ed5580507177da445d9f7e [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001From d111fd85b25466f7829ccee34493aa0e3b551308 Mon Sep 17 00:00:00 2001
2From: Mingli Yu <mingli.yu@windriver.com>
3Date: Tue, 23 Apr 2019 19:13:19 -0700
4Subject: [PATCH] CheckLib.pm: don't execute the binary
5
6Don't execute the binary in build env as the
7binary which is generated in cross compile env
8may fail when executed in build env.
9
10And it's enough to verify the libs via successully
11generate the binary which links the libs as below.
12 $ /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 -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security \
14 -Werror=format-security --sysroot=/yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/libdbd-mysql-perl/4.050-r0/recipe-sysroot \
15 -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 -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 -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
19Execute the binary in cross compile env as below
20and use the return status to determine the lib's
21checking status is not appropriate in cross compile env.
22 $ /yocto/builds/upgrade1/tmp/work/core2-64-poky-linux/libdbd-mysql-perl/4.050-r0/git/assertlibCOw_eujb
23
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060024Upstream-Status: Inappropriate [oe specific]
Brad Bishopc342db32019-05-15 21:57:59 -040025
26Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
27---
28 lib/Devel/CheckLib.pm | 2 +-
29 1 file changed, 1 insertion(+), 1 deletion(-)
30
31diff --git a/lib/Devel/CheckLib.pm b/lib/Devel/CheckLib.pm
Andrew Geissler87f5cff2022-09-30 13:13:31 -050032index 2e5a252..5c2f0b0 100644
Brad Bishopc342db32019-05-15 21:57:59 -040033--- a/lib/Devel/CheckLib.pm
34+++ b/lib/Devel/CheckLib.pm
Andrew Geissler87f5cff2022-09-30 13:13:31 -050035@@ -403,7 +403,7 @@ sub assert_lib {
36 if ($execute) {
37 my $retval = system($absexefile);
38 warn "# return value: $retval\n" if $args{debug};
39- push @wrongresult, $lib if $retval != 0;
40+ print "Checking the lib $lib\n" if $retval != 0;
Brad Bishopc342db32019-05-15 21:57:59 -040041 }
Andrew Geissler87f5cff2022-09-30 13:13:31 -050042 push @wronganalysis, $lib
43 if $analyze_binary and !$analyze_binary->($lib, $exefile);
Brad Bishopc342db32019-05-15 21:57:59 -040044--
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500452.25.1
Brad Bishopc342db32019-05-15 21:57:59 -040046