Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

Unable to run make menuconfig for kernel sources[solved]

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
12 posts • Page 1 of 1
Author
Message
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

Unable to run make menuconfig for kernel sources[solved]

  • Quote

Post by Adel Ahmed » Sun Jan 23, 2022 2:26 pm

I am trying to install gentoo on my sony xperia m mobile phone.
I have downloaded the stage3 archive and extracted, I have git cloned the sources from the following link:
https://github.com/icoolguy1995/sony-xperia-m-kernel

I cd into the directory and run make menuconfig to find the following error:

Code: Select all

localhost ~/kernel/sony-xperia-m-kernel # make menuconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.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/mconf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/mconf
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: scripts/kconfig/lxdialog/checklist.o: undefined reference to symbol 'keypad'
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: /lib/libtinfow.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [scripts/Makefile.host:127: scripts/kconfig/mconf] Error 1
make: *** [Makefile:497: menuconfig] Error 2
any help would be appreciated
Last edited by Adel Ahmed on Sun Jan 30, 2022 6:04 am, edited 1 time in total.
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Sun Jan 23, 2022 4:56 pm

May be
https://github.com/samtools/samtools/issues/1149

Code: Select all

./configure;make menuconfig
:)
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

Re: Unable to run make menuconfig for kernel sources

  • Quote

Post by Hu » Sun Jan 23, 2022 5:21 pm

Adel Ahmed wrote:I cd into the directory and run make menuconfig to find the following error:

Code: Select all

localhost ~/kernel/sony-xperia-m-kernel # make menuconfig
  HOSTLD  scripts/kconfig/mconf
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: scripts/kconfig/lxdialog/checklist.o: undefined reference to symbol 'keypad'
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: /lib/libtinfow.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [scripts/Makefile.host:127: scripts/kconfig/mconf] Error 1
make: *** [Makefile:497: menuconfig] Error 2
What is the full command line used to invoke the linker for this file? Typically, this error would indicate that you should have linked to an additional DSO, and did not. In this case, the second error even seems to point you in the right direction. Specifically, you should have linked to libtinfow.so.6 to get this symbol, and did not.
alamahant wrote:May be
https://github.com/samtools/samtools/issues/1149

Code: Select all

./configure;make menuconfig
Could you elaborate? The kernel normally doesn't have a configure script at all, so I don't see how to apply this advice. Also, if it did apply, shouldn't it be ./configure && make menuconfig? Usually, running make after configure fails will not be useful.
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Sun Jan 23, 2022 6:03 pm

Well the url refers to Gentoo with the same kind of error.
I should have known better the url case probably concerns some ordinary package whereas here we are dealing with a kernel.
Sorry Hu for my lapse of judgement.
:)
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sun Jan 23, 2022 9:19 pm

You meant well. Maybe next time, check locally whether the instructions make sense? :) New users might see your response, try it, and get confused or frustrated when it doesn't work, because they think they're doing it wrong, rather than that the advice is not applicable to the problem at hand.
Top
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

  • Quote

Post by Adel Ahmed » Tue Jan 25, 2022 1:40 am

the kernel does not indeed have a configure script.
what do you mean by what is the linker command? how can I find this out?
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2111
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Tue Jan 25, 2022 11:16 am

Adel Ahmed wrote:how can I find this out?
Use make V=1 menuconfig. The build should fail again, but this time it should print the full compiler / linker invocation instead of "HOSTLD scripts/kconfig/mconf".
Top
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

  • Quote

Post by Adel Ahmed » Tue Jan 25, 2022 11:35 am

thanks for the clarification:

Code: Select all

make -f scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
mkdir -p include/linux include/config
make -f scripts/Makefile.build obj=scripts/kconfig menuconfig
/bin/sh /root/kernel/sony-xperia-m-kernel/scripts/kconfig/lxdialog/check-lxdialog.sh -check gcc -I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>" -DLOCALE  -lncursesw
  gcc  -o scripts/kconfig/mconf scripts/kconfig/mconf.o scripts/kconfig/zconf.tab.o scripts/kconfig/lxdialog/checklist.o scripts/kconfig/lxdialog/util.o scripts/kconfig/lxdialog/inputbox.o scripts/kconfig/lxdialog/textbox.o scripts/kconfig/lxdialog/yesno.o scripts/kconfig/lxdialog/menubox.o  -lncursesw
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: scripts/kconfig/lxdialog/checklist.o: undefined reference to symbol 'keypad'
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: /lib/libtinfow.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [scripts/Makefile.host:127: scripts/kconfig/mconf] Error 1
make: *** [Makefile:497: menuconfig] Error 2
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2111
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Tue Jan 25, 2022 3:46 pm

The kernel for the Sony Xperia from the Git repository that you are using is based on a old upstream version (3.4.0), and the detection logic for the Ncurses libraries contained in its scripts/kconfig/lxdialog/check-lxdialog.sh script won't work. Newer kernels use a different script (scripts/kconfig/mconf-cfg.sh) with a detection logic based on the pkg-config program, which is more robust. If you really want to use that particular kernel, it looks like you'll have to modify check-lxdialog.sh's ldflags() function so that it returns -lncursesw -ltinfow.
Top
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

  • Quote

