make menuconfig problem on NixOS

busybox-ml at al.fstn.top busybox-ml at al.fstn.top
Mon Oct 7 17:16:59 UTC 2024


> lxdialog relies on a pkg-config program being in the PATH in order to
> get the correct compiler and linker flags for ncurses. If it doesn't
> find such a program, it hardcodes looking for ncurses under /usr, which
> of course doesn't work for Nix.

Thanks for the clue! In my flake.nix after I add the pkg-config package, i can run the menuconfig.
I had another problem when running the make command related to the tc.c file, and after following the workaround specified here [1] I got the following
error when trying to build busybox as a static binary:

Your linker does not support --sort-section,alignment
Your linker does not support --sort-common
Static linking against glibc, can't use --gc-sections
Trying libraries: m resolv
Failed: -Wl,--start-group -lm -lresolv   -Wl,--end-group
Output of:
gcc -malign-data=abi -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 -finline-limit=0 -fno-builtin-strlen -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 -fno-builtin-printf -Oz -static -o busybox_unstripped -Wl,--start-group applets/built-in.o archival/lib.a archival/libarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a klibc-utils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a mailutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a printutils/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a util-linux/volume_id/lib.a archival/built-in.o archival/libarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o klibc-utils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o mailutils/built-in.o miscutils/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o printutils/built-in.o procps/built-in.o runit/built-in.o selinux/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o util-linux/volume_id/built-in.o -Wl,--end-group -Wl,--start-group -lm -lresolv -Wl,--end-group

[1]: http://lists.busybox.net/pipermail/busybox-cvs/2024-January/041752.html

Pasha


On Sunday, October 6th, 2024 at 8:54 PM, Laurent Bercot 'ska-dietlibc at skarnet.org' <busybox-ml+ska-dietlibc=skarnet.org at al.fstn.top> wrote:

>
>
> 
>
> > What could be the problem here? Because I think that I have installed
> > ncurses already by specifying it as a flake package. And why
> > can't I open menuconfig in the busybox repo, but I can open it in the
> > linux kernel repo? Thanks!
>
>
> lxdialog relies on a pkg-config program being in the PATH in order to
> get the correct compiler and linker flags for ncurses. If it doesn't
> find such a program, it hardcodes looking for ncurses under /usr, which
> of course doesn't work for Nix.
>
> Recent versions of the Linux kernel have changed the invocation of
> pkg-config to be customizable via the HOSTPKG_CONFIG variable. I
> suspect Nix uses this variable to control stuff built with Kconfig.
>
> But busybox uses a version of Kconfig that predates that change, and
> hardcodes the call to pkg-config (look at
> scripts/kconfig/lxdialog/check-lxdialog.sh, as opposed to
> scripts/kconfig/mconf-cfg.sh in a recent Linux kernel).
>
> Nix should be able to accommodate a hardcoded call to pkg-config, by
> setting all the necessary variables in the current environment, but
> my guess is that they don't bother and use HOSTPKG_CONFIG instead, which
> does not work for busybox's Kconfig.
>
> --
> Laurent
>



More information about the busybox mailing list