Skip to content

Commit db01f33

Browse files
committed
[build-script] Specify CMAKE_RANLIB when building a CMakeProduct.
When I perform the stage2 build, the first C-libdispatch seems to require this.
1 parent ee91879 commit db01f33

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

utils/swift_build_support/swift_build_support/cmake.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def common_options(self, product=None):
153153
define("CMAKE_Swift_COMPILER:PATH", toolchain.swiftc)
154154
define("CMAKE_LIBTOOL:PATH", toolchain.libtool)
155155
define("CMAKE_AR:PATH", toolchain.ar)
156+
define("CMAKE_RANLIB:PATH", toolchain.ranlib)
156157

157158
if args.cmake_generator == 'Xcode':
158159
define("CMAKE_CONFIGURATION_TYPES",

utils/swift_build_support/swift_build_support/toolchain.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def _getter(self):
6262
_register("llvm_cov", "llvm-cov")
6363
_register("lipo", "lipo")
6464
_register("libtool", "libtool")
65+
_register("ranlib", "ranlib")
6566
_register("ar", "ar")
6667
_register("sccache", "sccache")
6768
_register("swiftc", "swiftc")

utils/swift_build_support/tests/test_cmake.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def default_args(self):
5050
host_swiftc="/path/to/swiftc",
5151
host_libtool="/path/to/libtool",
5252
host_ar="/path/to/ar",
53+
host_ranlib="/path/to/ranlib",
5354
enable_asan=False,
5455
enable_ubsan=False,
5556
enable_tsan=False,
@@ -85,6 +86,7 @@ def cmake(self, args):
8586
toolchain.swiftc = args.host_swiftc
8687
toolchain.libtool = args.host_libtool
8788
toolchain.ar = args.host_ar
89+
toolchain.ranlib = args.host_ranlib
8890
if args.distcc:
8991
toolchain.distcc = self.mock_distcc_path()
9092
if args.sccache:
@@ -103,6 +105,7 @@ def test_common_options_defaults(self):
103105
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
104106
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
105107
"-DCMAKE_AR:PATH=/path/to/ar",
108+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
106109
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
107110

108111
def test_common_options_asan(self):
@@ -118,6 +121,7 @@ def test_common_options_asan(self):
118121
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
119122
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
120123
"-DCMAKE_AR:PATH=/path/to/ar",
124+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
121125
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
122126

123127
def test_common_options_ubsan(self):
@@ -133,6 +137,7 @@ def test_common_options_ubsan(self):
133137
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
134138
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
135139
"-DCMAKE_AR:PATH=/path/to/ar",
140+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
136141
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
137142

138143
def test_common_options_tsan(self):
@@ -148,6 +153,7 @@ def test_common_options_tsan(self):
148153
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
149154
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
150155
"-DCMAKE_AR:PATH=/path/to/ar",
156+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
151157
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
152158

153159
def test_common_options_asan_ubsan(self):
@@ -164,6 +170,7 @@ def test_common_options_asan_ubsan(self):
164170
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
165171
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
166172
"-DCMAKE_AR:PATH=/path/to/ar",
173+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
167174
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
168175

169176
def test_common_options_ubsan_tsan(self):
@@ -180,6 +187,7 @@ def test_common_options_ubsan_tsan(self):
180187
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
181188
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
182189
"-DCMAKE_AR:PATH=/path/to/ar",
190+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
183191
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
184192

185193
def test_common_options_asan_ubsan_tsan(self):
@@ -197,6 +205,7 @@ def test_common_options_asan_ubsan_tsan(self):
197205
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
198206
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
199207
"-DCMAKE_AR:PATH=/path/to/ar",
208+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
200209
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
201210

202211
def test_common_options_lsan(self):
@@ -212,6 +221,7 @@ def test_common_options_lsan(self):
212221
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
213222
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
214223
"-DCMAKE_AR:PATH=/path/to/ar",
224+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
215225
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
216226

217227
def test_common_options_coverage_sanitizer(self):
@@ -227,6 +237,7 @@ def test_common_options_coverage_sanitizer(self):
227237
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
228238
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
229239
"-DCMAKE_AR:PATH=/path/to/ar",
240+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
230241
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
231242

232243
def test_common_options_export_compile_commands(self):
@@ -242,6 +253,7 @@ def test_common_options_export_compile_commands(self):
242253
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
243254
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
244255
"-DCMAKE_AR:PATH=/path/to/ar",
256+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
245257
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
246258

247259
def test_common_options_distcc(self):
@@ -258,6 +270,7 @@ def test_common_options_distcc(self):
258270
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
259271
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
260272
"-DCMAKE_AR:PATH=/path/to/ar",
273+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
261274
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
262275

263276
def test_common_options_sccache(self):
@@ -274,6 +287,7 @@ def test_common_options_sccache(self):
274287
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
275288
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
276289
"-DCMAKE_AR:PATH=/path/to/ar",
290+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
277291
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
278292

279293
def test_common_options_launcher(self):
@@ -293,6 +307,7 @@ def test_common_options_launcher(self):
293307
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
294308
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
295309
"-DCMAKE_AR:PATH=/path/to/ar",
310+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
296311
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
297312

298313
def test_common_options_xcode(self):
@@ -307,6 +322,7 @@ def test_common_options_xcode(self):
307322
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
308323
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
309324
"-DCMAKE_AR:PATH=/path/to/ar",
325+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
310326
"-DCMAKE_CONFIGURATION_TYPES=" +
311327
"Debug;Release;MinSizeRel;RelWithDebInfo"])
312328

@@ -322,6 +338,7 @@ def test_common_options_clang_compiler_version(self):
322338
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
323339
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
324340
"-DCMAKE_AR:PATH=/path/to/ar",
341+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
325342
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
326343

327344
def test_common_options_clang_user_visible_version(self):
@@ -336,6 +353,7 @@ def test_common_options_clang_user_visible_version(self):
336353
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
337354
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
338355
"-DCMAKE_AR:PATH=/path/to/ar",
356+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
339357
"-DLLVM_VERSION_MAJOR:STRING=9",
340358
"-DLLVM_VERSION_MINOR:STRING=0",
341359
"-DLLVM_VERSION_PATCH:STRING=0",
@@ -356,6 +374,7 @@ def test_common_options_build_ninja(self):
356374
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
357375
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
358376
"-DCMAKE_AR:PATH=/path/to/ar",
377+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
359378
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
360379

361380
def test_common_options_full(self):
@@ -381,6 +400,7 @@ def test_common_options_full(self):
381400
"-DCMAKE_Swift_COMPILER:PATH=/path/to/swiftc",
382401
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
383402
"-DCMAKE_AR:PATH=/path/to/ar",
403+
"-DCMAKE_RANLIB:PATH=/path/to/ranlib",
384404
"-DCMAKE_CONFIGURATION_TYPES=" +
385405
"Debug;Release;MinSizeRel;RelWithDebInfo",
386406
"-DLLVM_VERSION_MAJOR:STRING=9",

0 commit comments

Comments
 (0)