From 80dbb737b0d3ac4a50f7ec00a82751efe7fa0aa0 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 13 Jun 2024 20:14:12 +0800 Subject: [PATCH] LoongArch: Fix osdir name Signed-off-by: Peng Fan --- LoongArch-Fix-osdirname.patch | 78 +++++++++++++++++++++++++++++++++++ gcc.spec | 10 +++-- 2 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 LoongArch-Fix-osdirname.patch diff --git a/LoongArch-Fix-osdirname.patch b/LoongArch-Fix-osdirname.patch new file mode 100644 index 0000000..528ff96 --- /dev/null +++ b/LoongArch-Fix-osdirname.patch @@ -0,0 +1,78 @@ +From 297ebfe072777f82bb6a9b7699dde926e589b357 Mon Sep 17 00:00:00 2001 +From: Peng Fan +Date: Thu, 13 Jun 2024 01:31:55 +0000 +Subject: [PATCH] LoongArch: Fix osdirname + +Signed-off-by: Peng Fan +--- + 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 = % $@ +- +-# 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 + diff --git a/gcc.spec b/gcc.spec index a95de7d..019df3c 100644 --- a/gcc.spec +++ b/gcc.spec @@ -2,7 +2,7 @@ %global gcc_major 12 # Note, gcc_release must be integer, if you want to add suffixes to # %%{release}, append them after %%{gcc_release} on Release: line. -%global gcc_release 30 +%global gcc_release 31 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 @@ -72,9 +72,6 @@ %global _lib lib %global _smp_mflags -j8 %endif -%ifarch loongarch64 -%global _lib lib -%endif %global isl_enable 1 %global check_enable 0 @@ -338,6 +335,7 @@ Patch3127: LoongArch-Use-finer-grained-DBAR-hints.patch Patch3128: LoongArch-Add-LA664-support.patch Patch3129: LoongArch-Fix-internal-error-running-gcc-march-nativ.patch Patch3130: LoongArch-Fix-lsx-vshuf.c-and-lasx-xvshuf_b.c-tests-.patch +Patch3131: LoongArch-Fix-osdirname.patch %endif # 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 %patch3129 -p1 %patch3130 -p1 +%patch3131 -p1 %endif echo '%{_vendor} %{version}-%{release}' > gcc/DEV-PHASE @@ -3268,6 +3267,9 @@ end %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog +* Thu Jun 13 2024 Peng Fan - 12.3.1-31 +- DESC: Fix LoongArch osdir name + * Fri May 17 2024 Zhenyu Zhao - 12.3.1-30 - Type: Sync - DESC: Sync bug fix patch from openeuler/gcc -- Gitee