!441 LoongArch: Fix osdir name

From: @ticat-fp 
Reviewed-by: @xiongzhou4 
Signed-off-by: @xiongzhou4
This commit is contained in:
openeuler-ci-bot 2024-06-14 02:24:10 +00:00 committed by Gitee
commit 55934ee064
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 84 additions and 4 deletions

View File

@ -0,0 +1,78 @@
From 297ebfe072777f82bb6a9b7699dde926e589b357 Mon Sep 17 00:00:00 2001
From: Peng Fan <fanpeng@loongson.cn>
Date: Thu, 13 Jun 2024 01:31:55 +0000
Subject: [PATCH] LoongArch: Fix osdirname
Signed-off-by: Peng Fan <fanpeng@loongson.cn>
---
gcc/config/loongarch/t-linux | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/gcc/config/loongarch/t-linux b/gcc/config/loongarch/t-linux
index 62a870b66..4d8eb6962 100644
--- a/gcc/config/loongarch/t-linux
+++ b/gcc/config/loongarch/t-linux
@@ -18,42 +18,38 @@
# Multilib
MULTILIB_OPTIONS = mabi=lp64d/mabi=lp64f/mabi=lp64s
-MULTILIB_DIRNAMES = base/lp64d base/lp64f base/lp64s
+MULTILIB_DIRNAMES = . base/lp64f base/lp64s
# The GCC driver always gets all abi-related options on the command line.
# (see loongarch-driver.c:driver_get_normalized_m_opts)
comma=,
MULTILIB_REQUIRED = $(foreach mlib,$(subst $(comma), ,$(TM_MULTILIB_CONFIG)),\
- $(firstword $(subst /, ,$(mlib))))
+ $(firstword $(subst /, ,$(mlib))))
SPECS = specs.install
# temporary self_spec when building libraries (e.g. libgcc)
gen_mlib_spec = $(if $(word 2,$1),\
- %{$(firstword $1):$(patsubst %,-%,$(wordlist 2,$(words $1),$1))})
+ %{$(firstword $1):$(patsubst %,-%,$(wordlist 2,$(words $1),$1))})
# clean up the result of DRIVER_SELF_SPEC to avoid conflict
lib_build_self_spec = %<march=* %<mtune=* %<mcmodel=* %<mfpu=* %<msimd=*
+# build libraries with -mstrict-align by default
+lib_build_self_spec += -mstrict-align
+
# append user-specified build options from --with-multilib-list
-lib_build_self_spec += $(foreach mlib,\
- $(subst $(comma), ,$(TM_MULTILIB_CONFIG)),\
- $(call gen_mlib_spec,$(subst /, ,$(mlib))))
+lib_build_self_spec += $(foreach mlib,$(subst $(comma), ,$(TM_MULTILIB_CONFIG)),\
+ $(call gen_mlib_spec,$(subst /, ,$(mlib))))
specs: specs.install
- sed '/^*self_spec:$$/{ n;s/^$$/$(lib_build_self_spec)/g; }' $< > $@
-
-# Do some preparation before regression tests:
-# remove lib-build-specs / make symlinks for the toplevel multilib variant
+ sed '/^*self_spec:$$/{ n;s/^$$/$(lib_build_self_spec)/g; }' $< > $@
-LA_DEFAULT_MULTISUBDIR = $(shell $(GCC_FOR_TARGET) --print-multi-dir)
+# Remove lib_build_self_specs before regression tests.
.PHONY: remove-lib-specs
check check-host check-target $(CHECK_TARGETS) $(lang_checks): remove-lib-specs
remove-lib-specs:
-mv -f specs.install specs 2>/dev/null
- -mv $(LA_DEFAULT_MULTISUBDIR)/* ./
- -mkdir -p ../$(target_noncanonical)/`dirname $(LA_DEFAULT_MULTISUBDIR)`
- -$(LN_S) .. ../$(target_noncanonical)/$(LA_DEFAULT_MULTISUBDIR)
# Multiarch
ifneq ($(call if_multiarch,yes),yes)
@@ -79,5 +75,6 @@ ifeq ($(filter LA_DISABLE_MULTILIB,$(tm_defines)),)
MULTILIB_OSDIRNAMES += \
mabi.lp64s=../lib64/sf$\
$(call if_multiarch,:loongarch64-linux-gnusf)
-
+else
+ MULTILIB_OSDIRNAMES := ../lib64
endif
--
2.41.1

View File

@ -2,7 +2,7 @@
%global gcc_major 12 %global gcc_major 12
# Note, gcc_release must be integer, if you want to add suffixes to # Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line. # %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 30 %global gcc_release 31
%global _unpackaged_files_terminate_build 0 %global _unpackaged_files_terminate_build 0
%global _performance_build 1 %global _performance_build 1
@ -72,9 +72,6 @@
%global _lib lib %global _lib lib
%global _smp_mflags -j8 %global _smp_mflags -j8
%endif %endif
%ifarch loongarch64
%global _lib lib
%endif
%global isl_enable 1 %global isl_enable 1
%global check_enable 0 %global check_enable 0
@ -338,6 +335,7 @@ Patch3127: LoongArch-Use-finer-grained-DBAR-hints.patch
Patch3128: LoongArch-Add-LA664-support.patch Patch3128: LoongArch-Add-LA664-support.patch
Patch3129: LoongArch-Fix-internal-error-running-gcc-march-nativ.patch Patch3129: LoongArch-Fix-internal-error-running-gcc-march-nativ.patch
Patch3130: LoongArch-Fix-lsx-vshuf.c-and-lasx-xvshuf_b.c-tests-.patch Patch3130: LoongArch-Fix-lsx-vshuf.c-and-lasx-xvshuf_b.c-tests-.patch
Patch3131: LoongArch-Fix-osdirname.patch
%endif %endif
# On ARM EABI systems, we do want -gnueabi to be part of the # On ARM EABI systems, we do want -gnueabi to be part of the
@ -1004,6 +1002,7 @@ not stable, so plugins must be rebuilt any time GCC is updated.
%patch3128 -p1 %patch3128 -p1
%patch3129 -p1 %patch3129 -p1
%patch3130 -p1 %patch3130 -p1
%patch3131 -p1
%endif %endif
echo '%{_vendor} %{version}-%{release}' > gcc/DEV-PHASE echo '%{_vendor} %{version}-%{release}' > gcc/DEV-PHASE
@ -3268,6 +3267,9 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog* %doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog %changelog
* Thu Jun 13 2024 Peng Fan <fanpeng@loongson.cn> - 12.3.1-31
- DESC: Fix LoongArch osdir name
* Fri May 17 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 12.3.1-30 * Fri May 17 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 12.3.1-30
- Type: Sync - Type: Sync
- DESC: Sync bug fix patch from openeuler/gcc - DESC: Sync bug fix patch from openeuler/gcc