History

kconfig: fix static linking of nconf

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'

Arkadiusz Kozdra committed 10 months ago

Commit baaecfc1 parent 946d4621 file · +6 −5Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/nconf-cfg.sh+6−5
@@ -6,8 +6,9 @@ set -eu · 5 unmodified lines
6cflags=$16cflags=$1
7libs=$27libs=$2
8 8
9PKG="ncursesw menuw panelw"9# Keep library order for static linking (HOSTCC='cc -static')
10PKG2="ncurses menu panel"10PKG="menuw panelw ncursesw"
11PKG2="menu panel ncurses"
11 12
12if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then13if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then
13 if ${HOSTPKG_CONFIG} --exists $PKG; then14 if ${HOSTPKG_CONFIG} --exists $PKG; then
@@ -28,19 +29,19 @@ fi · 14 unmodified lines
28# find ncurses by pkg-config.)29# find ncurses by pkg-config.)
29if [ -f /usr/include/ncursesw/ncurses.h ]; then30if [ -f /usr/include/ncursesw/ncurses.h ]; then
30 echo -D_GNU_SOURCE -I/usr/include/ncursesw > ${cflags}31 echo -D_GNU_SOURCE -I/usr/include/ncursesw > ${cflags}
31 echo -lncursesw -lmenuw -lpanelw > ${libs}32 echo -lmenuw -lpanelw -lncursesw > ${libs}
32 exit 033 exit 0
33fi34fi
34 35
35if [ -f /usr/include/ncurses/ncurses.h ]; then36if [ -f /usr/include/ncurses/ncurses.h ]; then
36 echo -D_GNU_SOURCE -I/usr/include/ncurses > ${cflags}37 echo -D_GNU_SOURCE -I/usr/include/ncurses > ${cflags}
37 echo -lncurses -lmenu -lpanel > ${libs}38 echo -lmenu -lpanel -lncurses > ${libs}
38 exit 039 exit 0
39fi40fi
40 41
41if [ -f /usr/include/ncurses.h ]; then42if [ -f /usr/include/ncurses.h ]; then
42 echo -D_GNU_SOURCE > ${cflags}43 echo -D_GNU_SOURCE > ${cflags}
43 echo -lncurses -lmenu -lpanel > ${libs}44 echo -lmenu -lpanel -lncurses > ${libs}
44 exit 045 exit 0
45fi46fi
46 47