From 227b18f5d7616d6d34ac44836a8679de9b43c857 Mon Sep 17 00:00:00 2001 From: Yang Yujie Date: Wed, 13 Sep 2023 17:52:14 +0800 Subject: LoongArch: Reimplement multilib build option handling. Library build options from --with-multilib-list used to be processed with *self_spec, which missed the driver's initial canonicalization. This caused limitations on CFLAGS override and the use of driver-only options like -m[no]-lsx. The problem is solved by promoting the injection rules of --with-multilib-list options to the first element of DRIVER_SELF_SPECS, to make them execute before the canonialization. The library-build options are also hard-coded in the driver and can be used conveniently by the builders of other non-gcc libraries via the use of -fmultiflags. Bootstrapped and tested on loongarch64-linux-gnu. ChangeLog: * config-ml.in: Remove unneeded loongarch clause. * configure.ac: Register custom makefile fragments mt-loongarch-* for loongarch targets. * configure: Regenerate. config/ChangeLog: * mt-loongarch-mlib: New file. Pass -fmultiflags when building target libraries (FLAGS_FOR_TARGET). * mt-loongarch-elf: New file. * mt-loongarch-gnu: New file. gcc/ChangeLog: * config.gcc: Pass the default ABI via TM_MULTILIB_CONFIG. * config/loongarch/loongarch-driver.h: Invoke MLIB_SELF_SPECS before the driver canonicalization routines. * config/loongarch/loongarch.h: Move definitions of CC1_SPEC etc. to loongarch-driver.h * config/loongarch/t-linux: Move multilib-related definitions to t-multilib. * config/loongarch/t-multilib: New file. Inject library build options obtained from --with-multilib-list. * config/loongarch/t-loongarch: Same. --- config/mt-loongarch-elf | 1 + config/mt-loongarch-gnu | 2 ++ config/mt-loongarch-mlib | 1 + 3 files changed, 4 insertions(+) create mode 100644 config/mt-loongarch-elf create mode 100644 config/mt-loongarch-gnu create mode 100644 config/mt-loongarch-mlib (limited to 'config') diff --git a/config/mt-loongarch-elf b/config/mt-loongarch-elf new file mode 100644 index 0000000..bbf29bb --- /dev/null +++ b/config/mt-loongarch-elf @@ -0,0 +1 @@ +include $(srcdir)/config/mt-loongarch-mlib diff --git a/config/mt-loongarch-gnu b/config/mt-loongarch-gnu new file mode 100644 index 0000000..dfefb44 --- /dev/null +++ b/config/mt-loongarch-gnu @@ -0,0 +1,2 @@ +include $(srcdir)/config/mt-gnu +include $(srcdir)/config/mt-loongarch-mlib diff --git a/config/mt-loongarch-mlib b/config/mt-loongarch-mlib new file mode 100644 index 0000000..4cfe568 --- /dev/null +++ b/config/mt-loongarch-mlib @@ -0,0 +1 @@ +FLAGS_FOR_TARGET += -fmultiflags -- cgit v1.1