【问题标题】:g++ compilation fails when profiling enabled启用分析时 g++ 编译失败
【发布时间】:2020-12-23 11:26:46
【问题描述】:

我有一个工作程序,我想对其进行分析。因此,我只是在 Makefile 中添加了一个 -pg 开关。这会重复数千次相同的消息:

/tmp/ccOlI4CC.s:62095: Error: bad expression
/tmp/ccOlI4CC.s:62095: Error: junk `mcount@GOTPCREL(%rip)' after expression
/tmp/ccOlI4CC.s:62417: Error: bad expression
/tmp/ccOlI4CC.s:62417: Error: junk `mcount@GOTPCREL(%rip)' after expression

我很着急。我该怎么办?

【问题讨论】:

  • 提供一些minimal reproducible example 和有关您的操作系统的详细信息。还提供程序的源代码、编译命令、g++gprof 的确切版本

标签: g++ gprof


【解决方案1】:

通过删除 -masm=intel 标志解决了问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-14
    • 2015-03-13
    • 1970-01-01
    • 2016-03-11
    • 1970-01-01
    • 2011-02-02
    • 1970-01-01
    相关资源
    最近更新 更多