From: Nathan Chancellor <nathan@kernel.org>
To: Arkadiusz Kozdra <floss@arusekk.pl>
Cc: linux-kbuild@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Nicolas Schier <nsc@kernel.org>, Jakub Kicinski <kuba@kernel.org>,
Alex Deucher <alexander.deucher@amd.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Mark Brown <broonie@kernel.org>, Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH] kconfig: fix static linking of nconf
Date: Sat, 10 Jan 2026 16:20:43 -0700 [thread overview]
Message-ID: <20260110232043.GA90060@ax162> (raw)
In-Reply-To: <20260110114808.22595-1-floss@arusekk.pl>
On Sat, Jan 10, 2026 at 12:48:08PM +0100, Arkadiusz Kozdra wrote:
> When running make nconfig with a static linking host toolchain,
> the libraries are linked in an incorrect order,
> resulting in errors similar to the following:
>
> $ MAKEFLAGS='HOSTCC=cc\ -static' make nconfig
> /usr/bin/ld: /usr/lib64/gcc/x86_64-unknown-linux-gnu/14.2.1/../../../../lib64/libpanel.a(p_new.o): in function `new_panel':
> (.text+0x13): undefined reference to `_nc_panelhook_sp'
> /usr/bin/ld: (.text+0x6c): undefined reference to `_nc_panelhook_sp'
>
> Fixes: 1c5af5cf9308 ("kconfig: refactor ncurses package checks for building mconf and nconf")
> Signed-off-by: Arusekk <floss@arusekk.pl>
> ---
> scripts/kconfig/nconf-cfg.sh | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/kconfig/nconf-cfg.sh b/scripts/kconfig/nconf-cfg.sh
> index a20290b1a37d..fedebbd6b2c8 100755
> --- a/scripts/kconfig/nconf-cfg.sh
> +++ b/scripts/kconfig/nconf-cfg.sh
> @@ -6,8 +6,8 @@ set -eu
> cflags=$1
> libs=$2
>
> -PKG="ncursesw menuw panelw"
> -PKG2="ncurses menu panel"
Is it worth a comment that the order of these packages is intentional to
support static library builds? I do not mind adding after the fact to
save you from sending a v2. I guess this situation is not too common
since 1c5af5cf9308 is over six years old at this point but if any other
dependencies become necessary in the future, it might help folks place
them in the correct order.
> +PKG="menuw panelw ncursesw"
> +PKG2="menu panel ncurses"
>
> if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then
> if ${HOSTPKG_CONFIG} --exists $PKG; then
> @@ -28,19 +28,19 @@ fi
> # find ncurses by pkg-config.)
> if [ -f /usr/include/ncursesw/ncurses.h ]; then
> echo -D_GNU_SOURCE -I/usr/include/ncursesw > ${cflags}
> - echo -lncursesw -lmenuw -lpanelw > ${libs}
> + echo -lmenuw -lpanelw -lncursesw > ${libs}
> exit 0
> fi
>
> if [ -f /usr/include/ncurses/ncurses.h ]; then
> echo -D_GNU_SOURCE -I/usr/include/ncurses > ${cflags}
> - echo -lncurses -lmenu -lpanel > ${libs}
> + echo -lmenu -lpanel -lncurses > ${libs}
> exit 0
> fi
>
> if [ -f /usr/include/ncurses.h ]; then
> echo -D_GNU_SOURCE > ${cflags}
> - echo -lncurses -lmenu -lpanel > ${libs}
> + echo -lmenu -lpanel -lncurses > ${libs}
> exit 0
> fi
>
> --
> 2.51.2
>
next prev parent reply other threads:[~2026-01-10 23:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-10 11:48 [PATCH] kconfig: fix static linking of nconf Arkadiusz Kozdra
2026-01-10 23:20 ` Nathan Chancellor [this message]
2026-01-12 13:24 ` Arkadiusz Kozdra
2026-01-14 13:26 ` Nicolas Schier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260110232043.GA90060@ax162 \
--to=nathan@kernel.org \
--cc=alexander.deucher@amd.com \
--cc=broonie@kernel.org \
--cc=floss@arusekk.pl \
--cc=geert+renesas@glider.be \
--cc=kuba@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nsc@kernel.org \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox