diff --git a/LoongArch-Fix-osdirname.patch b/LoongArch-Fix-osdirname.patch new file mode 100644 index 0000000000000000000000000000000000000000..528ff960af36f4ffa6e431bbc74000edf8ffc0ea --- /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 3da84cea502008ec72ccf2a8c5f016e2bd32d4fd..5e68f3b8b75897b5e3d55b99f1352134ffeff77f 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1,4 +1,4 @@ -%define anolis_release 4 +%define anolis_release 5 %global DATE 20221121 %global gitrev b3f5a0d53b84ed27cf00cfa2b9c3e2c78935c07d @@ -40,7 +40,6 @@ %global gcc_target_platform %{_target_platform} %ifarch loongarch64 %global build_libstdcxx_docs 0 -%global _lib lib %endif %undefine _hardened_build @@ -249,6 +248,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 # Part 5000 ~ 5999 Patch5001: HYGON-0001-arch-support-for-hygon.patch @@ -900,6 +900,7 @@ The %{name}-doc package contains documentation files for %{name}. %patch3128 -p1 %patch3129 -p1 %patch3130 -p1 +%patch3131 -p1 %endif %ifarch x86_64 %patch5001 -p1 @@ -2368,6 +2369,9 @@ end %changelog +* Thu Jun 13 2024 Peng Fan 12.3.0-5 +- LoongArch: fix osdir name. + * Tue Apr 23 2024 Peng Fan 12.3.0-4 - LoongArch: add 3a6000 support.