llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.77k stars 10.97k forks source link

clang doesn't support -Wa,--defsym #95386

Closed stsp closed 3 weeks ago

stsp commented 3 weeks ago
$ clang -x assembler -c - -m32 -Wa,--defsym -Wa,_DJ64=1
clang: error: unsupported argument '--defsym' to option '-Wa,'
clang: error: unsupported argument '_DJ64=1' to option '-Wa,'

With gcc+gas this works as expected.

MaskRay commented 3 weeks ago

https://reviews.llvm.org/D26213 -Wa,-defsym is supported. I am testing a patch to add -Wa,--defsym. Note: when the integrated assembler is enabled, clangDriver implements a small set of popular -Wa, options. I think --defsym is kinda popular. I personally use --defsym a lot in assembly tests, especially in lld/test/ELF, though mostly using an internal-facing tool llvm-mc.

stsp commented 3 weeks ago

Thanks for the patch and a work-around! -defsym works for me as well.

llvmbot commented 3 weeks ago

@llvm/issue-subscribers-clang-driver

Author: Stas Sergeev (stsp)

``` $ clang -x assembler -c - -m32 -Wa,--defsym -Wa,_DJ64=1 clang: error: unsupported argument '--defsym' to option '-Wa,' clang: error: unsupported argument '_DJ64=1' to option '-Wa,' ``` With gcc+gas this works as expected.