[cfe-dev] Aarch64 ASM quirk

Joel Winarske via cfe-dev cfe-dev at lists.llvm.org
Thu Nov 7 15:53:43 PST 2019


I'm running Clang 9.0.0 on Windows, with target aarch64-unknown-windows.  I
get the same error building on Linux.  Code below.

The difference is a CR/LF.  The original builds fine with GCC.

By design, or bug?


Joel


### Code ###

.global MyFunc ; .section ".text.My Func" ; .type My Func, %function ;
MyFunc:

 # do something really important
  ret

.global MyFunSize

MyFunSize
  .long . - MyFunc


### Error ###

error: symbol 'My Func' can not be undefined in a subtraction expression
  .long . - MyFunc
            ^

### Resolution ###

global MyFunc; .section ".text.MyFunc" .type MyFunc, %function;
My Func:

  # do something really important
  ret

.global MyFuncSize

MyFuncSize
  .long . - MyFunc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191107/abeb0138/attachment.html>


More information about the cfe-dev mailing list