[RISCV] Pass -target-abi to -cc1as
authorRoger Ferrer Ibanez <rofirrim@gmail.com>
Tue, 26 Mar 2019 08:01:18 +0000 (08:01 +0000)
committerRoger Ferrer Ibanez <rofirrim@gmail.com>
Tue, 26 Mar 2019 08:01:18 +0000 (08:01 +0000)
commite41a74e8d288be21855e7adc32a2f69a98eb2877
treed02f27981b3dc7784962aac5b23d81d2980cb208
parent78e21bac9925af3a5b839d7f635d8f27dad87fda
[RISCV] Pass -target-abi to -cc1as

The RISC-V assembler needs the target ABI because it defines a flag of the ELF
file, as described in [1].

Make clang (the driver) to pass the target ABI to -cc1as in exactly the same
way it does for -cc1.

Currently -cc1as knows about -target-abi but is not handling it. Handle it and
pass it to the MC layer via MCTargetOptions.

[1] https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#file-header

Differential Revision: https://reviews.llvm.org/D59298

llvm-svn: 356981
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/Clang.h
clang/test/Driver/riscv-abi.c
clang/tools/driver/cc1as_main.cpp