Bug 12667 - Perl build is broken twice(for both host and guest)
Summary: Perl build is broken twice(for both host and guest)
Status: RESOLVED NOTABUG
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 2.4.2
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.6
Assignee: Randy MacLeod
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-04-09 01:37 UTC by megastallman
Modified: 2018-04-15 17:53 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
perl-native-log.do_configure (35.80 KB, text/plain)
2018-04-13 11:14 UTC, Randy MacLeod
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description megastallman 2018-04-09 01:37:39 UTC
This is a very broad bug, that gets me for more than a year I'm trying Yocto directly on my Kubuntu laptop. Thus it gets built in an ubuntu:14.04 docker container, it doesn't build directly on my Kubuntu 16.04, and 18.04-beta machines. It doesn't depend on target architecture(x86, x86_64, arm...). The host is always x86_64.
All Yocto versions tested are: Krogoth to Rocko(the last I've tried). The bug is absolutely the same. At the moment using docker for builds is not acceptible in all cases.

Try 1:
Perl-native fails, claiming not being able to build with both -Duseshrplib and -Duserelocatableinc. I've removed "-Duseshrplib" from recipes-devtools/perl/perl-native_5.24.1.bb. 
Try 2:
Then perl-native builds, but perl failes with:
i586-poky-linux-gcc  -m32 -march=i586 --sysroot=/opt/yocto/poky/build/tmp/work/i586-poky-linux/perl/5.24.1-r0/recipe-sysroot  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector -shared Normalize.o  -o /opt/yocto/poky/build/tmp/work/i586-poky-linux/perl/5.24.1-r0/perl-5.24.1/cpan/Unicode-Normalize/../../lib/auto/Unicode/Normalize/PL_Unicode__Normalize.so   \
|    -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc "-L../.." -lperl       \
| 
| /opt/yocto/poky/build/tmp/work/i586-poky-linux/perl/5.24.1-r0/recipe-sysroot-native/usr/bin/i586-poky-linux/../../libexec/i586-poky-linux/gcc/i586-poky-linux/7.3.0/ld: cannot find -lperl
Comment 1 Randy MacLeod 2018-04-12 10:21:24 UTC
Can you explain exactly what steps you are taking when you encounter this bug?

If I do:
$ cat /etc/os-release | grep VERSION=
VERSION="16.04.4 LTS (Xenial Xerus)"
# as explain in:
# https://www.yoctoproject.org/docs/2.4.2/yocto-project-qs/yocto-project-qs.html

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
 xz-utils debianutils iputils-ping libsdl1.2-dev xterm

# Note that perl is installed on the host and a number of packages depend on it.
# I'm not sure if that matters.

# you should be able to use the tarball, oe-core+bitbake or just poky's git repo
# I'm using poky (https://www.yoctoproject.org/software-item/poky/) 

$ cd .../poky.git 
$ git checkout yocto-2.4.2
$ mkdir ../b.poky/
$ cd ../b.poky/
$ . ../poky.git/oe-init-build-env yp-12667

$ bitbake perl-native
$ echo $?
0

$ bitbake perl
$ echo $?
0

Let me know if you figure out the problem with your system or  if I can help any other way.
Comment 2 megastallman 2018-04-13 09:18:37 UTC
Hi Randy! Thanks for reply!

I've recently upgraded, but having absolutely the same error, so:

$ cat /etc/os-release | grep VERSION=
VERSION="18.04 LTS (Bionic Beaver)"

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
 xz-utils debianutils iputils-ping libsdl1.2-dev xterm
...
0 upgraded, 0 newly installed, 0 to remove and 61 not upgraded.

Here is my "perl -V" output: https://hastebin.com/kafalisemu.coffeescript

$ git clone https://git.yoctoproject.org/git/poky
$ cd poky
$ git checkout yocto-2.4.2
Note: checking out 'yocto-2.4.2'.                                                                                                                                      
...                                                                                                                                                                    
HEAD is now at 342fbd6a3e linux-yocto: update genericx86* SRCREVs for v4.12                                                                                            
$ mkdir ../b.poky/                                                                                                                                                     
$ cd ../b.poky/                                                                                                                                                        
$ . ../poky/oe-init-build-env yp-12667                                                                                                                                 
...                                                                                                                                                                    
You can now run 'bitbake <target>'                                                                                                                                     
...                                                                                                                                                                    
bitbake perl-native | tee pl_build.log                                                                                                                                 
Here it is: https://hastebin.com/kacoqayege.rb                                                                                                                         
                                                                                                                                                                       
And that is the first perl breakage:                                                                                                                                   
...                                                                                                                                                                    
| Build a shared libperl.so (y/n) [y]                                                                                                                                  
| Cannot build with both -Duserelocatableinc and -Duseshrplib
| See INSTALL for an explanation why that won't work.
| WARNING: exit code 4 from a shell command.
...

Thanks in advance!
Comment 3 Randy MacLeod 2018-04-13 11:14:15 UTC
Created attachment 4266 [details]
perl-native-log.do_configure

From my ubuntu-16.04 builder using poky master:23eabef08a20f2cd901af9ad8e42470ce10a2b61
Comment 4 Randy MacLeod 2018-04-13 11:20:32 UTC
Interesting, it seems to be host contamination related to some files that you have for android development in /usr/local/ 

Here's part of the diff:

$ diff -Nauwr /tmp/perl-native-log.do_configure /tmp/perl-native-log.do_configure.bad.short
...
 dos_djgpp     interix         newsos4          solaris_2   
-Which of these apply, if any? [linux]  
+Which of these apply, if any? [linux-android]
+./Configure: 1: ./hints/linux-android.sh: getprop: not found
 
 You appear to have ELF support.  I'll try to use it for dynamic loading.
 If dynamic loading doesn't work, read hints/linux.sh for further information.
-Operating system name? [linux]  
-Operating system version? [4.4.0-119-generic]  
+Operating system name? [linux-android]
+Operating system version? [none]
 Installation prefix to use? (~name ok)
-[/home/rmacleod/src/distro/yocto/b.poky/yp-12667/tmp/work/x86_64-linux/perl-native/5.24.1-r0/recipe-sysroot-native/usr]  
+[/opt/yocto/git/b.poky/yp-12667/tmp/work/x86_64-linux/perl-native/5.24.1-r0/recipe-sysroot-native/usr]
 AFS does not seem to be running...
 What installation prefix should I use for installing files? (~name ok)
-[/home/rmacleod/src/distro/yocto/b.poky/yp-12667/tmp/work/x86_64-linux/perl-native/5.24.1-r0/recipe-sysroot-native/usr]  
+[/opt/yocto/git/b.poky/yp-12667/tmp/work/x86_64-linux/perl-native/5.24.1-r0/recipe-sysroot-native/usr]
 Getting the current patchlevel...
 Build a threading Perl? [y]  
 Use which C compiler? [gcc ]  
 Checking for GNU cc in disguise and/or its version number...
 Now, how can we feed standard input to your C preprocessor...
 Directories to use for library searches?
-[/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib/i386-linux-gnu /lib64]  
+[/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib/i386-linux-gnu /lib64]
 What is the file extension used for shared libraries? [so]  
 Make shared library basenames unique? [n]  
+Hmm.  Based on the hints in hints/linux-android.sh,
+the recommended value for $d_libname_unique on this machine was "define"!
+    Keep the recommended value? [y]
 Build Perl for SOCKS? [n]  
 Try to use long doubles if available? [n]  
 Checking for optional libraries...
 What libraries to use? [-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc]  
 What optimizer/debugger flag should be used? [-O2]  
 Any additional cc flags?
-[-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe]  
+[-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include]
...



Are you interested in figuring out how to get perl's Configure to ignore the android files and submitting a patch? If not, how do I setup my builder with this fail or package? 
A work-around would be to hide the offending file in /usr/local, I expect.
Comment 5 Randy MacLeod 2018-04-13 12:38:40 UTC
I mean:
   If not, how do I setup my builder with this _file_ or package?
Comment 6 megastallman 2018-04-14 11:26:59 UTC
Hi Randy! Thanks much for pointing out. These were some anbox leftover sources in /usr/local/lib/, which I forgot to remove. Everything builds now. We can close the ticket.
Comment 7 Randy MacLeod 2018-04-15 17:53:11 UTC
We can't always protect the system against every package installed to /usr/local so in this case, I'll close this defect with the work-around of removing the offending files rather than a fix to make perl's Configure ignore /usr/local on the host. Re-open if you find this defect and you'd like to submit a patch.