代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gcc 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From da22606529688b125e6e08589a6dfe741b8dd18d Mon Sep 17 00:00:00 2001
From: Yang Yujie <[email protected]>
Date: Mon, 28 Aug 2023 10:20:12 +0800
Subject: [PATCH 060/124] LoongArch: add new configure option
--with-strict-align-lib
LoongArch processors may not support memory accesses without natural
alignments. Building libraries with -mstrict-align may help with
toolchain binary compatiblity and performance on these implementations
(e.g. Loongson 2K1000LA).
No significant performance degredation is observed on current mainstream
LoongArch processors when the option is enabled.
gcc/ChangeLog:
* config.gcc: use -mstrict-align for building libraries
if --with-strict-align-lib is given.
* doc/install.texi: likewise.
Signed-off-by: Peng Fan <[email protected]>
Signed-off-by: ticat_fp <[email protected]>
---
gcc/config.gcc | 16 +++++++++++++++-
gcc/doc/install.texi | 4 ++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 62525c296..16bbaea45 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4966,7 +4966,7 @@ case "${target}" in
;;
loongarch*-*)
- supported_defaults="abi arch tune fpu simd multilib-default"
+ supported_defaults="abi arch tune fpu simd multilib-default strict-align-lib"
# Local variables
unset \
@@ -5163,6 +5163,17 @@ case "${target}" in
;;
esac
+ # Build libraries with -mstrict-align if --with-strict-align-lib is given.
+ case ${with_strict_align_lib} in
+ yes) strict_align_opt="/mstrict-align" ;;
+ ""|no) ;;
+ *)
+ echo "Unknown option: --with-strict-align-lib=${with_strict_align_lib}" 1>&2
+ exit 1
+ ;;
+ esac
+
+
# Handle --with-multilib-default
if echo "${with_multilib_default}" \
| grep -E -e '[[:space:]]' -e '//' -e '/$' -e '^/' > /dev/null 2>&1; then
@@ -5324,6 +5335,9 @@ case "${target}" in
;;
esac
+ # Use mstrict-align for building libraries if --with-strict-align-lib is given.
+ loongarch_multilib_list_make="${loongarch_multilib_list_make}${strict_align_opt}"
+
# Check for repeated configuration of the same multilib variant.
if echo "${elem_abi_base}/${elem_abi_ext}" \
| grep -E "^(${all_abis%|})$" >/dev/null 2>&1; then
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 1fc5f0bfa..a8851e8bd 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1353,6 +1353,10 @@ Multiple @var{option}s may appear consecutively while @var{arch} may only
appear in the beginning or be omitted (which means @option{-march=abi-default}
is applied when building the libraries).
+@item --with-strict-align-lib
+On LoongArch targets, build all enabled multilibs with @option{-mstrict-align}
+(Not enabled by default).
+
@item --with-multilib-generator=@var{config}
Specify what multilibs to build. @var{config} is a semicolon separated list of
values, possibly consisting of a single value. Currently only implemented
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。