From: Sebastian Huber Date: Tue, 9 Mar 2021 18:32:26 +0000 (+0100) Subject: RTEMS: Fix -Werror builds X-Git-Tag: basepoints/gcc-12~669 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0455cd76b687621f28488393c81d0854200a220a;p=thirdparty%2Fgcc.git RTEMS: Fix -Werror builds Fix build errors due to warnings such as: gcc/config/v850/rtems.h:43: error: "RTEMS_STARTFILE_SPEC" redefined [-Werror] 43 | #define RTEMS_STARTFILE_SPEC "" The problem was that "gcc/config/rtems.h" was included before the architecture-specific "gcc/config/*/rtems.h" header file on some architectures. gcc/ * config.gcc (aarch64-*-rtems*): Include general rtems.h after the architecture-specific rtems.h. (aarch64-*-rtems*): Likewise. (arm*-*-rtems*): Likewise. (epiphany-*-rtems*): Likewise. (riscv*-*-rtems*): Likewise. --- diff --git a/gcc/config.gcc b/gcc/config.gcc index 966cbc888cb2..3ec7582f5dd1 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1094,7 +1094,7 @@ aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*) tm_file="${tm_file} fuchsia.h" ;; aarch64-*-rtems*) - tm_file="${tm_file} rtems.h aarch64/rtems.h" + tm_file="${tm_file} aarch64/rtems.h rtems.h" ;; esac case $target in @@ -1368,7 +1368,7 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems* | arm*-*-fuchsia*) target_cpu_cname="generic-armv7-a" ;; arm*-*-rtems*) - tm_file="${tm_file} rtems.h arm/rtems.h newlib-stdint.h" + tm_file="${tm_file} arm/rtems.h rtems.h newlib-stdint.h" tmake_file="${tmake_file} arm/t-bpabi arm/t-rtems" ;; arm*-*-symbianelf*) @@ -1630,7 +1630,7 @@ epiphany-*-elf | epiphany-*-rtems*) tmake_file="${tmake_file} epiphany/t-epiphany" case ${target} in epiphany-*-rtems*) - tm_file="${tm_file} rtems.h epiphany/rtems.h newlib-stdint.h" + tm_file="${tm_file} epiphany/rtems.h rtems.h newlib-stdint.h" ;; *) tm_file="${tm_file} newlib-stdint.h" @@ -2476,7 +2476,7 @@ riscv*-*-elf* | riscv*-*-rtems*) tm_file="elfos.h newlib-stdint.h ${tm_file} riscv/elf.h" case ${target} in *-*-rtems*) - tm_file="${tm_file} rtems.h riscv/rtems.h" + tm_file="${tm_file} riscv/rtems.h rtems.h" tmake_file="${tmake_file} riscv/t-rtems" ;; *) @@ -3476,7 +3476,7 @@ tilepro*-*-linux*) v850-*-rtems*) target_cpu_default="TARGET_CPU_generic" tm_file="dbxelf.h elfos.h v850/v850.h" - tm_file="${tm_file} rtems.h v850/rtems.h newlib-stdint.h" + tm_file="${tm_file} v850/rtems.h rtems.h newlib-stdint.h" tmake_file="${tmake_file} v850/t-v850" tmake_file="${tmake_file} v850/t-rtems" use_collect2=no