RISC-V: Support -mlittle-endian and -mbig-endian
authorMarcus Comstedt <marcus@mc.pp.se>
Fri, 19 Mar 2021 19:49:03 +0000 (20:49 +0100)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 23 Mar 2021 09:31:13 +0000 (17:31 +0800)
commita9604fcbb29e457a4824a496905057dcc2e5d78a
tree3c3c79817ba7034c2af5aaff7bb4ba47a356a10e
parent3e07e7a6a7f34f0ec2f1a3e50ebc52b77de11a30
RISC-V: Support -mlittle-endian and -mbig-endian

gcc/
* config/riscv/elf.h (LINK_SPEC): Pass linker endianness flag.
* config/riscv/freebsd.h (LINK_SPEC): Likewise.
* config/riscv/linux.h (LINK_SPEC): Likewise.
* config/riscv/riscv.h (ASM_SPEC): Pass -mbig-endian and
-mlittle-endian.
(BYTES_BIG_ENDIAN): Handle big endian.
(WORDS_BIG_ENDIAN): Define to BYTES_BIG_ENDIAN.
* config/riscv/riscv.opt (-mbig-endian, -mlittle-endian): New
options.
* doc/invoke.texi (-mbig-endian, -mlittle-endian): Document.
gcc/config/riscv/elf.h
gcc/config/riscv/freebsd.h
gcc/config/riscv/linux.h
gcc/config/riscv/riscv.h
gcc/config/riscv/riscv.opt
gcc/doc/invoke.texi