LoongArch: Adjust makefile dependency for loongarch headers.
Checks
Commit Message
gcc/ChangeLog:
* config.gcc: Add loongarch-driver.h to tm_files.
* config/loongarch/loongarch.h: Do not include loongarch-driver.h.
* config/loongarch/t-loongarch: Append loongarch-multilib.h to $(GTM_H)
instead of $(TM_H) for building generator programs.
---
gcc/config.gcc | 2 +-
gcc/config/loongarch/loongarch.h | 3 ---
gcc/config/loongarch/t-loongarch | 3 ++-
3 files changed, 3 insertions(+), 5 deletions(-)
Comments
Unfortunately, I was unable to reproduce the problem mentioned in
https://gcc.gnu.org/pipermail/gcc-patches/2023-October/631933.html
Heres's a possible fix without testing. Please tell me if this works.
On Sat, Oct 07, 2023 at 04:50:14PM +0800, Yang Yujie wrote:
> -TM_H += loongarch-multilib.h $(srcdir)/config/loongarch/loongarch-driver.h
> +
> +GTM_H += loongarch-multilib.h
> OPTIONS_H_EXTRA += $(srcdir)/config/loongarch/loongarch-def.h \
> $(srcdir)/config/loongarch/loongarch-tune.h
(Forgot to modify tm_files for loongarch-elf* targets, so a v2 is probably needed.)
On Sat, 2023-10-07 16:50:14 +0800, Yang Yujie <yangyujie@loongson.cn> wrote:
> gcc/ChangeLog:
>
> * config.gcc: Add loongarch-driver.h to tm_files.
> * config/loongarch/loongarch.h: Do not include loongarch-driver.h.
> * config/loongarch/t-loongarch: Append loongarch-multilib.h to $(GTM_H)
> instead of $(TM_H) for building generator programs.
> ---
> gcc/config.gcc | 2 +-
> gcc/config/loongarch/loongarch.h | 3 ---
> gcc/config/loongarch/t-loongarch | 3 ++-
> 3 files changed, 3 insertions(+), 5 deletions(-)
This patch fixes it for me:
http://toolchain.lug-owl.de/laminar/jobs/gcc-loongarch64-linux-gnuf64
http://toolchain.lug-owl.de/laminar/jobs/gcc-loongarch64-linux-gnuf32
http://toolchain.lug-owl.de/laminar/jobs/gcc-loongarch64-linux-gnusf
http://toolchain.lug-owl.de/laminar/jobs/gcc-loongarch64-linux
MfG, JBG
--
@@ -2524,7 +2524,7 @@ riscv*-*-freebsd*)
loongarch*-*-linux*)
tm_file="elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file}"
- tm_file="${tm_file} loongarch/gnu-user.h loongarch/linux.h"
+ tm_file="${tm_file} loongarch/gnu-user.h loongarch/linux.h loongarch/loongarch-driver.h"
extra_options="${extra_options} linux-android.opt"
tmake_file="${tmake_file} loongarch/t-multilib loongarch/t-linux"
gnu_ld=yes
@@ -49,9 +49,6 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_LIBGCC_SDATA_SECTION ".sdata"
-/* Driver native functions for SPEC processing in the GCC driver. */
-#include "loongarch-driver.h"
-
/* This definition replaces the formerly used 'm' constraint with a
different constraint letter in order to avoid changing semantics of
the 'm' constraint when accepting new address formats in
@@ -16,7 +16,8 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-TM_H += loongarch-multilib.h $(srcdir)/config/loongarch/loongarch-driver.h
+
+GTM_H += loongarch-multilib.h
OPTIONS_H_EXTRA += $(srcdir)/config/loongarch/loongarch-def.h \
$(srcdir)/config/loongarch/loongarch-tune.h