官术网_书友最值得收藏!

Configuring the emulated OS

What we just saw about schroot is nothing if we do not configure our new system to do native compilation, and to do so, we can use every Debian tool we use on our host PC:

  1. To install a complete compiling environment, we can issue the following command once inside the schroot environment:
$ sudo apt install gcc make \
bison flex ncurses-dev libssl-dev
Note that sudo will ask your usual password, that is, the password you currently use to log in to your host PC.
You might not get a password request from sudo with the following error message:
sudo: no tty present and no askpass program specified
You can try executing the preceding sudo command again, adding to it the -S option argument.
It could be possible that the apt command will notify you that some packages cannot be authenticated. Just ignore this warning and continue installation, answering yes by pressing the Y key.

If everything works well, we should now be able to execute every compiling command we used before. For instance, we can try to recompile the helloworld program again but natively (we should remove the current executable in order; make will try to recompile it again):

$ rm helloworld
$ make CFLAGS="-Wall -O2" helloworld
cc -Wall -O2 helloworld.c -o helloworld
$ file helloworld
helloworld: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=1393450a08fb9eea22babfb9296ce848bb806c21, not stripped
$ ./helloworld
Hello World!
Note that networking support is fully functional so we're now working on an emulated ARM64 environment on our hosts PC as we were on the ESPRESSObin.
主站蜘蛛池模板: 吉林市| 克拉玛依市| 罗江县| 汪清县| 体育| 博客| 越西县| 镇江市| 伊吾县| 凤庆县| 赣榆县| 美姑县| 南汇区| 吐鲁番市| 舒兰市| 江门市| 女性| 张家界市| 汽车| 准格尔旗| 勃利县| 宜宾县| 图们市| 宕昌县| 苏尼特右旗| 江安县| 淳化县| 沂南县| 张掖市| 寻乌县| 保靖县| 桑植县| 安庆市| 浦江县| 邻水| 四会市| 贵港市| 和田市| 龙江县| 郁南县| 德兴市|