diff options
author | Xi Ruoyao <xry111@xry111.site> | 2023-10-23 15:23:11 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2023-10-23 15:30:19 +0800 |
commit | 93a46d18f52ec7bab27b38c2bb41a412856e8ceb (patch) | |
tree | d958d5c95428bdfe43a881e9c2337031b12d0e0c /libcpp | |
parent | 4cd4c34acda411e4b3bd03a43d68921f38ce9822 (diff) | |
download | gcc-93a46d18f52ec7bab27b38c2bb41a412856e8ceb.zip gcc-93a46d18f52ec7bab27b38c2bb41a412856e8ceb.tar.gz gcc-93a46d18f52ec7bab27b38c2bb41a412856e8ceb.tar.bz2 |
LoongArch: Add enum-style -mexplicit-relocs= option
To take a better balance between scheduling and relaxation when -flto is
enabled, add three-way -mexplicit-relocs={auto,none,always} options.
The old -mexplicit-relocs and -mno-explicit-relocs options are still
supported, they are mapped to -mexplicit-relocs=always and
-mexplicit-relocs=none.
The default choice is determined by probing assembler capabilities at
build time. If the assembler does not supports explicit relocs at all,
the default will be none; if it supports explicit relocs but not
relaxation, the default will be always; if both explicit relocs and
relaxation are supported, the default will be auto.
Currently auto is same as none. We will make auto more clever in
following changes.
gcc/ChangeLog:
* config/loongarch/genopts/loongarch-strings: Add strings for
-mexplicit-relocs={auto,none,always}.
* config/loongarch/genopts/loongarch.opt.in: Add options for
-mexplicit-relocs={auto,none,always}.
* config/loongarch/loongarch-str.h: Regenerate.
* config/loongarch/loongarch.opt: Regenerate.
* config/loongarch/loongarch-def.h
(EXPLICIT_RELOCS_AUTO): Define.
(EXPLICIT_RELOCS_NONE): Define.
(EXPLICIT_RELOCS_ALWAYS): Define.
(N_EXPLICIT_RELOCS_TYPES): Define.
* config/loongarch/loongarch.cc
(loongarch_option_override_internal): Error out if the old-style
-m[no-]explicit-relocs option is used with
-mexplicit-relocs={auto,none,always} together. Map
-mno-explicit-relocs to -mexplicit-relocs=none and
-mexplicit-relocs to -mexplicit-relocs=always for backward
compatibility. Set a proper default for -mexplicit-relocs=
based on configure-time probed linker capability. Update a
diagnostic message to mention -mexplicit-relocs=always instead
of the old-style -mexplicit-relocs.
(loongarch_handle_model_attribute): Update a diagnostic message
to mention -mexplicit-relocs=always instead of the old-style
-mexplicit-relocs.
* config/loongarch/loongarch.h (TARGET_EXPLICIT_RELOCS): Define.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions