|
16 | 16 | # along with GCC; see the file COPYING3. If not see
|
17 | 17 | # <http://www.gnu.org/licenses/>.
|
18 | 18 |
|
19 |
| -# Multilib |
20 |
| -MULTILIB_OPTIONS = mabi=lp64d/mabi=lp64f/mabi=lp64s |
21 |
| -MULTILIB_DIRNAMES = base/lp64d base/lp64f base/lp64s |
22 |
| - |
23 |
| -# The GCC driver always gets all abi-related options on the command line. |
24 |
| -# (see loongarch-driver.c:driver_get_normalized_m_opts) |
25 |
| -comma=, |
26 |
| -MULTILIB_REQUIRED = $(foreach mlib,$(subst $(comma), ,$(TM_MULTILIB_CONFIG)),\ |
27 |
| - $(firstword $(subst /, ,$(mlib)))) |
28 |
| - |
29 |
| -SPECS = specs.install |
30 |
| - |
31 |
| -# temporary self_spec when building libraries (e.g. libgcc) |
32 |
| -gen_mlib_spec = $(if $(word 2,$1),\ |
33 |
| - %{$(firstword $1):$(patsubst %,-%,$(wordlist 2,$(words $1),$1))}) |
34 |
| - |
35 |
| -# clean up the result of DRIVER_SELF_SPEC to avoid conflict |
36 |
| -lib_build_self_spec = %<march=* %<mtune=* %<mcmodel=* %<mfpu=* %<msimd=* |
37 |
| - |
38 |
| -# append user-specified build options from --with-multilib-list |
39 |
| -lib_build_self_spec += $(foreach mlib,\ |
40 |
| - $(subst $(comma), ,$(TM_MULTILIB_CONFIG)),\ |
41 |
| - $(call gen_mlib_spec,$(subst /, ,$(mlib)))) |
42 |
| - |
43 |
| -specs: specs.install |
44 |
| - sed '/^*self_spec:$$/{ n;s/^$$/$(lib_build_self_spec)/g; }' $< > $@ |
45 |
| - |
46 |
| -# Do some preparation before regression tests: |
47 |
| -# remove lib-build-specs / make symlinks for the toplevel multilib variant |
48 |
| - |
49 |
| -LA_DEFAULT_MULTISUBDIR = $(shell $(GCC_FOR_TARGET) --print-multi-dir) |
50 |
| -.PHONY: remove-lib-specs |
51 |
| -check check-host check-target $(CHECK_TARGETS) $(lang_checks): remove-lib-specs |
52 |
| -remove-lib-specs: |
53 |
| - -mv -f specs.install specs 2>/dev/null |
54 |
| - -mv $(LA_DEFAULT_MULTISUBDIR)/* ./ |
55 |
| - -mkdir -p ../$(target_noncanonical)/`dirname $(LA_DEFAULT_MULTISUBDIR)` |
56 |
| - -$(LN_S) .. ../$(target_noncanonical)/$(LA_DEFAULT_MULTISUBDIR) |
57 |
| - |
58 |
| -# Multiarch |
59 |
| -ifneq ($(call if_multiarch,yes),yes) |
60 |
| - # Define LA_DISABLE_MULTIARCH if multiarch is disabled. |
61 |
| - tm_defines += LA_DISABLE_MULTIARCH |
62 |
| -else |
63 |
| - # Only define MULTIARCH_DIRNAME when multiarch is enabled, |
64 |
| - # or it would always introduce ${target} into the search path. |
65 |
| - MULTIARCH_DIRNAME = $(LA_MULTIARCH_TRIPLET) |
66 |
| -endif |
| 19 | +MULTIOSDIR_lp64d := ../lib64$(call if_multiarch,:loongarch64-linux-gnu) |
| 20 | +MULTIOSDIR_lp64f := ../lib64/f32$(call if_multiarch,:loongarch64-linux-gnuf32) |
| 21 | +MULTIOSDIR_lp64s := ../lib64/sf$(call if_multiarch,:loongarch64-linux-gnusf) |
67 | 22 |
|
68 | 23 | # Don't define MULTILIB_OSDIRNAMES if multilib is disabled.
|
69 | 24 | ifeq ($(filter LA_DISABLE_MULTILIB,$(tm_defines)),)
|
70 | 25 |
|
71 |
| - MULTILIB_OSDIRNAMES = \ |
72 |
| - mabi.lp64d=../lib64$\ |
73 |
| - $(call if_multiarch,:loongarch64-linux-gnu) |
74 |
| - |
75 |
| - MULTILIB_OSDIRNAMES += \ |
76 |
| - mabi.lp64f=../lib64/f32$\ |
77 |
| - $(call if_multiarch,:loongarch64-linux-gnuf32) |
78 |
| - |
79 |
| - MULTILIB_OSDIRNAMES += \ |
80 |
| - mabi.lp64s=../lib64/sf$\ |
81 |
| - $(call if_multiarch,:loongarch64-linux-gnusf) |
| 26 | + MULTILIB_OSDIRNAMES = .=$(MULTIOSDIR_$(mlib_default)) |
| 27 | + MULTILIB_OSDIRNAMES += mabi.lp64d=$(MULTIOSDIR_lp64d) |
| 28 | + MULTILIB_OSDIRNAMES += mabi.lp64f=$(MULTIOSDIR_lp64f) |
| 29 | + MULTILIB_OSDIRNAMES += mabi.lp64s=$(MULTIOSDIR_lp64s) |
82 | 30 |
|
83 | 31 | endif
|
0 commit comments