nanopi k2 module compilation record[1]

Reference: NanoPi-K2 controls GPIO_SHIROSHIROYAN's blog-CSDN blog
at:
http://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabi/
http://releases.linaro.org/ components/toolchain/binaries/4.9-2017.01/aarch64-linux-gnu/
Download the compilation tool, unzip it, and add it to the environment.
Modify the /etc/bash.bashrc file (this file is only applicable to the current user)

$sudo gedit /etc/bash.bashrc

Then add the following code in the blank space at the end of the file:

# Add ARM toolschain path

# Add ARM toolschain path
if [ -d /usr/local/ARM-toolchain/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi ] ; then
    PATH=/usr/local/ARM-toolchain/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin:"${PATH}"
fi

4. Make the new environment variables take effect (without restarting the computer)

$ source /etc/bash.bashrc

Source code
https://gitee.com/jason1291015298/amlogic-nanopi-k2.git

Questions:
1

https://blog.csdn.net/zhoukaiqili/article/details/126191871
Compiling the Linux kernel appears: usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x50): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
1: The reason is that
the gcc version is high. My current environment is 22.04 gcc 11.0 or above version
1
2: Solution
modification Find the YYLTYPE yyloc line in the dtc-lexer.lex.c_shipped file in the scripts/dtc directory
. At line 640, add extern before it 
to save and exit.
Make compiles 
normally.

2
https://blog.csdn.net/qq_28837389/article/details/118100687
kernel compilation error|/bin/sh: 1: bc: not found

Solution
$ sudo apt-get install bc

Guess you like

Origin blog.csdn.net/hhcgn/article/details/129629720