Bug 8243 - Busybox build fails on meta-fsl-ppc core-image-minimal using uclibc
Summary: Busybox build fails on meta-fsl-ppc core-image-minimal using uclibc
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.9
Hardware: x86 Multiple
: Medium major
Target Milestone: 2.0.2
Assignee: Bogdan Alexandru Voiculescu
QA Contact: Valentin Hangan
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-09-02 14:16 UTC by Bogdan Alexandru Voiculescu
Modified: 2016-02-17 13:53 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bogdan Alexandru Voiculescu 2015-09-02 14:16:45 UTC
I tried to build a core-image-minimal using uclibc for mpc8544 (verifying bug Bug 8025) and I got a known error for building busybox: 
"
No such file or directory 
# include <utmp.h>
"

Seems to be related to uClibc-0.9.33 version, which has UTMP support disabled.



Detailed log: 

powerpc-poky-linux-uclibcspe-gcc  -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double --sysroot=/home/bvoiculescu/yocto/bug8025/poky/build/tmp/sysroots/mpc8544ds -Wp,-MD,applets/.applets.o.d   -std=gnu99 -Iinclude -Ilibbb  -include include/autoconf.h -D_GNU_SOURCE -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D"BB_VER=KBUILD_STR(1.23.2)" -DBB_BT=AUTOCONF_TIMESTAMP  -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wno-format-security -Wdeclaration-after-statement -Wold-style-definition -fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -static-libgcc -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -fno-unwind-tables -fno-asynchronous-unwind-tables -Os -O2 -pipe -g -feliminate-unused-debug-types  -O2 -pipe -g -feliminate-unused-debug-types   -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(applets)"  -D"KBUILD_MODNAME=KBUILD_STR(applets)" -c -o applets/applets.o applets/applets.c
In file included from include/busybox.h:8:0,
                 from applets/applets.c:9:
include/libbb.h:87:19: fatal error: utmp.h: No such file or directory
 # include <utmp.h>
                   ^
compilation terminated.
scripts/Makefile.build:197: recipe for target 'applets/applets.o' failed
make[1]: *** [applets/applets.o] Error 1
make[1]: Leaving directory '/home/bvoiculescu/yocto/bug8025/poky/build/tmp/work/ppce500v2-poky-linux-uclibcspe/busybox/1.23.2-r0/busybox-1.23.2'
Makefile:372: recipe for target 'applets_dir' failed
make: *** [applets_dir] Error 2
ERROR: oe_runmake failed
ERROR: Function failed: do_compile (log file is located at /home/bvoiculescu/yocto/bug8025/poky/build/tmp/work/ppce500v2-poky-linux-uclibcspe/busybox/1.23.2-r0/temp/log.do_compile.689)
Comment 1 Khem Raj 2015-09-03 15:44:21 UTC
here lies the problem

busybox has 

CONFIG_FEATURE_UTMP=y

where as uclibc has 

# UCLIBC_HAS_UTMP is not set
Comment 2 Saul Wold 2015-11-12 16:39:06 UTC
A solution has been suggested by Khem, let's go ahead and patch uclibc to enable the UCLIBC_HAS_UTMP config option
Comment 3 Benjamin Esquivel 2015-11-13 23:16:42 UTC
I believe this bug is fixed with bumping busybox to 1.24 because we're lacking this patch:

http://lists.busybox.net/pipermail/busybox-cvs/2015-April/035099.html
Comment 4 Bogdan Alexandru Voiculescu 2015-11-16 12:39:49 UTC
We still have some issues: 
 
configure: error: Systems with UTMPX and no ut_id field in the utmp structure are not supported
Configure failed. The contents of all config.log files follows to aid debugging
WARNING: /home/yocto/yocto/BBB/8438/build/tmp/work/cortexa8hf-vfp-neon-poky-linux-uclibceabi/shadow/4.2.1-r0/temp/run.do_configure.22507:1 exit 1 from
  exit 1
ERROR: oe_runconf failed
ERROR: Function failed: do_configure (log file is located at /home/yocto/yocto/BBB/8438/build/tmp/work/cortexa8hf-vfp-neon-poky-linux-uclibceabi/shadow/4.2.1-r0/temp/log.do_configure.22507)
Comment 5 Benjamin Esquivel 2015-11-17 19:58:37 UTC
hello Bogdan, does this mean you tried it with the patch I mentioned?

