Wind River Support Network

HomeDefectsLIN5-19134
Fixed

LIN5-19134 : "flex: fatal internal error" when invoked in a self-hosted environment, chroot

Created: Jul 29, 2014    Updated: Dec 19, 2017
Resolved Date: Jul 29, 2014
Previous ID: LIN6-8043
Found In Version: 5.0.1
Fix Version: 5.0.1.18
Severity: Standard
Applicable for: Wind River Linux 5
Component/s: Build & Config

Description

The flex binary is referencing a path from the original build directory, which does not exist in the chroot. 

When customer tries to use /usr/bin/flex either in the chroot environment or in VMWare (via bootimage.iso), he gets the following error:
 *****
flex: fatal internal error, exec of /build/linux/sfrwrlinux/bitbake_build/tmp/sysroots/x86_64-linux/usr/bin/m4 failed
******
No matter how he builds, if he does "strings | grep bitbake_build”, it always exposes the hard-coded path  /build/linux/sfrwrlinux/bitbake_build/tmp/sysroots/x86_64-linux/usr/bin/m4. 

Customer's using the chroot with addition of the contents of the sysroot to build using the gcc, ld, m4, flex, etc. and it is working fine with the exception of the flex issue.

He has also used make iso to spin up a VMware VM and flex has the error there, also.

*** Host Type:
Customer was building on Red Hat Enterprise Linux Workstation release 6.4 (Santiago).
CSE was building on Ubuntu precise 12.04.3 LTS 

Workaround

If customer makes a symbolic link for the bad path (which is hardcoded in the flex executable), everything works.

Steps to Reproduce

1. Configure and build the project
                --enable-reconfig \
                --enable-board=intel-x86-64 \
                --enable-kernel=standard \
                --enable-rootfs=glibc-std \
                --enable-bootimage=cpio.gz \
                --enable-jobs=2 \
                --enable-stand-alone-project=yes \
                --enable-parallel-pkgbuilds=8 \
                --with-template=feature/build_libc,feature/self-hosted \
                --enable-sdkmachine=x86_64 \
                --enable-rm-work=yes \
                --enable-rm-oldimgs=yes \
                --with-rcpl-version=0002
2. Extract bitbake_build/tmp/deploy/images/intel-x86-64/wrlinux-image-glibc-std-intel-x86-64.tar.bz2 to a directory (i.e my_root). This will be the base of the chroot.

3. Examine if a hardcoded path is present in the flex executable:
my_root/usr/bin$ strings flex | grep "/usr/bin/m4"

*** Expected result:    /usr/bin/m4

*** Actual result:  the hard-coded path pointing back to the original build directory is exposed, for instance:
 /build/linux/sfrwrlinux/bitbake_build/tmp/sysroots/x86_64-linux/usr/bin/m4

The last 2 steps are given here just to confirm the customer's been following a correct procedure:
4. Inside this chroot directory,
-           create a mnt/WindRiver/ directory
-          copy the full content of your Wind River Linux installation to the my_root/mnt/WindRiver/ directory (the documentation also mentions the use of an NFS mount if this makes life easier)

5.  chroot into the directory and build code.

Everything is working fine with the exception of the flex executable issue.

Other Downloads


Live chat
Online