79 lines
2.9 KiB
Diff
79 lines
2.9 KiB
Diff
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
|
|
|