Arduino 铿锵+;AVR编译错误:'=w';在asm中

Arduino 铿锵+;AVR编译错误:'=w';在asm中,arduino,clang,llvm,avr,Arduino,Clang,Llvm,Avr,我在下面得到了这个错误,我找不到解决方案。有人知道怎么做吗 要修复此错误 rafael@ubuntu:~/avr/projeto$ clang -fsyntax-only -Os -I /usr/lib/avr/include -D__AVR_ATmega328P__ -DARDUINO=100 -Wno-ignored-attributes -Wno-attributes serial_tree.c In file included from serial_tree.c:3: In file

我在下面得到了这个错误,我找不到解决方案。有人知道怎么做吗 要修复此错误

rafael@ubuntu:~/avr/projeto$ clang -fsyntax-only -Os -I /usr/lib/avr/include -D__AVR_ATmega328P__ -DARDUINO=100 -Wno-ignored-attributes -Wno-attributes serial_tree.c
In file included from serial_tree.c:3:
In file included from /usr/lib/avr/include/util/delay.h:43:
/usr/lib/avr/include/util/delay_basic.h:108:5: error: invalid output
constraint
      '=w' in asm
                : "=w" (__count)
                  ^
1 error generated.
是来自avr libc的头文件,您正在使用的特性(一些延迟内容)是使用内联asm来实现它。avr libc是为与avr gcc一起使用而编写的,它使用来自avr gcc的特性,比如内联asm。llvm不识别约束“w”,因此您必须使用不同的方法,如使用AVRCC或将该代码移植到llvm


avr gcc还实现内置函数,以实现浪费指定数量的时钟周期。如果llvm正确地模仿了avr gcc,那么您可以使用该函数作为起点。

有些关联。您的命令的哪一部分为avr编译它?clang的主线版本(或者更确切地说,它的后端llvm)不支持像Arduino上使用的那样为avr微控制器编译。您是否尝试过改用
avr gcc
?它的一个构建是Arduino IDE的一部分。他使用的是'-fsyntax only',所以这显然是一些自动完成工具。看起来它与clangs内部汇编程序有关,有帮助吗?