llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.71k stars 10.94k forks source link

Endless stream of warnings when using GCC with -Wa,-q and Clang Integrated Assembler #28801

Open 70311826-e6d8-4d29-8604-c4ec4bfa7f0d opened 7 years ago

70311826-e6d8-4d29-8604-c4ec4bfa7f0d commented 7 years ago
Bugzilla Link 28427
Version 3.8
OS All
CC @jeremyhu,@noloader

Extended Description

When using MacPorts GCC on OS X and enlisting the Clang Integrated Assembler via -Wa,-q, the assembler produces a stream of warnings for each file. A simple test case is shown below (but a real project produces thousands of them).

I found LLVM Commit r250349, Stop generating coal sections. Here's the code responsible, but its not clear to me how to disable the warning.


The test case depends upon -g2 and -O2. if I omit them, then the warnings are not present.

$ cat test.cxx

include

include

int main(int argc, char argv[]) { std::for_each(argv, argv+argc, [](char str) {std::cout << str << std::endl;});

return 0; }

$ /opt/local/bin/g++-mp-6 -march=native -g2 -O2 -std=c++11 -Wa,-q test.cxx -o test.exe /var/folders/mk/y7lk0xrx72lcn_2q3d12jcch0000gn/T//cc1dR6yG.s:3:11: warning: section "textcoal_nt" is deprecated .section TEXT,textcoal_nt,coalesced,pure_instructions ^ ~~~~~ /var/folders/mk/y7lk0xrx72lcn_2q3d12jcch0000gn/T//cc1dR6yG.s:3:11: note: change section name to "text" .section TEXT,textcoal_nt,coalesced,pure_instructions ^ ~~~~~


When the MacPorts GCC compiler encounters -Wa,-q, it uses /opt/local/bin/clang as the assembler rather than /opt/local/bin/as. Here are the relevant versions.

$ /opt/local/bin/g++-mp-6 --version g++-mp-6 (MacPorts gcc6 6.1.0_0) 6.1.0 Copyright (C) 2016 Free Software Foundation, Inc.

$ /opt/local/bin/clang --version clang version 3.8.0 (branches/release_38 262722) Target: x86_64-apple-darwin12.6.0

$ /opt/local/bin/as -version Apple Inc version cctools-877.8, GNU assembler version 1.38

70311826-e6d8-4d29-8604-c4ec4bfa7f0d commented 7 years ago

Also see GCC Issue 71767, "Endless stream of warnings when using GCC with -Wa,-q and Clang Integrated Assembler", https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71767.

70311826-e6d8-4d29-8604-c4ec4bfa7f0d commented 7 years ago

assigned to @ahatanak