Skip to content

Commit 42251e0

Browse files
committed
Merge bitcoin/bitcoin#30584: depends: Make default host and build comparable
b28917b depends: Make default `host` and `build` comparable (Hennadii Stepanov) Pull request description: To detect cross-compiling, the host and build platforms are compared. The `build` variable is always an output of `config.sub`, but the `host` is not. This can lead to false results. For example, on OpenBSD: - host=amd64-unknown-openbsd7.5 - build=x86_64-unknown-openbsd7.5 This PR sets the default value of the `host` variable to the value of `build`, ensuring cross-compiling won't be triggered when the `HOST` variable is not set. This PR fixes needless triggering of cross-compiling for CMake-built packages in depends on OpenBSD due to this code:https://github.com/bitcoin/bitcoin/blob/eb85cacd2969caaea682104f498f6b2e6cfb80f8/depends/funcs.mk#L193-L197 No changes in Guix build. ACKs for top commit: laanwj: Concept and code review ACK b28917b theuni: utACK b28917b. Tree-SHA512: 8c5835cb8b739355b71f7cb161b350ad8b038a00e6b1def36354ba228cea3dcb9883df3c9a8e79d7d0143241f6f054129fe90772b1b2579702db51237f9d66ff
2 parents 0b6ed34 + b28917b commit 42251e0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

depends/Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ C_STANDARD ?= c11
5050
CXX_STANDARD ?= c++20
5151

5252
BUILD = $(shell ./config.guess)
53-
HOST ?= $(BUILD)
5453
PATCHES_PATH = $(BASEDIR)/patches
5554
BASEDIR = $(CURDIR)
5655
HASH_LENGTH:=11
@@ -59,11 +58,6 @@ DOWNLOAD_RETRIES:=3
5958
HOST_ID_SALT ?= salt
6059
BUILD_ID_SALT ?= salt
6160

62-
host:=$(BUILD)
63-
ifneq ($(HOST),)
64-
host:=$(HOST)
65-
endif
66-
6761
ifneq ($(DEBUG),)
6862
release_type=debug
6963
else
@@ -73,9 +67,15 @@ endif
7367
base_build_dir=$(WORK_PATH)/build
7468
base_staging_dir=$(WORK_PATH)/staging
7569
base_download_dir=$(WORK_PATH)/download
76-
canonical_host:=$(shell ./config.sub $(HOST))
7770
build:=$(shell ./config.sub $(BUILD))
7871

72+
host:=$(build)
73+
ifneq ($(HOST),)
74+
host:=$(HOST)
75+
endif
76+
HOST ?= $(BUILD)
77+
canonical_host:=$(shell ./config.sub $(HOST))
78+
7979
build_arch =$(firstword $(subst -, ,$(build)))
8080
build_vendor=$(word 2,$(subst -, ,$(build)))
8181
full_build_os:=$(subst $(build_arch)-$(build_vendor)-,,$(build))

0 commit comments

Comments
 (0)