Hi Jeffrey, Thank you very much for your timely response. Unfortunately, I don't think your answer is helpful for my issue in any way. I believe the behavior that I described in the previous email is a legit bug in Clang, or rather, in llvm-as.
For future reference, we ended up (reluctantly) converting all Intel syntax assembly files to AT&T style, and fed AT&T style assemblies to Clang. Involving an extra conversion and having ugly AT&T style output was sub-optimal, but it worked, and worked well. Best, Fish -----Original Message----- From: Jeffrey Walton [mailto:noloa...@gmail.com] Sent: Tuesday, September 20, 2016 9:53 PM To: Fish Wang <fish.t...@gmail.com> Cc: CFE-Users (Clang) <cfe-users@lists.llvm.org>; Aravind Machiry <mach...@cs.ucsb.edu> Subject: Re: [cfe-users] clang and intel syntax assembly > - Compile the code using clang with the following command. An assembly > manifest hello.s will be generated > clang -m32 -S -masm=intel hello.c -O1 > > - Assemble the asm file using clang: > clang -m32 -mllvm --x86-asm-syntax=intel hello.s > > It fails with the following error output: > > hello.s:10:2: error: invalid operand for instruction > mov dword ptr [esp], str > ^ > I don't know if its your problem, but be careful of using Intel syntax. You should prefer AT&T syntax. Also see "Inline assembly operands don't work with .intel_syntax", https://llvm.org/bugs/show_bug.cgi?id=24232. We try to support Clang in a cross-platform library. On Windows we had to break the compile and error with "Unsupported configuration" because we have thousands of lines of Intel assembly meant to be consumed by MS tools (or compatible tools). Clang would be fine if it stopped pretending to be other compilers and took the code paths written for it (on Windows Clang defines _MSC_VER and it wanders into MS code paths). Jeff _______________________________________________ cfe-users mailing list cfe-users@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users