Please show your /etc/makepkg.conf
Which package are you trying to build in particular?
i tried theos-ios-toolchain, dmg2img and another i forgot, every single one of them gamve this same error
found the issue, i installed the mingw toolchain to compile for windows and it had overwritten the as binary, fixed by prioritizing the one in /usr/bin