aboutsummaryrefslogtreecommitdiff
path: root/gcc/common/common-targhooks.h
diff options
context:
space:
mode:
authorKito Cheng <kito.cheng@sifive.com>2020-11-20 15:52:53 +0800
committerKito Cheng <kito.cheng@sifive.com>2022-09-02 17:23:50 +0800
commit5ca9980fc86242505ffdaaf62bca1fd5db26550b (patch)
tree521cee052ab40f5e473ae4731286addd34f6c678 /gcc/common/common-targhooks.h
parent347dec125b662bdeb6d426ead3449e1209c2ce28 (diff)
downloadgcc-5ca9980fc86242505ffdaaf62bca1fd5db26550b.zip
gcc-5ca9980fc86242505ffdaaf62bca1fd5db26550b.tar.gz
gcc-5ca9980fc86242505ffdaaf62bca1fd5db26550b.tar.bz2
Add TARGET_COMPUTE_MULTILIB hook to override multi-lib result.
Create a new hook to let target could override the multi-lib result, the motivation is RISC-V might have very complicated multi-lib re-use rule*, which is hard to maintain and use current multi-lib scripts, we even hit the "argument list too long" error when we tried to add more multi-lib reuse rule. So I think it would be great to have a target specific way to determine the multi-lib re-use rule, then we could write those rule in C, instead of expand every possible case in MULTILIB_REUSE. * Here is an example for RISC-V multi-lib rules: https://gist.github.com/kito-cheng/0289cd42d9a756382e5afeb77b42b73b gcc/ChangeLog: * common/common-target.def (compute_multilib): New. * common/common-targhooks.h (default_compute_multilib): New. * common/common-targhooks.cc (default_compute_multilib): New. * doc/tm.texi.in (TARGET_COMPUTE_MULTILIB): New. * doc/tm.texi: Regen. * gcc.cc: Include common/common-target.h. (set_multilib_dir) Call targetm_common.compute_multilib. (SWITCH_LIVE): Move to opts.h. (SWITCH_FALSE): Ditto. (SWITCH_IGNORE): Ditto. (SWITCH_IGNORE_PERMANENTLY): Ditto. (SWITCH_KEEP_FOR_GCC): Ditto. (struct switchstr): Ditto. * opts.h (SWITCH_LIVE): Move from gcc.c. (SWITCH_FALSE): Ditto. (SWITCH_IGNORE): Ditto. (SWITCH_IGNORE_PERMANENTLY): Ditto. (SWITCH_KEEP_FOR_GCC): Ditto. (struct switchstr): Ditto.
Diffstat (limited to 'gcc/common/common-targhooks.h')
-rw-r--r--gcc/common/common-targhooks.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/common/common-targhooks.h b/gcc/common/common-targhooks.h
index cd49c7d..1f03495 100644
--- a/gcc/common/common-targhooks.h
+++ b/gcc/common/common-targhooks.h
@@ -32,4 +32,15 @@ extern vec<const char *> default_get_valid_option_values (int, const char *);
extern const struct default_options empty_optimization_table[];
+const char *
+default_compute_multilib(
+ const struct switchstr *,
+ int,
+ const char *multilib,
+ const char *,
+ const char *,
+ const char *,
+ const char *,
+ const char *);
+
#endif