Git Product home page Git Product logo

Comments (7)

YudeFang avatar YudeFang commented on June 28, 2024 1

你参考一下我们的示例项目里选项: https://github.com/OpenXiangShan/CPU2006LiteWrapper/blob/33c53413dbfe604867e297201bfbb07f3abac005/Makefile.apps#L76
其中比较关键的是:

  • 使用riscv64-unknown-linux-gnu工具链
  • 静态链接SPECCPU:-static

你说的 “编译出来的可执行文件大小跟正确的相比都小很多”,那是因为你没有静态链接

已解决

是通过静态编译解决了吗?你的答案对社区很重要 :)

已解决 以下是我的spec编译配置文件修改
COPTIMIZE = -O2 -fno-strict-aliasing -static
CXXOPTIMIZE = -O2 -fno-strict-aliasing -static
FOPTIMIZE = -O2 -fno-strict-aliasing -static

from nemu.

YudeFang avatar YudeFang commented on June 28, 2024

我生成的可执行文件是这两个,我都试了 都不太行
image
还有就是我的可执行文件比正确的aster可执行文件貌似小很多,所以确实不知道哪一步错了

from nemu.

shinezyy avatar shinezyy commented on June 28, 2024

额,你用的是unknown-elf-gcc,

你可以看看我们这个项目的readme,我们给出的编译speccpu06示例的时候用的是riscv64-unknown-linux-gnu-:
https://github.com/OpenXiangShan/CPU2006LiteWrapper

unknown-elf-gcc和unknown-linux-gnu的区别可以参考toolchain的readme:
https://github.com/riscv-collab/riscv-gnu-toolchain/blob/master/README.md

一个可能不太准确的概括:你的SPECCPU是在Linux环境下运行的,你应该用riscv64-unknown-linux-gnu前缀的工具链。

from nemu.

YudeFang avatar YudeFang commented on June 28, 2024

from nemu.

shinezyy avatar shinezyy commented on June 28, 2024

你参考一下我们的示例项目里选项:
https://github.com/OpenXiangShan/CPU2006LiteWrapper/blob/33c53413dbfe604867e297201bfbb07f3abac005/Makefile.apps#L76

其中比较关键的是:

  • 使用riscv64-unknown-linux-gnu工具链
  • 静态链接SPECCPU:-static

你说的 “编译出来的可执行文件大小跟正确的相比都小很多”,那是因为你没有静态链接

from nemu.

YudeFang avatar YudeFang commented on June 28, 2024

你参考一下我们的示例项目里选项: https://github.com/OpenXiangShan/CPU2006LiteWrapper/blob/33c53413dbfe604867e297201bfbb07f3abac005/Makefile.apps#L76

其中比较关键的是:

  • 使用riscv64-unknown-linux-gnu工具链
  • 静态链接SPECCPU:-static

你说的 “编译出来的可执行文件大小跟正确的相比都小很多”,那是因为你没有静态链接

已解决

from nemu.

shinezyy avatar shinezyy commented on June 28, 2024

你参考一下我们的示例项目里选项: https://github.com/OpenXiangShan/CPU2006LiteWrapper/blob/33c53413dbfe604867e297201bfbb07f3abac005/Makefile.apps#L76
其中比较关键的是:

  • 使用riscv64-unknown-linux-gnu工具链
  • 静态链接SPECCPU:-static

你说的 “编译出来的可执行文件大小跟正确的相比都小很多”,那是因为你没有静态链接

已解决

是通过静态编译解决了吗?你的答案对社区很重要 :)

from nemu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.