This should maybe be split into 2 different bugs? One for sdk and one for esdk? Not sure... Issue: Running make menuconfig in the esdk fails. The esdk has the full cross toolchain so it should be able to both run make menuconfig and cross build a full kernel. Result: bavery@bavery-WS-DESK:~/src/linux-stable$ . /big/TEST/master-esdk-minimal-core2/environment-setup-core2-64-poky-linux SDK environment now set up; additionally you may now run devtool to perform development tasks. Run devtool --help for further details. bavery@bavery-WS-DESK:~/src/linux-stable$ make menuconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/mconf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o *** Unable to find the ncurses libraries or the *** required header files. *** 'make menuconfig' requires the ncurses libraries. *** *** Install ncurses (ncurses-devel) and try again. *** make[1]: *** [scripts/kconfig/Makefile:201: scripts/kconfig/dochecklxdialog] Error 1 make: *** [Makefile:546: menuconfig] Error 2 ---- If I exit the esdk environment, the command "make menuconfig" works fine.
Saul said he would look at this. Adding nativesdk-ncurses to nativesdk-packagegroup-sdk-host.bb is not sufficient because the check-lxdiaog.sh uses $cc for its test and it seems to be stripping things like CC of the sysroot,
The issue revolves around the use of pkg-config. In the sdk and esdk we have *2* pkg-configs. pkg-config (intended for use by builds for the target) and pkg-config-native (intended or use by host tools aka native tools) . In the kernel, it uses pkg-config to determine the location of libncurses. Since it calls pkg-config, it gets the information for the target sysroot and things break. If you patch the kernel (in scripts/kconfig/lxdialog/check-lxdialog.sh) and change pkg-congig to pkg-config-native, everything works fine. A different workaround is to run make menuconfig in a non-sdk enabled shell environment and then do the actual kernel build (aka for the target) in the sdk enabled shell environment. This way, menuconfig would get the host libs and the kernel builds would get the target libs. This is *NOT* easy or even possible to fix in general. We need some documentation explaining the issue clearly and outlining the solutions. For cases where the code we are trying to build with the sdk/esdk uses pkg-config to enable both host side builds and target side builds; we are stuck. The kernel is a simple example of this since it does it in 2 separable steps. Some pkgs use host side tools to generate source code that is then built for the target. These would also have issues. Note that in the sdk/esdk we are building code and not necessarily building recipes that we have patched to work around this issue...
Noting this also, we need to extend the required host installed packages to include the ncurses-devel for the workaround to work correctly.
nope, not needed. if we change pkg-config to pkg-config-native in scripts/kconfig/lxdialog/check-lxdialog.sh , it uses the curses.h from the sdk . verified in an ubuntu 16.04 container w/o curses-devel installed.
A couple of additional ideas: 1) use devtool kernel menuconfig -- this could easily hide the -native or not -- *requires* kernel devs to use devtool, which I think is a bad idea. -- i kinda think the only thing devtool should do with the kernel in the esdk is to extract it and its config. everything else should be natural flow. 2) turn pkg-config into a bash script and have it check to see who is calling it and vector to the "right" pkg-config. Right now, the kernel lx0check-curses.sh is the only instance in which we need -native. This is a tad hacky but the fact that we are using a tool not made for cross in this way kinda mitigates that. Would be easy to add additional "native caller's" if the pkg-config script read them in from a regex-file. 3) upstream a patch to the kernel so that if some env variables were set to provide the correct ncurses libs and args, the kernel wouldn't look for the "right" ncurses setup, it would just use the ones you gave it. Call it the Do tell,Don't ask patch :)
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=fedac61ad973981b824a2c79ffc9feaa6d754dba http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=d98a2f4df0963fe14fff85650185642c51b63c97