Bug 16413 - menuconfig doesn't work on Kubuntu 24.04 (linking ncurses fails)
Summary: menuconfig doesn't work on Kubuntu 24.04 (linking ncurses fails)
Status: NEW
Alias: None
Product: BSPs
Classification: Build System, Metadata & Runtime
Component: bsps-meta-intel (show other bugs)
Version: 6.0.5
Hardware: x86 x86_64
: Medium+ normal
Target Milestone: 6.1 M4
Assignee: Martin K
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-09-01 07:16 UTC by Martin K
Modified: 2026-09-18 21:44 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
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 Martin K 2026-09-01 07:16:22 UTC
I'm on Kubuntu 24.04. When I try to configure my intel kernel with
bitbake virtual/kernel -c menuconfig
I get the following error:

[...]
  GEN     Makefile
  HOSTCC  scripts/basic/fixdep
libs='-lncurses -ltinfo'
cflags='-DCURSES_LOC="<curses.h>"'
  HOSTCC  scripts/kconfig/mconf.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mnconf-common.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/mconf
/home/me/yocto/my-distro/build/tmp/hosttools/ld: scripts/kconfig/lxdialog/yesno.o: warning: relocation against `acs_map' in read-only section `.text'
/home/me/yocto/my-distro/build/tmp/hosttools/ld: scripts/kconfig/mconf.o: in function `show_help':
mconf.c:(.text+0x739): undefined reference to `stdscr'
/home/me/yocto/my-distro/build/tmp/hosttools/ld: scripts/kconfig/lxdialog/checklist.o: in function `print_arrows':
checklist.c:(.text+0x2c): undefined reference to `wmove'
/home/me/yocto/my-distro/build/tmp/hosttools/ld: checklist.c:(.text+0x43): undefined reference to `wattrset'
/home/me/yocto/my-distro/build/tmp/hosttools/ld: checklist.c:(.text+0x4a): undefined reference to `acs_map'
/home/me/yocto/my-distro/build/tmp/hosttools/ld: checklist.c:(.text+0x52): undefined reference to `waddch'
[...]
/home/me/yocto/my-distro/build/tmp/hosttools/ld: yesno.c:(.text+0x30d): undefined reference to `delwin'
/home/me/yocto/my-distro/build/tmp/hosttools/ld: yesno.c:(.text+0x340): undefined reference to `wrefresh'
/home/me/yocto/my-distro/build/tmp/hosttools/ld: scripts/kconfig/lxdialog/yesno.o: in function `print_buttons':
yesno.c:(.text+0x7f): undefined reference to `wrefresh'
/home/me/yocto/my-distro/build/tmp/hosttools/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make[2]: *** [/home/me/yocto/my-distro/build/tmp/work-shared/my-board/kernel-source/scripts/Makefile.host:123: scripts/kconfig/mconf] Error 1
make[1]: *** [/home/me/yocto/my-distro/build/tmp/work-shared/my-board/kernel-source/Makefile:748: menuconfig] Error 2
make: *** [/home/me/yocto/my-distro/build/tmp/work-shared/my-board/kernel-source/Makefile:248: __sub-make] Error 2
Command failed.
Press any key to continue...

I found the patches 0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch and 0002-mconf-fix-output-of-cflags-and-libraries.patch in meta-intel/recipes-kernel/linux/linux-intel. If I understand them correctly, they try to fix problems like mine, but the result seems to be wrong.

The resulting mconf-cfg.sh has two if-blocks for handling $CROSS_CURSES_LIB:

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

set -eu

cflags=$1
libs=$2

PKG="ncursesw"
PKG2="ncurses"

if [ "$CROSS_CURSES_LIB" != "" ]; then
    echo libs=\'$CROSS_CURSES_LIB\'
    if [ x"$CROSS_CURSES_INC" != x ]; then
	echo cflags=\'$CROSS_CURSES_INC\'
    fi
    exit 0
fi

if [ "$CROSS_CURSES_LIB" != "" ]; then
    echo $CROSS_CURSES_LIB > ${libs}
    if [ x"$CROSS_CURSES_INC" != x ]; then
	echo $CROSS_CURSES_INC > ${cflags}
    fi
    exit 0
fi

if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then
	if ${HOSTPKG_CONFIG} --exists $PKG; then
		${HOSTPKG_CONFIG} --cflags ${PKG} > ${cflags}
		${HOSTPKG_CONFIG} --libs ${PKG} > ${libs}
		exit 0
	fi

	if ${HOSTPKG_CONFIG} --exists ${PKG2}; then
		${HOSTPKG_CONFIG} --cflags ${PKG2} > ${cflags}
		${HOSTPKG_CONFIG} --libs ${PKG2} > ${libs}
		exit 0
	fi
fi
[...]

But only the second one seems to be correct. If I remove the first one, menuconfig works fine.
My quick-and-dirty workaround is, to add a third patch on my layer to remove the first if-block, but that doesn't seems to be the correct way to fix this.

Best regards
Martin
Comment 1 Randy MacLeod 2026-09-03 14:41:00 UTC
Martin, 

Can you check the patches that are used in linux-yocto which may be in yocto-kernel-cache. If not, ask yogesh.tyagi@intel.com or Bruce Ashfield.
Comment 2 Yoann Congal 2026-09-03 14:43:42 UTC
Interestingly, those were patched yesterday: https://git.yoctoproject.org/yocto-kernel-cache/commit/?id=225a864c394f4a6db5d774a45909304cdad5f2f8
Comment 3 Richard Purdie 2026-09-18 21:44:02 UTC
I think this may have been fixed now?