PA0 Record

遇见的问题

由于把workspace从台式机搬迁到了笔记本上(换上了新的ssd盘),尝试把原来的仓库clone下来,但是没有成功。原因是pa0部分提到的:

Besides, the script will also add some environment variables into the bash configuration file ~/.bashrc. These variables are defined by absolute path to support the compilation of the subprojects. Therefore, **DO NOT move your project to another directory once finishing the initialization, else these variables will become invalid. **Particularly, if you use shell other than bash, please set these variables in the corresponding configuration file manually.

因此,选择重新来一遍,重新做的过程中,遇到了一些新的问题:

  1. source ./bashrc 完成后,没有办法make,说的是NUME_HOME的环境不正确。
    • 查看bashrc之后,感觉自己手动改的export命令没有问题,但是还是找不到原因,于是重新clone了一下,解决了问题.
  2. make menuconfig过程中,出现报错,bison flex: not found
    • 通过sudo apt install bison flex解决问题
  3. llvm版本有问题,按照官方的方法解决。
    • sudo apt-get install llvm-11
    • 改动源文件:filelist.mk
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      diff --git a/nemu/src/utils/filelist.mk b/nemu/src/utils/filelist.mk
      index c9b1708..b7b2e02 100644
      --- a/nemu/src/utils/filelist.mk
      +++ b/nemu/src/utils/filelist.mk
      @@ -1,5 +1,5 @@
      ifdef CONFIG_ITRACE
      CXXSRC = src/utils/disasm.cc
      -CXXFLAGS += $(shell llvm-config --cxxflags) -fPIE
      -LIBS += $(shell llvm-config --libs)
      +CXXFLAGS += $(shell llvm-config-11 --cxxflags) -fPIE
      +LIBS += $(shell llvm-config-11 --libs)
      endif

提问的智慧和别像弱智一样提问读后感

new bug

  1. am宏定义有问题,改成数字后还是运行不了
    可以运行,是运行的命令输错了,应该是make ARCH=native run mainargs=mario(开始忘记写run了)