[llvm-bugs] [Bug 38535] New: Cannot combine -m32 with -masm=intel

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Aug 12 10:13:35 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38535

            Bug ID: 38535
           Summary: Cannot combine -m32 with -masm=intel
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bugz at madler.net
                CC: llvm-bugs at lists.llvm.org

% 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180812/3a701284/attachment.html>


More information about the llvm-bugs mailing list