@@ -5,6 +5,7 @@ using BinaryBuilderToolchains: path_appending_merge
5
5
const verbose = false
6
6
7
7
using BinaryBuilderToolchains: get_vendor
8
+ const htt_toolchain = HostToolsToolchain (BBHostPlatform ())
8
9
@testset " CToolchain" begin
9
10
# Use native compilers so that we can run the output.
10
11
platform = CrossPlatform (BBHostPlatform () => HostPlatform ())
@@ -29,7 +30,7 @@ using BinaryBuilderToolchains: get_vendor
29
30
# Download the toolchain, make sure it runs
30
31
println ()
31
32
@info (" CToolchain tests" , use_ccache, config... )
32
- with_toolchains ([toolchain, HostToolsToolchain ( BBHostPlatform ()) ]) do prefix, env
33
+ with_toolchains ([toolchain, htt_toolchain ]) do prefix, env
33
34
env[" CCACHE_DIR" ] = ccache_dir
34
35
# We build with _all_ of the C++ stdlib choices here, so we need to ensure that
35
36
# we have the appropriate libraries on our `LD_LIBRARY_PATH` for testing, so
@@ -45,14 +46,14 @@ using BinaryBuilderToolchains: get_vendor
45
46
# Do the same, but with `GCCBootstrap`
46
47
toolchain = CToolchain (platform; vendor= :gcc_bootstrap , use_ccache= false )
47
48
@info (" CToolchain tests" , vendor= :gcc_bootstrap , use_ccache= false )
48
- with_toolchains ([toolchain]) do prefix, env
49
+ with_toolchains ([toolchain, htt_toolchain ]) do prefix, env
49
50
toolchain_tests (prefix, env, platform, " CToolchain" ; do_cxxabi_tests= true )
50
51
end
51
52
52
53
# Do the same again, but with `LLVMBootstrap_Clang`
53
54
toolchain = CToolchain (platform; vendor= :clang_bootstrap , use_ccache= false )
54
55
@info (" CToolchain tests" , vendor= :clang_bootstrap , use_ccache= false )
55
- with_toolchains ([toolchain]) do prefix, env
56
+ with_toolchains ([toolchain, htt_toolchain ]) do prefix, env
56
57
toolchain_tests (prefix, env, platform, " CToolchain" ; do_cxxabi_tests= true )
57
58
end
58
59
@@ -83,15 +84,12 @@ using BinaryBuilderToolchains: get_vendor
83
84
use_ccache= false ,
84
85
)
85
86
86
- # We'll need things like `make` etc...
87
- hosttools_toolchain = HostToolsToolchain (platform)
88
-
89
87
# Use each toolchain to build a `libfoo` with a different version embedded within:
90
88
host_version = 1
91
89
target_version = 2
92
90
for (toolchains, install_prefix, cc, libfoo_version) in (
93
- ([host_ctoolchain, hosttools_toolchain ], host_prefix, " \$ {HOST_CC}" , host_version),
94
- ([target_ctoolchain, hosttools_toolchain ], target_prefix, " \$ {CC}" , target_version))
91
+ ([host_ctoolchain, htt_toolchain ], host_prefix, " \$ {HOST_CC}" , host_version),
92
+ ([target_ctoolchain, htt_toolchain ], target_prefix, " \$ {CC}" , target_version))
95
93
with_toolchains (toolchains) do prefix, env
96
94
cd (joinpath (@__DIR__ , " testsuite" , " CToolchainHostIsolation" , " libfoo" )) do
97
95
@test success (setenv (Cmd ([" /bin/bash" , " -c" , " make install CC=$(cc) prefix=$(install_prefix) VERSION=$(libfoo_version) " ]), env))
@@ -105,7 +103,7 @@ using BinaryBuilderToolchains: get_vendor
105
103
106
104
# Next, within a single shell with _both_ toolchains installed, verify that the
107
105
# include path searched by the preprocessor and linker is correct:
108
- with_toolchains ([host_ctoolchain, hosttools_toolchain ]) do _, host_env
106
+ with_toolchains ([host_ctoolchain, htt_toolchain ]) do _, host_env
109
107
with_toolchains ([target_ctoolchain]) do _, target_env
110
108
env = path_appending_merge (host_env, target_env)
111
109
cd (joinpath (@__DIR__ , " testsuite" , " CToolchainHostIsolation" )) do
@@ -139,12 +137,12 @@ using BinaryBuilderToolchains: get_vendor
139
137
target_platform = CrossPlatform (BBHostPlatform () => target)
140
138
for vendor in (:auto , :gcc , :clang , :gcc_bootstrap , :clang_bootstrap )
141
139
toolchain = CToolchain (target_platform; vendor, use_ccache= false )
142
- with_toolchains ([toolchain, HostToolsToolchain (target_platform) ]) do prefix, env
140
+ with_toolchains ([toolchain, htt_toolchain ]) do prefix, env
143
141
@testset " $(triplet (target)) - $(vendor) " begin
144
142
# First, run `$CC --version` for everything
145
143
for tool_name in (" CC" , " LD" , " AS" )
146
144
@testset " $(tool_name) " begin
147
- p, output = capture_output (setenv (` bash -c "\$ $(tool_name) --version"` , env))
145
+ p, output = capture_output (setenv (` bash -c "\$ $(tool_name) --version || \$ $(tool_name) -v "` , env))
148
146
if ! success (p)
149
147
println (output)
150
148
end
@@ -167,7 +165,7 @@ using BinaryBuilderToolchains: get_vendor
167
165
168
166
# Ensure that `strip` works for macOS without needing to resign
169
167
macos_cp = CrossPlatform (BBHostPlatform () => Platform (" aarch64" , " macos" ))
170
- toolchains = [HostToolsToolchain (macos_cp), CToolchain (macos_cp) ]
168
+ toolchains = [CToolchain (macos_cp), htt_toolchain ]
171
169
with_toolchains (toolchains) do prefix, env
172
170
cd (joinpath (@__DIR__ , " testsuite" , " CToolchain" , " 08_strip_resigning" )) do
173
171
@test success (setenv (Cmd ([" /bin/bash" , " -c" , " make clean; make check" ]), env))
0 commit comments