<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - clang blindly include's altivec.h given -maltivec -- even on assembly code!"
   href="http://llvm.org/bugs/show_bug.cgi?id=16454">16454</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang blindly include's altivec.h given -maltivec -- even on assembly code!
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Driver
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>chandlerc@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>% touch x.S
% ./bin/clang -target powerpc64-unknown-linux-gnu -maltivec -S -o - x.S
# 1 "x.S"
# 1 "<built-in>" 1
# 158 "<built-in>"
# 1
"/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include/altivec.h"
1 3
# 39
"/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include/altivec.h"
3
static vector signed char __attribute__((__overloadable__, __always_inline__))
vec_perm(vector signed char __a, vector signed char __b, vector unsigned char
__c);
...

wat....

This is running the preprocessor on the assembly file, why does it have C
builtin functions in it??? Well:

% ./bin/clang -v -target powerpc64-unknown-linux-gnu -maltivec -S -o - x.S
clang version 3.4 
Target: powerpc64-unknown-linux-gnu
Thread model: posix
 "/home/chandlerc/src/llvm.git/ninja-build/bin/clang-3.1" -cc1 -triple
powerpc64-unknown-linux-gnu -E -disable-free -main-file-name x.S
-mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases
-target-cpu ppc64 -target-feature +altivec -v -coverage-file
/home/chandlerc/src/llvm.git/ninja-build/- -resource-dir
/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4 -internal-isystem
/usr/local/include -internal-isystem
/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fno-dwarf-directory-asm -fdebug-compilation-dir
/home/chandlerc/src/llvm.git/ninja-build -ferror-limit 19 -fmessage-length 283
-faltivec -mstackrealign -fno-signed-char -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -o - -x assembler-with-cpp x.S
clang -cc1 version 3.4 based upon LLVM 3.4svn default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include
 /usr/include
End of search list.
# 1 "x.S"
# 1 "<built-in>" 1
# 158 "<built-in>"
# 1
"/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include/altivec.h"
1 3
# 39
"/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include/altivec.h"
3
static vector signed char __attribute__((__overloadable__, __always_inline__))
vec_perm(vector signed char __a, vector signed char __b, vector unsigned char
__c);
....


Note the '-faltivec' we pass to Clang's -cc1.... this seems deeply suspicious.
Either we shouldn't pass that at all, shouldn't pass it when just running the
preprocessor, or shouldn't do the automatic include of altivec.h when we see
that and are in assembler-with-cpp mode. =/</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>