aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorYang Yujie <yangyujie@loongson.cn>2023-09-13 17:52:14 +0800
committerLulu Cheng <chenglulu@loongson.cn>2023-09-15 10:42:12 +0800
commit227b18f5d7616d6d34ac44836a8679de9b43c857 (patch)
tree75ad60c6607ba1b19c07392d7f5806372c433c2e /config
parent68cb873fd360dbb64f2a6dfb28e79399ff99d07d (diff)
downloadgcc-227b18f5d7616d6d34ac44836a8679de9b43c857.zip
gcc-227b18f5d7616d6d34ac44836a8679de9b43c857.tar.gz
gcc-227b18f5d7616d6d34ac44836a8679de9b43c857.tar.bz2
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.
Diffstat (limited to 'config')
-rw-r--r--config/mt-loongarch-elf1
-rw-r--r--config/mt-loongarch-gnu2
-rw-r--r--config/mt-loongarch-mlib1
3 files changed, 4 insertions, 0 deletions
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