Skip to content

Commit 234828b

Browse files
dongcarlFuzzbawls
authored andcommitted
depends: Decouple toolchain + binutils
For now they remain the same, but in the next commit, we will assign them differently according to wether or not we're using system clang.
1 parent 1dd3a5a commit 234828b

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

depends/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,12 @@ all_packages = $(packages) $(native_packages)
114114

115115
meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk cargo-checksum.sh
116116

117+
$(host_arch)_$(host_os)_native_binutils?=$($(host_os)_native_binutils)
117118
$(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain)
118119

119120
include funcs.mk
120121

122+
binutils_path=$($($(host_arch)_$(host_os)_native_binutils)_prefixbin)
121123
toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin)
122124
final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in)
123125
final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))
@@ -134,10 +136,10 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
134136
$(AT)sed -e 's|@HOST@|$(host)|' \
135137
-e 's|@CC@|$(toolchain_path)$(host_CC)|' \
136138
-e 's|@CXX@|$(toolchain_path)$(host_CXX)|' \
137-
-e 's|@AR@|$(toolchain_path)$(host_AR)|' \
138-
-e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \
139-
-e 's|@NM@|$(toolchain_path)$(host_NM)|' \
140-
-e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \
139+
-e 's|@AR@|$(binutils_path)$(host_AR)|' \
140+
-e 's|@RANLIB@|$(binutils_path)$(host_RANLIB)|' \
141+
-e 's|@NM@|$(binutils_path)$(host_NM)|' \
142+
-e 's|@STRIP@|$(binutils_path)$(host_STRIP)|' \
141143
-e 's|@build_os@|$(build_os)|' \
142144
-e 's|@host_os@|$(host_os)|' \
143145
-e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \

depends/builders/darwin.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ darwin_LIBTOOL:=$(shell xcrun -f libtool)
1919
darwin_OTOOL:=$(shell xcrun -f otool)
2020
darwin_NM:=$(shell xcrun -f nm)
2121
darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
22+
darwin_native_binutils=
2223
darwin_native_toolchain=

depends/funcs.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ endef
5656

5757
define int_get_build_id
5858
$(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_$(host_os)_dependencies))
59-
$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($(1)_dependencies)))
59+
$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($($(1)_type)_native_binutils) $($(1)_dependencies)))
6060
$(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash)))
6161
$(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type) $($(1)_build_id_deps) $($($(1)_type)_id_string))
6262
$(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH)))
@@ -271,4 +271,4 @@ $(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$
271271
$(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package))))
272272

273273
#special exception: if a toolchain package exists, all non-native packages depend on it
274-
$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) ))
274+
$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) $($($(host_arch)_$(host_os)_native_binutils)_cached) ))

depends/hosts/darwin.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)
2020
darwin_debug_CFLAGS=-O1
2121
darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS)
2222

23+
darwin_native_binutils=native_cctools
2324
darwin_native_toolchain=native_cctools

0 commit comments

Comments
 (0)