<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Cannot combine -m32 with -masm=intel"
   href="https://bugs.llvm.org/show_bug.cgi?id=38535">38535</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Cannot combine -m32 with -masm=intel
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>bugz@madler.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>% cc -m32 -S hello.c && cc -m32 -o hello hello.s && ./hello
Hello world!
%
% cc -masm=intel -S hello.c && cc -masm=intel -o hello hello.s && ./hello
Hello world!
%
% cc -m32 -masm=intel -S hello.c && cc -m32 -masm=intel -o hello hello.s &&
./hello
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not
allowed in code signed PIE, but used in _main from
/var/folders/0s/gn0p34b111nd0lshrhcb82th0000gn/T/hello-650b85.o. To fix this
warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

%

That last ./hello runs since the assemble issued just a warning, but running it
produces only a newline as the output and has an exit code of 0.

No options were provided to cc other than those shown.

The reported version is:

    Apple LLVM version 9.1.0 (clang-902.0.39.2)

hello.c is:

    #include <stdio.h>

    int main(void) {
        puts("Hello world!");
        return 0;
    }

(Of course.)

Trying to combine compiling to 32-bit x86 code with using the Intel assembler
syntax fails, while using either independently works fine. Using both together
should work.

In case you're curious why someone might want to do this, it is to provide my
son an environment in which he can do homework for his x86 class, for which the
book only covers 32-bit code, and only uses the Intel syntax.</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>