forked from JetBrains/kotlin-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkonan.properties
831 lines (725 loc) · 36.8 KB
/
konan.properties
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
#
# Copyright 2010-2018 JetBrains s.r.o.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# TODO: Do we need a $variable substitution mechanism here?
dependenciesUrl = https://download.jetbrains.com/kotlin/native
# In order of preference:
dependencyProfiles = default alt
# Don't check dependencies on a server.
# If true, dependency downloader will throw an exception if a dependency isn't found in $KONAN_DATA_DIR/dependencies
airplaneMode = false
# if true, ignores Xcode version check.
ignoreXcodeVersionCheck = false
minimalXcodeVersion=11.0
downloadingAttempts = 10
downloadingAttemptIntervalMs = 3000
homeDependencyCache = .konan/cache
# Appendix that is used for smaller version of LLVM distributions.
reducedLlvmAppendix = compact
predefinedLlvmDistributions = \
clang-llvm-8.0.0-linux-x86-64 \
msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1 \
clang-llvm-apple-8.0.0-darwin-macos
llvm.linux_x64.dev = clang-llvm-8.0.0-linux-x86-64
llvm.linux_x64.user = clang-llvm-8.0.0-linux-x86-64
llvm.mingw_x64.dev = msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1
llvm.mingw_x64.user = msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1
llvm.macos_x64.dev = clang-llvm-apple-8.0.0-darwin-macos
llvm.macos_x64.user = clang-llvm-apple-8.0.0-darwin-macos
# By default LLVM uses 250 for -03 builds.
# We use a smaller value since default value leads to
# unreasonably bloated runtime code without any measurable
# performance benefits.
# This value still has to be tuned for different targets, though.
llvmInlineThreshold = 100
clangDebugFlags = -O0
linkerGccFlags = -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
llvmVersion.linux_x64 = 8.0.0
llvmVersion.mingw_x64 = 8.0.1
llvmVersion.macos_x64 = 8.0.0
cacheableTargets.macos_x64 = \
macos_x64 \
ios_x64 \
ios_arm64
cacheableTargets.linux_x64 = \
linux_x64
cacheableTargets.mingw_x64 =
# Mac OS X.
# Can be an absolute path instead of predefined value.
llvmHome.macos_x64 = $llvm.macos_x64.dev
targetToolchain.macos_x64 = target-toolchain-xcode_12_2-macos_x64
libffiDir.macos_x64 = libffi-3.2.1-3-darwin-macos
additionalToolsDir.macos_x64 = xcode-addon-xcode_12_2-macos_x64
arch.macos_x64 = x86_64
targetSysRoot.macos_x64 = target-sysroot-xcode_12_2-macos_x64
targetCpu.macos_x64 = core2
clangFlags.macos_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir
clangNooptFlags.macos_x64 = -O1
clangOptFlags.macos_x64 = -O3
clangDebugFlags.macos_x64 = -O0
linkerKonanFlags.macos_x64 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 10.15.6
linkerOptimizationFlags.macos_x64 = -dead_strip
linkerNoDebugFlags.macos_x64 = -S
linkerDynamicFlags.macos_x64 = -dylib
osVersionMinFlagLd.macos_x64 = -macosx_version_min
osVersionMinFlagClang.macos_x64 = -mmacosx-version-min
osVersionMin.macos_x64 = 10.11
runtimeDefinitions.macos_x64 = KONAN_OSX=1 KONAN_MACOSX=1 KONAN_X64=1 KONAN_OBJC_INTEROP=1 \
KONAN_CORE_SYMBOLICATION=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
dependencies.macos_x64 = \
libffi-3.2.1-3-darwin-macos \
lldb-3-macos
target-sysroot-xcode_12_2-macos_x64.default = \
remote:internal
target-toolchain-xcode_12_2-macos_x64.default = \
remote:internal
xcode-addon-xcode_12_2-macos_x64.default = \
remote:internal
# Apple's 32-bit iOS.
targetToolchain.macos_x64-ios_arm32 = target-toolchain-xcode_12_2-macos_x64
dependencies.macos_x64-ios_arm32 = \
libffi-3.2.1-3-darwin-macos
target-sysroot-xcode_12_2-ios_arm32.default = \
remote:internal
arch.ios_arm32 = armv7
# Shared with 64-bit version.
targetSysRoot.ios_arm32 = target-sysroot-xcode_12_2-ios_arm64
targetCpu.ios_arm32 = generic
clangFlags.ios_arm32 = -cc1 -emit-obj -disable-llvm-optzns -x ir
clangNooptFlags.ios_arm32 = -O1
clangOptFlags.ios_arm32 = -O3
clangDebugFlags.ios_arm32 = -O0
linkerNoDebugFlags.ios_arm32 = -S
linkerDynamicFlags.ios_arm32 = -dylib
linkerKonanFlags.ios_arm32 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 14.0
linkerOptimizationFlags.ios_arm32 = -dead_strip
osVersionMinFlagLd.ios_arm32 = -iphoneos_version_min
osVersionMinFlagClang.ios_arm32 = -miphoneos-version-min
osVersionMin.ios_arm32 = 9.0
# Regarding KONAN_NO_64BIT_ATOMIC:
# While not 100% correct here, using atomic ops on iOS armv7 requires 8 byte alignment,
# and general ABI requires 4-byte alignment on 64-bit long fields as mentioned in
# https://developer.apple.com/library/archive/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARMv6FunctionCallingConventions.html#//apple_ref/doc/uid/TP40009021-SW1
# See https://github.com/ktorio/ktor/issues/941 for the context.
runtimeDefinitions.ios_arm32 = KONAN_OBJC_INTEROP=1 KONAN_IOS KONAN_ARM32=1 \
KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1 KONAN_REPORT_BACKTRACE_TO_IOS_CRASH_LOG=1 MACHSIZE=32 \
KONAN_NO_64BIT_ATOMIC=1 KONAN_NO_UNALIGNED_ACCESS=1
# Apple's 64-bit iOS.
targetToolchain.macos_x64-ios_arm64 = target-toolchain-xcode_12_2-macos_x64
dependencies.macos_x64-ios_arm64 = \
libffi-3.2.1-3-darwin-macos
target-sysroot-xcode_12_2-ios_arm64.default = \
remote:internal
arch.ios_arm64 = arm64
targetSysRoot.ios_arm64 = target-sysroot-xcode_12_2-ios_arm64
targetCpu.ios_arm64 = cyclone
clangFlags.ios_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir
clangNooptFlags.ios_arm64 = -O1
clangOptFlags.ios_arm64 = -O3
# We force LLVM to use SelectionDAG because fast isel may miscompile sign extension.
# Related:
# https://github.com/JetBrains/kotlin-native/issues/3290
clangDebugFlags.ios_arm64 = -O0 -mllvm -fast-isel=false -mllvm -global-isel=false
linkerNoDebugFlags.ios_arm64 = -S
linkerDynamicFlags.ios_arm64 = -dylib
linkerKonanFlags.ios_arm64 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 14.0
linkerOptimizationFlags.ios_arm64 = -dead_strip
osVersionMinFlagLd.ios_arm64 = -iphoneos_version_min
osVersionMinFlagClang.ios_arm64 = -miphoneos-version-min
osVersionMin.ios_arm64 = 9.0
runtimeDefinitions.ios_arm64 = KONAN_OBJC_INTEROP=1 KONAN_IOS=1 KONAN_ARM64=1 \
KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1 KONAN_REPORT_BACKTRACE_TO_IOS_CRASH_LOG=1 MACHSIZE=64
additionalCacheFlags.ios_arm64 = -Xembed-bitcode-marker
# Apple's iOS simulator.
targetToolchain.macos_x64-ios_x64 = target-toolchain-xcode_12_2-macos_x64
dependencies.macos_x64-ios_x64 = \
libffi-3.2.1-3-darwin-macos
target-sysroot-xcode_12_2-ios_x64.default = \
remote:internal
arch.ios_x64 = x86_64
targetSysRoot.ios_x64 = target-sysroot-xcode_12_2-ios_x64
targetCpu.ios_x64 = core2
clangFlags.ios_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir
clangNooptFlags.ios_x64 = -O1
clangOptFlags.ios_x64 = -O3
clangDebugFlags.ios_x64 = -O0
linkerKonanFlags.ios_x64 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 14.0
linkerOptimizationFlags.ios_x64 = -dead_strip
linkerNoDebugFlags.ios_x64 = -S
linkerDynamicFlags.ios_x64 = -dylib
osVersionMinFlagLd.ios_x64 = -ios_simulator_version_min
osVersionMinFlagClang.ios_x64 = -mios-simulator-version-min
osVersionMin.ios_x64 = 9.0
runtimeDefinitions.ios_x64 = KONAN_OBJC_INTEROP=1 KONAN_IOS=1 KONAN_X64=1 \
KONAN_CORE_SYMBOLICATION=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
# Apple's tvOS simulator.
targetToolchain.macos_x64-tvos_x64 = target-toolchain-xcode_12_2-macos_x64
dependencies.macos_x64-tvos_x64 = \
libffi-3.2.1-3-darwin-macos
target-sysroot-xcode_12_2-tvos_x64.default = \
remote:internal
arch.tvos_x64 = x86_64
targetSysRoot.tvos_x64 = target-sysroot-xcode_12_2-tvos_x64
targetCpu.tvos_x64 = core2
clangFlags.tvos_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir
clangNooptFlags.tvos_x64 = -O1
clangOptFlags.tvos_x64 = -O3
clangDebugFlags.tvos_x64 = -O0
linkerKonanFlags.tvos_x64 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 14.0
linkerOptimizationFlags.tvos_x64 = -dead_strip
linkerNoDebugFlags.tvos_x64 = -S
linkerDynamicFlags.tvos_x64 = -dylib
osVersionMinFlagLd.tvos_x64 = -tvos_simulator_version_min
osVersionMinFlagClang.tvos_x64 = -mtvos-simulator-version-min
osVersionMin.tvos_x64 = 9.0
runtimeDefinitions.tvos_x64 = KONAN_OBJC_INTEROP=1 KONAN_TVOS=1 KONAN_X64=1 \
KONAN_CORE_SYMBOLICATION=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
# Apple's 64-bit tvOS.
targetToolchain.macos_x64-tvos_arm64 = target-toolchain-xcode_12_2-macos_x64
dependencies.macos_x64-tvos_arm64 = \
libffi-3.2.1-3-darwin-macos
target-sysroot-xcode_12_2-tvos_arm64.default = \
remote:internal
arch.tvos_arm64 = arm64
targetSysRoot.tvos_arm64 = target-sysroot-xcode_12_2-tvos_arm64
targetCpu.tvos_arm64 = cyclone
clangFlags.tvos_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir
clangNooptFlags.tvos_arm64 = -O1
clangOptFlags.tvos_arm64 = -O3
clangDebugFlags.tvos_arm64 = -O0 -mllvm -fast-isel=false -mllvm -global-isel=false
linkerNoDebugFlags.tvos_arm64 = -S
linkerDynamicFlags.tvos_arm64 = -dylib
linkerKonanFlags.tvos_arm64 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 14.0
linkerOptimizationFlags.tvos_arm64 = -dead_strip
osVersionMinFlagLd.tvos_arm64 = -tvos_version_min
osVersionMinFlagClang.tvos_arm64 = -mtvos-version-min
osVersionMin.tvos_arm64 = 9.0
runtimeDefinitions.tvos_arm64 = KONAN_OBJC_INTEROP=1 KONAN_TVOS=1 KONAN_ARM64=1 \
KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1 KONAN_REPORT_BACKTRACE_TO_IOS_CRASH_LOG=1 MACHSIZE=64
# watchOS armv7k
targetToolchain.macos_x64-watchos_arm32 = target-toolchain-xcode_12_2-macos_x64
dependencies.macos_x64-watchos_arm32 = \
libffi-3.2.1-3-darwin-macos
target-sysroot-xcode_12_2-watchos_arm32.default = \
remote:internal
arch.watchos_arm32 = armv7k
targetSysRoot.watchos_arm32 = target-sysroot-xcode_12_2-watchos_arm32
targetCpu.watchos_arm32 = cortex-a7
clangFlags.watchos_arm32 = -cc1 -emit-obj -disable-llvm-passes -x ir
clangNooptFlags.watchos_arm32 = -O1
clangOptFlags.watchos_arm32 = -O3
clangDebugFlags.watchos_arm32 = -O0
linkerKonanFlags.watchos_arm32 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 7.0
linkerOptimizationFlags.watchos_arm32 = -dead_strip
linkerNoDebugFlags.watchos_arm32 = -S
linkerDynamicFlags.watchos_arm32 = -dylib
osVersionMinFlagLd.watchos_arm32 = -watchos_version_min
osVersionMinFlagClang.watchos_arm32 = -mwatchos-version-min
osVersionMin.watchos_arm32 = 5.0
# Regarding KONAN_NO_64BIT_ATOMIC=1: see explanation for ios_arm32 above.
runtimeDefinitions.watchos_arm32 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS KONAN_ARM32=1 \
KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1 KONAN_REPORT_BACKTRACE_TO_IOS_CRASH_LOG=1 \
MACHSIZE=32 KONAN_NO_64BIT_ATOMIC=1 KONAN_NO_UNALIGNED_ACCESS=1
# watchOS arm64_32
targetToolchain.macos_x64-watchos_arm64 = target-toolchain-xcode_12_2-macos_x64
dependencies.macos_x64-watchos_arm64 = \
libffi-3.2.1-3-darwin-macos
target-sysroot-xcode_12_2-watchos_arm64.default = \
remote:internal
arch.watchos_arm64 = arm64_32
targetSysRoot.watchos_arm64 = target-sysroot-xcode_12_2-watchos_arm32
targetCpu.watchos_arm64 = cortex-a7
clangFlags.watchos_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir -mllvm -aarch64-watch-bitcode-compatibility \
-mllvm -arm-bitcode-compatibility -mllvm -fast-isel=false -mllvm -global-isel=false
clangNooptFlags.watchos_arm64 = -O1
clangOptFlags.watchos_arm64 = -O3
clangDebugFlags.watchos_arm64 = -O0
linkerKonanFlags.watchos_arm64 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 7.0
linkerOptimizationFlags.watchos_arm64 = -dead_strip
linkerNoDebugFlags.watchos_arm64 = -S
linkerDynamicFlags.watchos_arm64 = -dylib
osVersionMinFlagLd.watchos_arm64 = -watchos_version_min
osVersionMinFlagClang.watchos_arm64 = -mwatchos-version-min
osVersionMin.watchos_arm64 = 5.0
# Regarding KONAN_NO_64BIT_ATOMIC=1: see explanation for ios_arm32 above.
runtimeDefinitions.watchos_arm64 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS KONAN_ARM32=1 \
KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1 KONAN_REPORT_BACKTRACE_TO_IOS_CRASH_LOG=1 \
MACHSIZE=32 KONAN_NO_64BIT_ATOMIC=1 KONAN_NO_UNALIGNED_ACCESS=1
# Apple's watchOS i386 simulator.
targetToolchain.macos_x64-watchos_x86 = target-toolchain-xcode_12_2-macos_x64
dependencies.macos_x64-watchos_x86 = \
libffi-3.2.1-3-darwin-macos
target-sysroot-xcode_12_2-watchos_x86.default = \
remote:internal
arch.watchos_x86 = i386
targetSysRoot.watchos_x86 = target-sysroot-xcode_12_2-watchos_x86
# -target-cpu pentium4 makes sure that code-generator knows which CPU flavour to emit code for.
# Can be seen on optimized build and FP tests, where value is passed on stack
# by Kotlin and taken from SSE registers by C code.
# TODO: once this information is available in function attributes, we can remove this flag.
targetCpu.watchos_x86 = pentium4
clangFlags.watchos_x86 = -cc1 -emit-obj -disable-llvm-passes -x ir -target-cpu $targetCpu.watchos_x86
clangNooptFlags.watchos_x86 = -O1
clangOptFlags.watchos_x86 = -O3
clangDebugFlags.watchos_x86 = -O0
linkerKonanFlags.watchos_x86 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 7.0
linkerOptimizationFlags.watchos_x86 = -dead_strip
linkerNoDebugFlags.watchos_x86 = -S
linkerDynamicFlags.watchos_x86 = -dylib
osVersionMinFlagLd.watchos_x86 = -watchos_simulator_version_min
osVersionMinFlagClang.watchos_x86 = -mwatchos-simulator-version-min
osVersionMin.watchos_x86 = 5.0
runtimeDefinitions.watchos_x86 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS=1 KONAN_NO_64BIT_ATOMIC=1 \
KONAN_X86=1 KONAN_CORE_SYMBOLICATION=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
# watchOS x86_64 simulator.
targetToolchain.macos_x64-watchos_x64 = target-toolchain-xcode_12_2-macos_x64
dependencies.macos_x64-watchos_x64 = \
libffi-3.2.1-3-darwin-macos
target-sysroot-xcode_12_2-watchos_x64.default = \
remote:internal
arch.watchos_x64 = x86_64
targetSysRoot.watchos_x64 = target-sysroot-xcode_12_2-watchos_x86
targetCpu.watchos_x64 = core2
clangFlags.watchos_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir -target-cpu $targetCpu.watchos_x64
clangNooptFlags.watchos_x64 = -O1
clangOptFlags.watchos_x64 = -O3
clangDebugFlags.watchos_x64 = -O0
linkerKonanFlags.watchos_x64 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 7.0
linkerOptimizationFlags.watchos_x64 = -dead_strip
linkerNoDebugFlags.watchos_x64 = -S
linkerDynamicFlags.watchos_x64 = -dylib
osVersionMinFlagLd.watchos_x64 = -watchos_simulator_version_min
osVersionMinFlagClang.watchos_x64 = -mwatchos-simulator-version-min
osVersionMin.watchos_x64 = 7.0
runtimeDefinitions.watchos_x64 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS=1 \
KONAN_X64=1 KONAN_CORE_SYMBOLICATION=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
# Linux x86-64.
llvmHome.linux_x64 = $llvm.linux_x64.dev
libffiDir.linux_x64 = libffi-3.2.1-2-linux-x86-64
gccToolchain.linux_x64 = x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9
targetToolchain.linux_x64 = $gccToolchain.linux_x64/x86_64-unknown-linux-gnu
dependencies.linux_x64 = \
x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9 \
libffi-3.2.1-2-linux-x86-64 \
lldb-3-linux
targetToolchain.mingw_x64-linux_x64 = msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1
dependencies.mingw_x64-linux_x64 = \
libffi-3.2.1-mingw-w64-x86-64 \
x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9
targetToolchain.macos_x64-linux_x64 = $llvmHome.macos_x64
dependencies.macos_x64-linux_x64 = \
libffi-3.2.1-3-darwin-macos \
x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9
quadruple.linux_x64 = x86_64-unknown-linux-gnu
targetSysRoot.linux_x64 = $gccToolchain.linux_x64/x86_64-unknown-linux-gnu/sysroot
# targetSysroot-relative.
libGcc.linux_x64 = ../../lib/gcc/x86_64-unknown-linux-gnu/8.3.0
targetCpu.linux_x64 = x86-64
clangFlags.linux_x64 = -cc1 -target-cpu $targetCpu.linux_x64 -emit-obj -disable-llvm-optzns -x ir \
-ffunction-sections -fdata-sections
clangNooptFlags.linux_x64 = -O1
clangOptFlags.linux_x64 = -O3
clangDebugFlags.linux_x64 = -O0
dynamicLibraryRelocationMode.linux_x64 = pic
staticLibraryRelocationMode.linux_x64 = pic
linkerKonanFlags.linux_x64 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread \
--defsym __cxa_demangle=Konan_cxa_demangle --gc-sections
linkerOptimizationFlags.linux_x64 =
linkerNoDebugFlags.linux_x64 = -S
linkerDynamicFlags.linux_x64 = -shared
linker.linux_x64 = $targetToolchain.linux_x64/bin/ld.gold
linkerHostSpecificFlags.linux_x64-linux_x64 =
linker.mingw_x64-linux_x64 = $targetToolchain.mingw_x64-linux_x64/bin/ld.gold
linkerHostSpecificFlags.mingw_x64-linux_x64 =
linker.macos_x64-linux_x64 = $targetToolchain.macos_x64-linux_x64/bin/ld.lld
linkerHostSpecificFlags.macos_x64-linux_x64 = --no-threads
dynamicLinker.linux_x64 = /lib64/ld-linux-x86-64.so.2
# targetSysRoot relative
abiSpecificLibraries.linux_x64 = lib usr/lib ../lib64 lib64 usr/lib64
# targetSysRoot relative
crtFilesLocation.linux_x64 = usr/lib
runtimeDefinitions.linux_x64 = USE_GCC_UNWIND=1 KONAN_LINUX=1 KONAN_X64=1 \
USE_ELF_SYMBOLS=1 ELFSIZE=64 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
# Raspberry Pi
gccToolchain.linux_arm32_hfp = arm-unknown-linux-gnueabihf-gcc-8.3.0-glibc-2.19-kernel-4.9
targetToolchain.linux_x64-linux_arm32_hfp = $gccToolchain.linux_arm32_hfp/arm-unknown-linux-gnueabihf
targetToolchain.mingw_x64-linux_arm32_hfp = msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1
targetToolchain.macos_x64-linux_arm32_hfp = $llvmHome.macos_x64
# TODO: We might use docker on Windows or macOS.
emulatorDependency.linux_x64-linux_arm32_hfp = qemu-arm-static-5.1.0-linux-2
emulatorExecutable.linux_x64-linux_arm32_hfp = qemu-arm-static-5.1.0-linux-2/qemu-arm
dependencies.linux_x64-linux_arm32_hfp = \
arm-unknown-linux-gnueabihf-gcc-8.3.0-glibc-2.19-kernel-4.9 \
libffi-3.2.1-2-linux-x86-64
dependencies.mingw_x64-linux_arm32_hfp = \
arm-unknown-linux-gnueabihf-gcc-8.3.0-glibc-2.19-kernel-4.9 \
libffi-3.2.1-mingw-w64-x86-64
dependencies.macos_x64-linux_arm32_hfp = \
arm-unknown-linux-gnueabihf-gcc-8.3.0-glibc-2.19-kernel-4.9 \
libffi-3.2.1-3-darwin-macos
quadruple.linux_arm32_hfp = arm-unknown-linux-gnueabihf
linkerNoDebugFlags.linux_arm32_hfp = -S
linkerDynamicFlags.linux_arm32_hfp = -shared
linkerOptimizationFlags.linux_arm32_hfp = --gc-sections
targetSysRoot.linux_arm32_hfp = $gccToolchain.linux_arm32_hfp/arm-unknown-linux-gnueabihf/sysroot
# We could reuse host toolchain here.
linkerKonanFlags.linux_arm32_hfp = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread \
--defsym __cxa_demangle=Konan_cxa_demangle
# targetSysroot-relative.
libGcc.linux_arm32_hfp = ../../lib/gcc/arm-unknown-linux-gnueabihf/8.3.0
targetCpu.linux_arm32_hfp = arm1136jf-s
targetCpuFeatures.linux_arm32_hfp = +dsp,+strict-align,+vfp2,-crypto,-d16,-fp-armv8,-fp-only-sp,-fp16,-neon,-thumb-mode,-vfp3,-vfp4
clangFlags.linux_arm32_hfp = -cc1 -target-cpu $targetCpu.linux_arm32_hfp -mfloat-abi hard -emit-obj -disable-llvm-optzns -x ir
clangNooptFlags.linux_arm32_hfp = -O1
clangOptFlags.linux_arm32_hfp = -O3 -ffunction-sections
clangDebugFlags.linux_arm32_hfp = -O0
dynamicLibraryRelocationMode.linux_arm32_hfp = pic
staticLibraryRelocationMode.linux_arm32_hfp = pic
linker.linux_x64-linux_arm32_hfp = $targetToolchain.linux_x64-linux_arm32_hfp/bin/ld
linkerHostSpecificFlags.linux_x64-linux_arm32_hfp =
linker.mingw_x64-linux_arm32_hfp = $targetToolchain.mingw_x64-linux_arm32_hfp/bin/ld
linkerHostSpecificFlags.mingw_x64-linux_arm32_hfp =
linker.macos_x64-linux_arm32_hfp = $targetToolchain.macos_x64-linux_arm32_hfp/bin/ld.lld
linkerHostSpecificFlags.macos_x64-linux_arm32_hfp = --no-threads
dynamicLinker.linux_arm32_hfp = /lib/ld-linux-armhf.so.3
# targetSysRoot relative
abiSpecificLibraries.linux_arm32_hfp = lib usr/lib
# targetSysRoot relative
crtFilesLocation.linux_arm32_hfp = usr/lib
runtimeDefinitions.linux_arm32_hfp = USE_GCC_UNWIND=1 KONAN_LINUX=1 \
KONAN_ARM32=1 USE_ELF_SYMBOLS=1 ELFSIZE=32 KONAN_NO_UNALIGNED_ACCESS=1
# Linux arm64
gccToolchain.linux_arm64 = aarch64-unknown-linux-gnu-gcc-8.3.0-glibc-2.25-kernel-4.9
targetToolchain.linux_x64-linux_arm64 = $gccToolchain.linux_arm64/aarch64-unknown-linux-gnu
targetToolchain.mingw_x64-linux_arm64 = msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1
targetToolchain.macos_x64-linux_arm64 = $llvmHome.macos_x64
emulatorDependency.linux_x64-linux_arm64 = qemu-aarch64-static-5.1.0-linux-2
emulatorExecutable.linux_x64-linux_arm64 = qemu-aarch64-static-5.1.0-linux-2/qemu-aarch64
dependencies.linux_x64-linux_arm64 = \
aarch64-unknown-linux-gnu-gcc-8.3.0-glibc-2.25-kernel-4.9 \
libffi-3.2.1-2-linux-x86-64
dependencies.mingw_x64-linux_arm64 = \
aarch64-unknown-linux-gnu-gcc-8.3.0-glibc-2.25-kernel-4.9 \
libffi-3.2.1-mingw-w64-x86-64
dependencies.macos_x64-linux_arm64 = \
aarch64-unknown-linux-gnu-gcc-8.3.0-glibc-2.25-kernel-4.9 \
libffi-3.2.1-3-darwin-macos
quadruple.linux_arm64 = aarch64-unknown-linux-gnu
linkerNoDebugFlags.linux_arm64 = -S
linkerDynamicFlags.linux_arm64 = -shared
linkerOptimizationFlags.linux_arm64 = --gc-sections
targetSysRoot.linux_arm64 = $gccToolchain.linux_arm64/aarch64-unknown-linux-gnu/sysroot
# We could reuse host toolchain here.
linkerKonanFlags.linux_arm64 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread \
--defsym __cxa_demangle=Konan_cxa_demangle
# targetSysroot-relative.
libGcc.linux_arm64 = ../../lib/gcc/aarch64-unknown-linux-gnu/8.3.0
targetCpu.linux_arm64 = generic
clangFlags.linux_arm64 = -cc1 -target-cpu cortex-a57 -emit-obj -disable-llvm-optzns -x ir
clangNooptFlags.linux_arm64 = -O1
clangOptFlags.linux_arm64 = -O3 -ffunction-sections
clangDebugFlags.linux_arm64 = -O0
dynamicLibraryRelocationMode.linux_arm64 = pic
staticLibraryRelocationMode.linux_arm64 = pic
linker.linux_x64-linux_arm64 = $targetToolchain.linux_x64-linux_arm64/bin/ld.gold
linkerHostSpecificFlags.linux_x64-linux_arm64 =
linker.mingw_x64-linux_arm64 = $targetToolchain.mingw_x64-linux_arm64/bin/ld.gold
linkerHostSpecificFlags.mingw_x64-linux_arm64 =
linker.macos_x64-linux_arm64 = $targetToolchain.macos_x64-linux_arm64/bin/ld.lld
linkerHostSpecificFlags.macos_x64-linux_arm64 = --no-threads
dynamicLinker.linux_arm64 = /lib/ld-linux-aarch64.so.1
# targetSysRoot relative
abiSpecificLibraries.linux_arm64 = lib usr/lib
# targetSysRoot relative
crtFilesLocation.linux_arm64 = usr/lib
runtimeDefinitions.linux_arm64 = USE_GCC_UNWIND=1 KONAN_LINUX=1 KONAN_ARM64=1 \
USE_ELF_SYMBOLS=1 ELFSIZE=64
# MIPS
gccToolchain.linux_mips32 = mips-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9
targetToolchain.linux_x64-linux_mips32 = $gccToolchain.linux_mips32/mips-unknown-linux-gnu
emulatorDependency.linux_x64-linux_mips32 = qemu-mips-static-5.1.0-linux-2
emulatorExecutable.linux_x64-linux_mips32 = qemu-mips-static-5.1.0-linux-2/qemu-mips
dependencies.linux_x64-linux_mips32 = \
mips-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9 \
libffi-3.2.1-2-linux-x86-64
quadruple.linux_mips32 = mips-unknown-linux-gnu
linkerOptimizationFlags.linux_mips32 = --gc-sections
linkerDynamicFlags.linux_mips32 = -shared
targetSysRoot.linux_mips32 = $gccToolchain.linux_mips32/mips-unknown-linux-gnu/sysroot
# We could reuse host toolchain here.
linkerKonanFlags.linux_mips32 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread \
--defsym __cxa_demangle=Konan_cxa_demangle -z notext
# targetSysroot-relative.
libGcc.linux_mips32 = ../../lib/gcc/mips-unknown-linux-gnu/8.3.0
targetCpu.linux_mips32 = mips32r2
clangFlags.linux_mips32 = -cc1 -emit-obj -disable-llvm-optzns -x ir -target-cpu $targetCpu.linux_mips32
clangNooptFlags.linux_mips32 = -O1
clangOptFlags.linux_mips32 = -O3 -ffunction-sections
clangDebugFlags.linux_mips32 = -O0
dynamicLibraryRelocationMode.linux_mips32 = pic
staticLibraryRelocationMode.linux_mips32 = pic
executableRelocationMode.linux_mips32 = static
linker.linux_x64-linux_mips32 = $targetToolchain.linux_x64-linux_mips32/bin/ld
linkerHostSpecificFlags.linux_x64-linux_mips32 =
dynamicLinker.linux_mips32 = /lib/ld.so.1
# targetSysRoot relative
abiSpecificLibraries.linux_mips32 = lib usr/lib
# targetSysRoot relative
crtFilesLocation.linux_mips32 = usr/lib
# TODO: reconsider KONAN_NO_64BIT_ATOMIC, once target MIPS can do proper 64-bit load/store/CAS.
runtimeDefinitions.linux_mips32 = USE_GCC_UNWIND=1 KONAN_LINUX=1 KONAN_MIPS32=1 \
USE_ELF_SYMBOLS=1 ELFSIZE=32 KONAN_NO_64BIT_ATOMIC=1 KONAN_NO_UNALIGNED_ACCESS=1
# MIPSel
gccToolchain.linux_mipsel32 = mipsel-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9
targetToolchain.linux_x64-linux_mipsel32 = $gccToolchain.linux_mipsel32/mipsel-unknown-linux-gnu
emulatorDependency.linux_x64-linux_mipsel32 = qemu-mipsel-static-5.1.0-linux-2
emulatorExecutable.linux_x64-linux_mipsel32 = qemu-mipsel-static-5.1.0-linux-2/qemu-mipsel
dependencies.linux_x64-linux_mipsel32 = \
mipsel-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9 \
libffi-3.2.1-2-linux-x86-64
quadruple.linux_mipsel32 = mipsel-unknown-linux-gnu
linkerOptimizationFlags.linux_mipsel32 = --gc-sections
linkerDynamicFlags.linux_mipsel32 = -shared
targetSysRoot.linux_mipsel32 = $gccToolchain.linux_mipsel32/mipsel-unknown-linux-gnu/sysroot
# We could reuse host toolchain here.
linkerKonanFlags.linux_mipsel32 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread \
--defsym __cxa_demangle=Konan_cxa_demangle -z notext
# targetSysroot-relative.
libGcc.linux_mipsel32 = ../../lib/gcc/mipsel-unknown-linux-gnu/8.3.0
targetCpu.linux_mipsel32 = mips32r2
clangFlags.linux_mipsel32 = -cc1 -emit-obj -disable-llvm-optzns -x ir -target-cpu $targetCpu.linux_mipsel32
clangNooptFlags.linux_mipsel32 = -O1
clangOptFlags.linux_mipsel32 = -O3 -ffunction-sections
clangDebugFlags.linux_mipsel32 = -O0
dynamicLibraryRelocationMode.linux_mipsel32 = pic
staticLibraryRelocationMode.linux_mipsel32 = pic
linker.linux_x64-linux_mipsel32 = $targetToolchain.linux_x64-linux_mipsel32/bin/ld
linkerHostSpecificFlags.linux_x64-linux_mipsel32 =
dynamicLinker.linux_mipsel32 = /lib/ld.so.1
# targetSysRoot relative
abiSpecificLibraries.linux_mipsel32 = lib usr/lib
# targetSysRoot relative
crtFilesLocation.linux_mipsel32 = usr/lib
# TODO: reconsider KONAN_NO_64BIT_ATOMIC, once target MIPS can do proper 64-bit load/store/CAS.
runtimeDefinitions.linux_mipsel32 = USE_GCC_UNWIND=1 KONAN_LINUX=1 \
KONAN_MIPSEL32=1 USE_ELF_SYMBOLS=1 ELFSIZE=32 KONAN_NO_64BIT_ATOMIC=1 KONAN_NO_UNALIGNED_ACCESS=1
# Android ARM32, based on NDK for android-21.
targetToolchain.macos_x64-android_arm32 = target-toolchain-2-osx-android_ndk
dependencies.macos_x64-android_arm32 = \
target-sysroot-1-android_ndk \
target-toolchain-2-osx-android_ndk \
libffi-3.2.1-3-darwin-macos
targetToolchain.linux_x64-android_arm32 = target-toolchain-2-linux-android_ndk
dependencies.linux_x64-android_arm32 = \
target-sysroot-1-android_ndk \
target-toolchain-2-linux-android_ndk \
libffi-3.2.1-2-linux-x86-64
targetToolchain.mingw_x64-android_arm32 = target-toolchain-2-windows-android_ndk
dependencies.mingw_x64-android_arm32 = \
target-sysroot-1-android_ndk \
target-toolchain-2-windows-android_ndk \
libffi-3.2.1-mingw-w64-x86-64
quadruple.android_arm32 = arm-linux-androideabi
targetCpu.android_arm32 = arm7tdmi
targetCpuFeatures.android_arm32 = +soft-float,+strict-align,-crypto,-neon,-thumb-mode
clangFlags.android_arm32 = -cc1 -target-cpu $targetCpu.android_arm32 -emit-obj -disable-llvm-optzns -x ir -femulated-tls -mrelocation-model pic
clangOptFlags.android_arm32 = -O3 -ffunction-sections
linkerNoDebugFlags.android_arm32 = -Wl,-S
clangNooptFlags.android_arm32 = -O1
targetSysRoot.android_arm32 = target-sysroot-1-android_ndk
linkerKonanFlags.android_arm32 = -lm -lc++_static -lc++abi -landroid -llog -latomic
runtimeDefinitions.android_arm32 = __ANDROID__ USE_GCC_UNWIND=1 USE_ELF_SYMBOLS=1 ELFSIZE=32 \
KONAN_ANDROID=1 KONAN_ARM32=1 KONAN_NO_UNALIGNED_ACCESS=1
# Android ARM64, based on NDK.
targetToolchain.macos_x64-android_arm64 = target-toolchain-2-osx-android_ndk
dependencies.macos_x64-android_arm64 = \
target-sysroot-1-android_ndk \
target-toolchain-2-osx-android_ndk \
libffi-3.2.1-3-darwin-macos
targetToolchain.linux_x64-android_arm64 = target-toolchain-2-linux-android_ndk
dependencies.linux_x64-android_arm64 = \
target-sysroot-1-android_ndk \
target-toolchain-2-linux-android_ndk \
libffi-3.2.1-2-linux-x86-64
targetToolchain.mingw_x64-android_arm64 = target-toolchain-2-windows-android_ndk
dependencies.mingw_x64-android_arm64 = \
target-sysroot-1-android_ndk \
target-toolchain-2-windows-android_ndk \
libffi-3.2.1-mingw-w64-x86-64
quadruple.android_arm64 = aarch64-linux-android
targetCpu.android_arm64 = cortex-a57
clangFlags.android_arm64 = -cc1 -target-cpu $targetCpu.android_arm64 -emit-obj -disable-llvm-passes -x ir -femulated-tls -mrelocation-model pic
clangOptFlags.android_arm64 = -O3 -ffunction-sections
clangNooptFlags.android_arm64 = -O1
targetSysRoot.android_arm64 = target-sysroot-1-android_ndk
linkerKonanFlags.android_arm64 = -lm -lc++_static -lc++abi -landroid -llog -latomic
linkerNoDebugFlags.android_arm64 = -Wl,-S
runtimeDefinitions.android_arm64 = __ANDROID__ USE_GCC_UNWIND=1 USE_ELF_SYMBOLS=1 \
ELFSIZE=64 KONAN_ANDROID=1 KONAN_ARM64=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
# Android X86, based on NDK.
targetToolchain.macos_x64-android_x86 = target-toolchain-2-osx-android_ndk
dependencies.macos_x64-android_x86 = \
target-sysroot-1-android_ndk \
target-toolchain-2-osx-android_ndk \
libffi-3.2.1-3-darwin-macos
targetToolchain.linux_x64-android_x86 = target-toolchain-2-linux-android_ndk
dependencies.linux_x64-android_x86 = \
target-sysroot-1-android_ndk \
target-toolchain-2-linux-android_ndk \
libffi-3.2.1-2-linux-x86-64
targetToolchain.mingw_x64-android_x86 = target-toolchain-2-windows-android_ndk
dependencies.mingw_x64-android_x86 = \
target-sysroot-1-android_ndk \
target-toolchain-2-windows-android_ndk \
libffi-3.2.1-mingw-w64-x86-64
quadruple.android_x86 = i686-linux-android
# -target-cpu pentium4 makes sure that cogenerator knows which CPU flavour to emit code for.
# Can be seen on optimized build and FP tests, where value is passed on stack
# by Kotlin and taken from SSE registers by C code.
# TODO: once this information is available in function attributes, we can set target CPU to i686.
targetCpu.android_x86 = pentium4
clangFlags.android_x86 = -cc1 -target-cpu $targetCpu.android_x86 -emit-obj -disable-llvm-passes -x ir -femulated-tls -mrelocation-model pic
clangOptFlags.android_x86 = -O3 -ffunction-sections
clangNooptFlags.android_x86 = -O1
targetSysRoot.android_x86 = target-sysroot-1-android_ndk
linkerKonanFlags.android_x86 = -lm -lc++_static -lc++abi -landroid -llog -latomic
linkerNoDebugFlags.android_x86 = -Wl,-S
runtimeDefinitions.android_x86 = __ANDROID__ USE_GCC_UNWIND=1 USE_ELF_SYMBOLS=1 \
ELFSIZE=32 KONAN_ANDROID=1 KONAN_X86=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
# Android X64, based on NDK.
targetToolchain.macos_x64-android_x64 = target-toolchain-2-osx-android_ndk
dependencies.macos_x64-android_x64 = \
target-sysroot-1-android_ndk \
target-toolchain-2-osx-android_ndk \
libffi-3.2.1-3-darwin-macos
targetToolchain.linux_x64-android_x64 = target-toolchain-2-linux-android_ndk
dependencies.linux_x64-android_x64 = \
target-sysroot-1-android_ndk \
target-toolchain-2-linux-android_ndk \
libffi-3.2.1-2-linux-x86-64
targetToolchain.mingw_x64-android_x64 = target-toolchain-2-windows-android_ndk
dependencies.mingw_x64-android_x64 = \
target-sysroot-1-android_ndk \
target-toolchain-2-windows-android_ndk \
libffi-3.2.1-mingw-w64-x86-64
quadruple.android_x64 = x86_64-linux-android
targetCpu.android_x64 = x86-64
clangFlags.android_x64 = -cc1 -target-cpu $targetCpu.android_x64 -emit-obj -disable-llvm-passes -x ir -femulated-tls -mrelocation-model pic
clangOptFlags.android_x64 = -O3 -ffunction-sections
clangNooptFlags.android_x64 = -O1
targetSysRoot.android_x64 = target-sysroot-1-android_ndk
linkerKonanFlags.android_x64 = -lm -lc++_static -lc++abi -landroid -llog -latomic
linkerNoDebugFlags.android_x64 = -Wl,-S
runtimeDefinitions.android_x64 = __ANDROID__ USE_GCC_UNWIND=1 USE_ELF_SYMBOLS=1 \
ELFSIZE=64 KONAN_ANDROID=1 KONAN_X64=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
# Windows x86-64, based on mingw-w64.
llvmHome.mingw_x64 = $llvm.mingw_x64.dev
targetToolchain.mingw_x64 = msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1
libffiDir.mingw_x64 = libffi-3.2.1-mingw-w64-x86-64
targetToolchain.linux_x64-mingw_x64 = msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1
targetToolchain.macos_x64-mingw_x64 = msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1
# for Windows we are currently using LLDB 9
dependencies.mingw_x64 = \
libffi-3.2.1-mingw-w64-x86-64 \
lldb-2-windows
dependencies.linux_x64-mingw_x64 = \
libffi-3.2.1-2-linux-x86-64
dependencies.macos_x64-mingw_x64 = \
libffi-3.2.1-3-darwin-macos
quadruple.mingw_x64 = x86_64-w64-mingw32
targetSysRoot.mingw_x64 = msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1
targetCpu.mingw_x64 = x86-64
# For using with Universal Windows Platform (UWP) we need to use this slower option.
# See https://youtrack.jetbrains.com/issue/KT-27654.
# TODO: remove, once fixed in mingw, check with the bug testcase.
clangFlags.mingw_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir -femulated-tls -target-cpu $targetCpu.mingw_x64
clangOptFlags.mingw_x64 = -O3 -ffunction-sections
clangNooptFlags.mingw_x64 = -O1
linkerNoDebugFlags.mingw_x64 = -Wl,-S
linkerDynamicFlags.mingw_x64 = -shared
linkerKonanFlags.mingw_x64 =-static-libgcc -static-libstdc++ \
-Wl,--dynamicbase \
-Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive,-Bdynamic \
-Wl,--defsym,__cxa_demangle=Konan_cxa_demangle
linkerOptimizationFlags.mingw_x64 = -Wl,--gc-sections
mimallocLinkerDependencies.mingw_x64 = -lbcrypt
runtimeDefinitions.mingw_x64 = USE_GCC_UNWIND=1 USE_PE_COFF_SYMBOLS=1 KONAN_WINDOWS=1 \
UNICODE KONAN_X64=1 KONAN_NO_MEMMEM=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
# Windows i686, based on mingw-w64.
targetToolchain.mingw_x64-mingw_x86 = msys2-mingw-w64-i686-clang-llvm-lld-compiler_rt-8.0.1
dependencies.mingw_x64-mingw_x86 = \
msys2-mingw-w64-i686-clang-llvm-lld-compiler_rt-8.0.1 \
libffi-3.2.1-mingw-w64-x86-64
targetToolchain.linux_x64-mingw_x86 = msys2-mingw-w64-i686-clang-llvm-lld-compiler_rt-8.0.1
targetToolchain.macos_x64-mingw_x86 = msys2-mingw-w64-i686-clang-llvm-lld-compiler_rt-8.0.1
dependencies.linux_x64-mingw_x86 = \
msys2-mingw-w64-i686-clang-llvm-lld-compiler_rt-8.0.1 \
libffi-3.2.1-2-linux-x86-64
dependencies.macos_x64-mingw_x86 = \
msys2-mingw-w64-i686-clang-llvm-lld-compiler_rt-8.0.1 \
libffi-3.2.1-3-darwin-macos
quadruple.mingw_x86 = i686-w64-mingw32
targetSysRoot.mingw_x86 = msys2-mingw-w64-i686-clang-llvm-lld-compiler_rt-8.0.1
# For using with Universal Windows Platform (UWP) we need to use slower -emulated-tls option.
# See https://youtrack.jetbrains.com/issue/KT-27654.
# TODO: remove, once fixed in mingw, check with the bug testcase.
# -target-cpu pentium4 makes sure that code-generator knows which CPU flavour to emit code for.
# Can be seen on optimized build and FP tests, where value is passed in coprocessor registers
# by Kotlin and taken from SSE registers by C code.
# TODO: once this information is available in function attributes, we can remove this flag.
targetCpu.mingw_x86 = pentium4
clangFlags.mingw_x86 = -cc1 -emit-obj -disable-llvm-passes -x ir -femulated-tls -target-cpu $targetCpu.mingw_x86
clangOptFlags.mingw_x86 = -O3 -ffunction-sections
clangNooptFlags.mingw_x86 = -O1
linkerNoDebugFlags.mingw_x86 = -Wl,-S
linkerDynamicFlags.mingw_x86 = -shared
linkerKonanFlags.mingw_x86 = -static-libgcc -static-libstdc++ \
-Wl,--dynamicbase \
-Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive,-Bdynamic \
-Wl,--defsym,___cxa_demangle=_Konan_cxa_demangle
mimallocLinkerDependencies.mingw_x86 = -lbcrypt
linkerOptimizationFlags.mingw_x86 = -Wl,--gc-sections
runtimeDefinitions.mingw_x86 = USE_GCC_UNWIND=1 USE_PE_COFF_SYMBOLS=1 KONAN_WINDOWS=1 \
UNICODE KONAN_X86=1 KONAN_NO_MEMMEM=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
# WebAssembly 32-bit.
targetToolchain.macos_x64-wasm32 = target-toolchain-3-macos-wasm
dependencies.macos_x64-wasm32 = \
libffi-3.2.1-3-darwin-macos \
target-sysroot-4-embedded \
target-toolchain-3-macos-wasm
targetToolchain.linux_x64-wasm32 = target-toolchain-2-linux-wasm
dependencies.linux_x64-wasm32 = \
libffi-3.2.1-2-linux-x86-64 \
target-sysroot-4-embedded \
target-toolchain-2-linux-wasm
targetToolchain.mingw_x64-wasm32 = target-toolchain-2-mingw-wasm
dependencies.mingw_x64-wasm32 = \
libffi-3.2.1-mingw-w64-x86-64 \
target-sysroot-4-embedded \
target-toolchain-2-mingw-wasm
quadruple.wasm32 = wasm32-unknown-unknown
targetSysRoot.wasm32 = target-sysroot-4-embedded
targetCpu.wasm32 = generic
clangFlags.wasm32 = -cc1 -emit-obj -disable-llvm-optzns -x ir
clangNooptFlags.wasm32 = -O1
clangOptFlags.wasm32 = -O3
clangDebugFlags.wasm32 = -O0
# TODO: make explicit list of external symbols
lld.wasm32 = --allow-undefined --no-entry --global-base=0 --no-threads --export-dynamic
runtimeDefinitions.wasm32 = KONAN_WASM=1 KONAN_NO_FFI=1 KONAN_NO_THREADS=1 \
KONAN_NO_EXCEPTIONS=1 KONAN_INTERNAL_DLMALLOC=1 KONAN_INTERNAL_SNPRINTF=1 \
KONAN_INTERNAL_NOW=1 KONAN_NO_MEMMEM KONAN_NO_CTORS_SECTION=1
# The version of Kotlin/Native compiler
compilerVersion=1.5-dev