Fix bugs for Make menuconfig under Mac and custom make Menuconfig interface

Source: Internet
Author: User

Handavei @ Jilin Normal University

2014.12.8


Reprint please indicate the source

*****************************************

Purpose of this article:

One, solve in Mac system make Menuconfig error: Lcd:symbol (s) not found for architecture x86_64 bug

Second, using mconf, custom implementation of a make Menuconfig interface


One, in the Mac system using make Menuconfig call graphical interface to do config, there may be the following error:

Ld:symbol (s) not found for architecture x86_64

Clang:error:linker command failed with exit code 1 (use-v to see invocation)



In general, it is most intuitive to use the graphical interface to compile BusyBox or Uboot or Linux kernels, and so on, to use make menuconfig packages. To achieve this, it is natural to execute make menuconfig.

Make Menuconfig actually is to take mconf This tool to parse the config file in the description information, and then converted to a graphical interface, of course, config file has an automatic definition of the syntax format, detailed see this article the most decentralized.


The first time you execute make menuconfig, you need to mconf this tool, in the precompiled scripts/kconfig/mconf.c build scripts/kconfig/MCONF.O After the connection phase,

The Ldconfig parameter is required to give the location of the library to which you want to connect, and the library is the NCURSESW ncurses curses library with the suffix. A or. so or. Dylib.

The script that generates Ldflags is: scripts/kconfig/lxdialog/check-lxdialog.sh


The reason for the above error is that the MAC system ncursesw ncurses curses the location of these library files can not be found through the check-lxdialog.sh command, so the generated LD Flags are not correct, and mconf cannot be generated.


The workaround for this bug is as follows:

To compile BusyBox as an example:


Open the scripts/kconfig/lxdialog/check-lxdialog.sh file.

VI scripts/kconfig/lxdialog/check-lxdialog.sh


Add the red part in.

ldflags ()          

{                  

for ext in so a dylib; do

for Libin ncursesw ncurses curses; Do

$cc-print-file-name=lib${lib }. ${ext} | grep - Q /

If [$? -eq0]; Then

echo"-L${lib}"

exit

fi

done

for libin ncursesw ncurses curses; do

If [-f /usr/lib/lib${lib}. ${ext} ]; Then

e cho "-L${lib}"

exit

fi

done

done

exit 1


Then go back to the BusyBox directory:


Make Menuconfig:




If you are doing uboot, or compiling Linux, the issue occurs if make Menuconfig:

Ld:symbol (s) not found for architecture x86_64

Clang:error:linker command failed with exit code 1 (use-v to see invocation)


The same solution can take effect.


Second, after generating the mconf, we can write the config file according to the specific syntax, and then customize the Make Menuconfig interface:

Here is my config file, the syntax is simple and generic, you can follow the following code to customize your own interface:

MainMenu "Handawei OS Configuration" config config_namestring "System Name String" default "Handawei Config-demo" help Just write you config-name bravly!config no_wptrdef_bool ychoiceprompt "Choice your CPU Arch" config Arm_tbool "arm_samsu ng "config mips_tbool" mips_cavium "config Powerpc_tbool" Power PC "config x86_tbool" Intel X86 "Endchoicechoiceprompt" Target Platform Model "config Arm_s3c2410_tbool" s3c2410 "depends on Arm_tconfig arm_s3c6410_tbool" s3c6410 "depends on ARM _tconfig Arm_exynos4412_tbool "Exynos4412" depends on Arm_tconfig arm_exynos5410_tbool "Exynos5410" depends on Arm_ Tconfig mips_cavm_octeon1_tbool "Cavium OCTEON I" depends on Mips_tconfig mips_cavm_octeon2_tbool "Cavium OCTEON II" Depends on Mips_tconfig mcu_51_tbool "MCU ATMEL Wuyi" depends on Mcu_tendchoicemenu "Hardware Settings" config SUPPORT_LINUXB Ool "Support Linux" default y if arm_t | | mips_t | | x86_t | | powerpc_t | | Sh_tconfig mcpuint "CPU numbers used in MCPU platform" default y if arm_t | | Mips_tconfig Cpu_numiNT "CPU numbers used in MCPU platform" default 2depends on Mcpuconfig core_numint "cores per CPU" range 1 if Mips_cavm_oc  Teon1_trange 1 if Mips_cavm_octeon2_tdefault "a" if Mips_trange 1 8 if Arm_tdefault "4" If Arm_exynos4412_tdefault "8" If Arm_exynos5410_tconfig arena_mem_sizeint "default memory size of ARENA Manager" default "500000000" config GPIO_MASK_CP Uhex "GPIO Mask of CPU" default 0x1 if arm_s3c2410_t | | Arm_s3c6410_tdepends on Mcpuconfig hfabool "Enable Hyper finite automata" default y if mips_cavm_octeon1_t | | Mips_cavm_octeon2_tdepends on mips_tif hfamenu "HFA hardware Configure" config Hfa_buf_numint "HFA input/temp buffers ' Nu Mber "Default 400config hfa_thd_numint" HFA thread buffers ' s number "default 400config hfa_mem_sizeint" HFA memory size (in Mega bytes) "Default 1024endmenuendifif mips_tconfig ethernet_portint" ETHERNET Port number (range 1) "Default 2range 1 5 0config gpio_portint "GPIO Port number (range 1)" Default 100range 1 1000endifendmenu

The resulting interface is as follows:




If you select Yse on exit, the configuration is saved to. config.

Then you can make it.


Fix bugs for Make menuconfig under Mac and custom make Menuconfig interface

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.