Just telling you because what I was going to do was to try the upgrade of busybox to 1.24 as I don't know what else this patch depends on
Comment 6 Bogdan Alexandru Voiculescu 2015-11-18 16:07:55 UTC
Hi Benjamin, it build the 'busybox' now (w/o the patch), the error occurs when building 'shadow'; after adding 
UCLIBC_HAS_UTMP=y
in 
meta/recipes-core/uclibc/uclibc-git/uClibc.distro

'shadow' package builds ok and errors are gone.

I will re-test from scratch using current master, then applying the patch, then adding UCLIBC_HAS_UTMP=y.
Comment 7 Bogdan Alexandru Voiculescu 2015-11-18 16:16:36 UTC
- busybox build seems ok on master
- the issue moved to 'shadow' package

"| checking for struct utmp.ut_xtime... no
| checking for struct utmp.ut_tv... no
| configure: error: Systems with UTMPX and no ut_id field in the utmp structure are not supported
| Configure failed. The contents of all config.log files follows to aid debugging
| WARNING: /home/yocto/yocto/BBB/8438/build/tmp/work/ppce300c3-poky-linux-uclibc/shadow/4.2.1-r0/temp/run.do_configure.25238:1 exit 1 from
|   exit 1
| ERROR: oe_runconf failed
| ERROR: Function failed: do_configure (log file is located at /home/yocto/yocto/BBB/8438/build/tmp/work/ppce300c3-poky-linux-uclibc/shadow/4.2.1-r0/temp/log.do_configure.25238)
NOTE: recipe shadow-4.2.1-r0: task do_configure: Failed
ERROR: Task 1610 (/home/yocto/yocto/BBB/poky/meta/recipes-extended/shadow/shadow_4.2.1.bb, do_configure) failed with exit code '1'
NOTE: Running task 1356 of 1916 (ID: 1783, /home/yocto/yocto/BBB/poky/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb, do_package)
NOTE: recipe gdbm-1.11-r0: task do_configure_ptest_base: Started
"
Workaround/fix: 
add 
UCLIBC_HAS_UTMP=y
in 
meta/recipes-core/uclibc/uclibc-git/uClibc.distro
Comment 8 Benjamin Esquivel 2015-11-18 18:22:30 UTC
Bogdan, thanks for making the test, I believe that the shadow package is also prepared for utmpx and it could be fixed with the change proposed in contrib::besquive/shadow-utmpx:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=besquive/shadow-utmpx&id=134beaf8391b344cfcfbd823ac89a75ed89214e9

It seems that Khem's suggestion and your test confirm that the bug is not shown with UCLIBC_HAS_UTMP=y in meta/recipes-core/uclibc/uclibc-git/uClibc.distro but this work of updating the busybox recipe will have to be done anyways and I believe it solves the bug. Plus, the person that finally updates busybox will need to undo this proposed change and go back to UTMPX
Comment 9 Benjamin Esquivel 2015-11-19 00:03:55 UTC
Hi Bogdan, I checked the --enable-utmpx option in the shadow package and it does not fix it. I'm not sure of the effects of such flag in shadow but it certainly still looks out for utmp.h. Effectively, utmp.h is placed in the sysroot by setting up UCLIBC_HAS_UTMP in uclibc like you mentioned.

So, after all it looks like UCLIBC_HAS_UTMP fixes it in one single change.

It still looks like the shadow package is not prepared to use utmpx and it might be an issue of it's own.

Bogdan, if you put the patch for the UCLIBC_HAS_UTMP = y configuration I'll assign this bug to you. Let me know.
Comment 10 Bogdan Alexandru Voiculescu 2015-11-19 07:33:05 UTC
Thank you, Benjamin! I will fix it.
Comment 11 Bogdan Alexandru Voiculescu 2015-11-19 09:47:27 UTC
The commit is here:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=bvoiculescu/master&id=3dafa6800838ed93982f6fac0bf6ce4e04d59e1b

Benjamin, please tell me if is anything more to be done from my side.
Comment 12 Benjamin Esquivel 2015-11-26 18:09:31 UTC
http://lists.openembedded.org/pipermail/openembedded-core/2015-November/113313.html

Patch sent to the ML by Bogdan
Comment 13 Ross Burton 2016-02-01 17:05:21 UTC
Merged to oe-core master in 969158d63ba2c8e2e11af41c2a6d4f1aa5b0099f.
Comment 14 Ross Burton 2016-02-02 12:50:23 UTC
Patch sent for jethro.
Comment 16 Valentin Hangan 2016-02-17 13:53:01 UTC
Used latest commit: 152914f2983c5d69001de1d46ce99547fa1e75fe and successfully built a core-image-minimal using uclib. Marking as verified