配置外部编译器

make menuconfig
Target options --->
Target Architecture (ARM (little endian))  --->                                
                Target Architecture Variant (cortex-A7)  --->
                Target ABI (EABI)  ---> 
                Floating point strategy (Soft float)  --->
  
Toolchain --->
Toolchain type (External toolchain)  --->                                        
                Toolchain (Custom toolchain)  --->  
                Toolchain origin (Pre-installed toolchain)  --->  
            (/opt/hisi-linux/x86-arm/arm-hisiv300-linux) Toolchain path 
            ($(ARCH)-hisiv300-linux-uclibcgnueabi) Toolchain prefix  
                External toolchain kernel headers series (3.4.x)  --->  
                External toolchain C library (uClibc)  --->  
            [ ] Toolchain has large file support? (NEW)  
            [ ] Toolchain has IPv6 support? (NEW)  
            -*- Toolchain has WCHAR support?                  
            [*] Toolchain has locale support? 
            [*] Toolchain has threads support? (NEW)  
            [*]   Toolchain has threads debugging support? (NEW)  
            [*]   Toolchain has NPTL threads support? (NEW)  
            [ ] Toolchain has SSP support? (NEW)  
            [ ] Toolchain has RPC support? (NEW)  
            [*] Toolchain has C++ support?     

buildroot 重新编译 package :

For packages relying on Buildroot packages infrastructures (see this section ??? for details), the following stamp files are relevant:
1. output/build/packagename-version/.stamp_configured. If removed, Buildroot will trigger the recompilation of the package from the configuration step (execution of ./configure).
2. output/build/packagename-version/.stamp_built. If removed, Buildroot will trigger the recompilation of the package from the compilation step (execution of make).

重新编译
删除目录下的.stamp_built和.stamp_target_installed
.stamp_configured, .stamp_downloaded, .stamp_patched,.stamp_extracted
其实每个工具包里都有这样的几个文件,这几个文件主要控制这个工具包的下载,解压,打包,配置,编译,安装

自定义软件包:

  1. package目录下新建自定义软件包的文件夹xxx

  2. package/Config.in中添加指向新增自定义软件包的目录选项

  3. 在文件夹中添加对应的Config.inxxx.mk文件,具体内容可参考其他包:—可以展开

  4. 最后添加对应的自定义软件包目录
    通过make menuconfig选中自定义APP
    通过Target packages -> Private package进入,选中xxx
    然后make savedefconfig
    可以make xxx单独编译

buildroot 添加外部编译链:

  1. Toolchain->Toolchain type (External toolchain)->External toolchain
  2. Toolchain origin (Pre-installed toolchain)->Pre-installed toolchain
  3. Toolchain path

buildroot编译busybox时报错:

undefined reference to 'posix_fallocate'
修改busybox的配置文件(package/busybox/),去掉fallocate相关模块

编译

通过make xxx_defconfig来选择一个defconfig(./configs),
然后配置
make ARCH=arm menuconfig
Target options配置根据芯片手册来配置
toolchain设置,这里不使用buildroot编译出来的gcc, 使用外部官方的编译链来编译文件系统
Kernel Headers

make <pkg>-dirclean         - Remove <pkg> build directory
具体可见 make --help

相关命令

make savedefconfig
make spon_rk3399_arm_defconfig
make menuconfig
make