<html>
    <head>
      <base href="https://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 fails to compile linux "ALTERNATIVE" (integrated-as)"
   href="https://llvm.org/bugs/show_bug.cgi?id=24487">24487</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang fails to compile linux  "ALTERNATIVE"  (integrated-as)
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dl9pf@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14738" name="attach_14738" title="original .S">attachment 14738</a> <a href="attachment.cgi?id=14738&action=edit" title="original .S">[details]</a></span>
original .S

Clang does not compile the linux "ALTERNATIVE" construct on x86 when
integrated-as (on by default)  is used.

Environment: clang built from git HEAD, Linux 4.2-rc7+

Example error:
clang -Wp,-MD,arch/x86/entry/.entry_64.o.d  -nostdinc -isystem
/home/dl9pf/user/git/LF/llvmlinux/toolchain/clang/head/install/bin/../lib/clang/3.8.0/include
-I./arch/x86/include -Iarch/x86/include/generated/uapi
-Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi
-Iarch/x86/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi
-include ./include/linux/kconfig.h -D__KERNEL__    -D__ASSEMBLY__    -m64
-DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1
-DCONFIG_AS_AVX2=1          -c -o arch/x86/entry/entry_64.o
arch/x86/entry/entry_64.S             
<instantiation>:4:8: error: expected absolute expression
 .skip -(((144f-143f)-(141b-140b)) > 0) * ((144f-143f)-(141b-140b)),0x90
       ^
arch/x86/entry/entry_64.S:599:2: note: while in macro instantiation
 ALTERNATIVE "", ".byte 0x0f,0x01,0xca", ( 9*32+20)
 ^
<instantiation>:4:8: error: expected absolute expression
 .skip -(((144f-143f)-(141b-140b)) > 0) * ((144f-143f)-(141b-140b)),0x90
       ^
<instantiation>:2:2: note: while in macro instantiation
 ALTERNATIVE "", ".byte 0x0f,0x01,0xca", ( 9*32+20)
 ^
arch/x86/entry/entry_64.S:774:1: note: while in macro instantiation
apicinterrupt3 0x20 irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt
^
<instantiation>:4:8: error: expected absolute expression
 .skip -(((144f-143f)-(141b-140b)) > 0) * ((144f-143f)-(141b-140b)),0x90
       ^
<instantiation>:2:2: note: while in macro instantiation
 ALTERNATIVE "", ".byte 0x0f,0x01,0xca", ( 9*32+20)


The entry_64.S and preprocessed .i is attached. 

This blocks the meta-<a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED --- - [Meta] Compiling the Linux kernel with clang"
   href="show_bug.cgi?id=4068">bug 4068</a>.</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>