LLVM 13+ doesn't recognize `-stack-alignment` option
Summary
When using -mavx
with recent LLVM backend (LLVM 13 or later), LLVM optimizer fails with
opt-13: Unknown command line argument '-stack-alignment=32'. Try: 'opt-13 --help'
opt-13: Did you mean '--stackrealign=32'?
Steps to reproduce
$ cat > Hello.hs
main = putStrLn "Hello world!"
$ ghc-9.6.2 -pgmlo opt-13 -pgmlc llc-13 -fllvm -mavx Hello.hs
[1 of 2] Compiling Main ( Hello.hs, Hello.o )
opt-13: Unknown command line argument '-stack-alignment=32'. Try: 'opt-13 --help'
opt-13: Did you mean '--stackrealign=32'?
<no location info>: error:
`opt-13' failed in phase `LLVM Optimiser'. (Exit code: 1)
Expected behavior
The program should compile and link without problems.
Environment
- GHC version used: 9.6.2 and master
- Operating System: Linux
- System Architecture: x86_64