Post by Adel Ahmed » Wed Jan 26, 2022 9:56 am

I have changed the ldflags function from :

Code: Select all

ldflags()
{
        for ext in so a dylib ; do
                for lib in ncursesw ncurses curses ; do
                        $cc -print-file-name=lib${lib}.${ext} | grep -q /
                        if [ $? -eq 0 ]; then
                                echo "-l${lib}"
                                exit
                        fi
                done
        done
        exit 1
}
to

Code: Select all

ldflags()
{
        for ext in so a dylib ; do
                for lib in 'ncursesw tinfow' 'ncurses tinfow' 'curses tinfow' ; do
                        $cc -print-file-name=lib${lib}.${ext} | grep -q /
                        if [ $? -eq 0 ]; then
                                echo "-l${lib}"
                                exit
                        fi
                done
        done
        exit 1
}
but now I'm getting:

Code: Select all

localhost ~/kernel/sony-xperia-m-kernel # make V=1 menuconfig                      make -f scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
mkdir -p include/linux include/config
make -f scripts/Makefile.build obj=scripts/kconfig menuconfig
/bin/sh /root/kernel/sony-xperia-m-kernel/scripts/kconfig/lxdialog/check-lxdialog.sh -check gcc -I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>" -DLOCALE
  gcc  -o scripts/kconfig/mconf scripts/kconfig/mconf.o scripts/kconfig/zconf.tab.o scripts/kconfig/lxdialog/checklist.o scripts/kconfig/lxdialog/util.o scripts/kconfig/lxdialog/inputbox.o scripts/kconfig/lxdialog/textbox.o scripts/kconfig/lxdialog/yesno.o scripts/kconfig/lxdialog/menubox.o
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: scripts/kconfig/mconf.o: in function `show_help':
mconf.c:(.text+0xadc): undefined reference to `stdscr'
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: scripts/kconfig/mconf.o: in function `main':
mconf.c:(.text.startup+0x88): undefined reference to `initscr'
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: mconf.c:(.text.startup+0x180): undefined reference to `stdscr'
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: scripts/kconfig/lxdialog/checklist.o: in function `print_arrows':
checklist.c:(.text+0x30): undefined reference to `wmove'
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: checklist.c:(.text+0x60): undefined reference to `waddch'
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/11.2.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: checklist.c:(.text+0x74): undefined reference to `waddnstr'
I have not included the entire log as they are mostly undefined reference to errors.
is there any way to get around this without having to work around the errors 1 by 1?
I cannot use the latest gentoo-sources as this is a mobile phone and getting a working kernel that way will involve much more work(not just configuring and compiling, but porting the kernel to the phone).
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Wed Jan 26, 2022 4:23 pm

Adel Ahmed wrote:I have changed the ldflags function from :
to

Code: Select all

ldflags()
{
        for ext in so a dylib ; do
                for lib in 'ncursesw tinfow' 'ncurses tinfow' 'curses tinfow' ; do
                        $cc -print-file-name=lib${lib}.${ext} | grep -q /
This change looks wrong to me. I doubt you have a file named libncurses tinfow.so, and even if you did, the $cc line isn't quoted properly to find it. You need the script to print -lncursesw -ltinfow or similar, depending on whether you want narrow or wide ncurses. Since you are already hacking up the build system, you could try replacing the entire function with just:

Code: Select all

ldflags() {
	printf '%s ' -lncurses -ltinfo
}
Again, adjust the narrow/wide as appropriate.
Adel Ahmed wrote:but now I'm getting:

Code: Select all

  gcc  -o scripts/kconfig/mconf scripts/kconfig/mconf.o scripts/kconfig/zconf.tab.o scripts/kconfig/lxdialog/checklist.o scripts/kconfig/lxdialog/util.o scripts/kconfig/lxdialog/inputbox.o scripts/kconfig/lxdialog/textbox.o scripts/kconfig/lxdialog/yesno.o scripts/kconfig/lxdialog/menubox.o
This line shows your change had no effect on the linker, or maybe even negative effect. Now it is not trying to link any ncurses or tinfo libraries at all. That will definitely cause the undefined reference errors you showed.
Adel Ahmed wrote:is there any way to get around this without having to work around the errors 1 by 1?
Use a version where someone has already fixed this, or find and install an ancient toolchain that was current when this kernel was forked from mainline.
Adel Ahmed wrote:I cannot use the latest gentoo-sources as this is a mobile phone and getting a working kernel that way will involve much more work(not just configuring and compiling, but porting the kernel to the phone).
The code for this phone was never merged to mainline?
Top
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

  • Quote

Post by Adel Ahmed » Sun Jan 30, 2022 6:00 am

I have changed the function to :

Code: Select all

ldflags() {
   printf '%s ' -lncurses -ltinfo
}
and it works now thank you.
unfortunately the code was never merged into the mainline :(.
Top
Post Reply
  • Print view

12 posts • Page 1 of 1

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic