File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ message("-- SWIFT_LIBRARY_PATH = ${SWIFT_LIBRARY_PATH}")
272
272
message ("-- CLANG_EXEC = ${CLANG_EXEC} " )
273
273
message ("-- SWIFT_OPTIMIZATION_LEVELS = ${SWIFT_OPTIMIZATION_LEVELS} " )
274
274
message ("-- ONLY_PLATFORMS = ${ONLY_PLATFORMS} " )
275
+ message ("-- PAGE_ALIGNMENT_OPTION = ${PAGE_ALIGNMENT_OPTION} " )
275
276
276
277
message ("-- found platforms: ${platforms} " )
277
278
message ("-- found sdks:" )
Original file line number Diff line number Diff line change @@ -40,6 +40,19 @@ macro(configure_build)
40
40
message (FATAL_ERROR "Unsupported platform?!" )
41
41
endif ()
42
42
43
+ set (PAGE_ALIGNMENT_OPTION "-Xllvm" "-align-module-to-page-size" )
44
+ execute_process (
45
+ COMMAND "touch" "empty.swift"
46
+ RESULT_VARIABLE result
47
+ ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE )
48
+ execute_process (
49
+ COMMAND "${SWIFT_EXEC} " ${PAGE_ALIGNMENT_OPTION} "empty.swift"
50
+ RESULT_VARIABLE result
51
+ ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE )
52
+ if (NOT "${result} " MATCHES "0" )
53
+ set (PAGE_ALIGNMENT_OPTION "" )
54
+ endif ()
55
+
43
56
# We always infer the SWIFT_LIBRARY_PATH from SWIFT_EXEC unless
44
57
# SWIFT_LIBRARY_PATH is specified explicitly.
45
58
if (NOT SWIFT_LIBRARY_PATH )
@@ -293,7 +306,7 @@ function (swift_benchmark_compile_archopts)
293
306
set (common_options
294
307
"-c"
295
308
"-target" "${target} "
296
- "-${BENCH_COMPILE_ARCHOPTS_OPT} " )
309
+ "-${BENCH_COMPILE_ARCHOPTS_OPT} " ${PAGE_ALIGNMENT_OPTION} )
297
310
298
311
if (is_darwin )
299
312
list (APPEND common_options
You can’t perform that action at this time.
0 commit comments