[flang]How to cross compile with Flang-new
cat hello.f90
program hello
! This is a comment line; it is ignored by the compiler
print *, 'Hello, World!'
end program hello
I try to cross compile hello-world with Flang-new:
flang-new --target=riscv64-unknown-linux-gnu -march=rv64gc --sysroot=/riscv/sysroot --gcc-toolchain=/riscv/ -O3 hello.f90
error: flang-new: error: unknown argument: '--gcc-toolchain=riscv'
as we know cross compile hello-world with clang: eg: clang --target=riscv64-unknown-linux-gnu -march=rv64gc --sysroot=/riscv/sysroot --gcc-toolchain=/riscv/ -O3 hello.c -o a.out
how to config --gcc-toolchain for Flang-new
lllvm commit id:
commit 5a45d32b5b42dc4ed4852b0045391a1c2be41b48 (HEAD -> main, origin/main, origin/HEAD)
Author: Greg Clayton <[email protected]>
Date: Tue Feb 20 18:17:01 2024 -0800
@llvm/issue-subscribers-flang-driver
Author: Liao Chunyu (ChunyuLiao)
error: flang-new: error: unknown argument: '--gcc-toolchain=riscv'
as we know cross compile hello-world with clang: eg: clang --target=riscv64-unknown-linux-gnu -march=rv64gc --sysroot=/home/chunyu/flang/riscv/sysroot --gcc-toolchain=/home/chunyu/flang/riscv/ -O3 hello.c -o a.out
how to config --gcc-toolchain for Flang-new
lllvm commit id:
commit 5a45d32b5b42dc4ed4852b0045391a1c2be41b48 (HEAD -> main, origin/main, origin/HEAD)
Author: Greg Clayton <gclayton@<!-- -->fb.com>
Date: Tue Feb 20 18:17:01 2024 -0800
Thanks for reporting this!
Many options supported by Clang are not yet available in Flang. That’s what this error means:
error: flang-new: error: unknown argument: '--gcc-toolchain=riscv'
It should be quite straightforward to enable this, but sometimes the finer details are tricky.
Thanks for reporting this!
Many options supported by Clang are not yet available in Flang. That’s what this error means:
error: flang-new: error: unknown argument: '--gcc-toolchain=riscv'
It should be quite straightforward to enable this, but sometimes the finer details are tricky.
thanks, I will try to use a native compile.
--gcc-toolchain (& --gcc-install-dir) now supported with https://github.com/llvm/llvm-project/pull/87360