macos – 禁用汇编程序警告“.section __TEXT,__ textcoal_nt,coalesced,pure_instructions”

macos – 禁用汇编程序警告“.section __TEXT,__ textcoal_nt,coalesced,pure_instructions”,第1张

概述在OS X上使用MacPorts GCC并通过-Wa,-q登记Clang Integrated Assembler时,汇编程序会为每个文件生成一个警告流.警告的示例如下所示(其中很多,Stack Overflow编辑器不允许我粘贴整个流). 我找到了LLVM Commit r250349, Stop generating coal sections.这是负责的代码,但我不清楚如何禁用警告. + 在OS X上使用MacPorts GCC并通过-Wa,-q登记Clang Integrated Assembler时,汇编程序会为每个文件生成一个警告流.警告的示例如下所示(其中很多,Stack Overflow编辑器不允许我粘贴整个流).

我找到了LLVM Commit r250349,Stop generating coal sections.这是负责的代码,但我不清楚如何禁用警告.

+  // Issue a warning if the target is not powerpc and Section is a *coal* section.+  Triple TT = getParser().getContext().getobjectfileInfo()->getTargetTriple();+  Triple::ArchType ArchTy = TT.getArch();++  if (ArchTy != Triple::ppc && ArchTy != Triple::ppc64) {+    StringRef NonCoalSection = StringSwitch<StringRef>(Section)+                                   .Case("__textcoal_nt","__text")+                                   .Case("__const_coal","__const")+                                   .Case("__datacoal_nt","__data")+                                   .Default(Section);++    if (!Section.equals(NonCoalSection)) {+      StringRef SectionVal(Loc.getPointer());+      size_t B = SectionVal.find(',') + 1,E = SectionVal.find(',',B);+      SMLoc BLoc = SMLoc::getFromPointer(SectionVal.data() + B);+      SMLoc ELoc = SMLoc::getFromPointer(SectionVal.data() + E);+      getParser().Warning(Loc,"section \"" + Section + "\" is deprecated",+                          SMRange(BLoc,ELoc));+      getParser().Note(Loc,"change section name to \"" + NonCoalSection ++                       "\"",SMRange(BLoc,ELoc));+    }+  }+

我无法@R_419_6949@2> / dev / null因为此时配置有点脆弱,它会丢弃其他警告和错误.

如何在煤炭部分禁用Clang汇编程序警告?

当GCC编译器遇到-Wa,-q时,它使用/ opt / local / bin / clang作为汇编程序而不是/ opt / local / bin / as.以下是相关版本.

$/opt/local/bin/g++-mp-6 --versiong++-mp-6 (MacPorts gcc6 6.1.0_0) 6.1.0copyright (C) 2016 Free Software Foundation,Inc.$/opt/local/bin/clang --versionclang version 3.8.0 (branches/release_38 262722)Target: x86_64-apple-darwin12.6.0$/opt/local/bin/as -versionApple Inc version cctools-877.8,GNU assembler version 1.38

向WBXFLAGS添加-Wno弃用不会抑制警告.我也尝试过-fno-tree-coalesce-vars没有快乐(这可能会影响性能).

以下sed在OS X上使用sed或gsed不匹配:

$CXXFLAGS="-DNDEBUG -g2 -O2" make CXX=/opt/local/bin/g++-mp-6 2>&1 | \  gsed -e '/(__TEXT|__DATA)/,+2d'/opt/local/bin/g++-mp-6 -DNDEBUG -g2 -O2 -fPIC -march=native -Wa,-q -pipe -c rijndael.cpp<stdin>:3:11: warning: section "__textcoal_nt" is deprecated        .section __TEXT,__textcoal_nt,coalesced,pure_instructions                 ^      ~~~~~~~~~~~~~<stdin>:3:11: note: change section name to "__text"        .section __TEXT,pure_instructions                 ^      ~~~~~~~~~~~~~...
/opt/local/bin/g++-mp-6 -DNDEBUG -g2 -O2 -fPIC -march=native -Wa,-q -DMACPORTS_GCC_COMPILER=1 -c cryptlib.cpp<stdin>:3:11: warning: section "__textcoal_nt" is deprecated        .section __TEXT,pure_instructions                 ^      ~~~~~~~~~~~~~<stdin>:2665:11: warning: section "__textcoal_nt" is deprecated        .section __TEXT,pure_instructions                 ^      ~~~~~~~~~~~~~<stdin>:2665:11: note: change section name to "__text"        .section __TEXT,pure_instructions                 ^      ~~~~~~~~~~~~~<stdin>:3925:11: warning: section "__textcoal_nt" is deprecated        .section __TEXT,pure_instructions                 ^      ~~~~~~~~~~~~~<stdin>:3925:11: note: change section name to "__text"        .section __TEXT,pure_instructions                 ^      ~~~~~~~~~~~~~<stdin>:3963:11: warning: section "__textcoal_nt" is deprecated        .section __TEXT,pure_instructions                 ^      ~~~~~~~~~~~~~<stdin>:3963:11: note: change section name to "__text"        .section __TEXT,pure_instructions                 ^      ~~~~~~~~~~~~~[Hundred of these ommitted for each source file]

以下是相关的GCC和LLVM错误报告:

> GCC Issue 71767 – Endless stream of warnings when using GCC with -Wa,-q and Clang Integrated Assembler
> LLVM Issue 28427 – Endless stream of warnings when using GCC with -Wa,-q and Clang Integrated Assembler

解决方法 目前,您无法禁用这些警告.您应该提交针对FSF GCC的错误报告,让他们更新他们的codegen以更加合规.

您可能还希望向llvm.org提交错误报告,请求有一种方法可以使这些警告静音或限制发出的数量,以免影响用户.

总结

以上是内存溢出为你收集整理的macos – 禁用汇编程序警告“.section __TEXT,__ textcoal_nt,coalesced,pure_instructions”全部内容,希望文章能够帮你解决macos – 禁用汇编程序警告“.section __TEXT,__ textcoal_nt,coalesced,pure_instructions”所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1139188.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存