summaryrefslogtreecommitdiff
blob: 24d2884674339f4a3eb4b4ebf1b764a697e2d9e8 (plain)
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
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
Fully conditionalise arm support so it can be disabled on 10.4.

diff -ur ld64-241.9/src/abstraction/MachOFileAbstraction.hpp ld64-241.9/src/abstraction/MachOFileAbstraction.hpp
--- ld64-241.9/src/abstraction/MachOFileAbstraction.hpp	2014-11-04 00:30:51.000000000 +0100
+++ ld64-241.9/src/abstraction/MachOFileAbstraction.hpp	2015-01-22 05:53:13.000000000 +0100
diff -ur ld64-241.9/src/ld/HeaderAndLoadCommands.hpp ld64-241.9/src/ld/HeaderAndLoadCommands.hpp
--- ld64-241.9/src/ld/HeaderAndLoadCommands.hpp	2014-09-11 00:24:46.000000000 +0200
+++ ld64-241.9/src/ld/HeaderAndLoadCommands.hpp	2015-01-22 06:46:10.000000000 +0100
@@ -607,8 +607,12 @@
 
 template <> uint32_t HeaderAndLoadCommandsAtom<x86>::cpuType() const	{ return CPU_TYPE_I386; }
 template <> uint32_t HeaderAndLoadCommandsAtom<x86_64>::cpuType() const	{ return CPU_TYPE_X86_64; }
+#if SUPPORT_ARCH_arm_any
 template <> uint32_t HeaderAndLoadCommandsAtom<arm>::cpuType() const	{ return CPU_TYPE_ARM; }
+#endif
+#if SUPPORT_ARCH_arm64
 template <> uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuType() const	{ return CPU_TYPE_ARM64; }
+#endif
 
 
 
@@ -627,17 +631,21 @@
 		return _state.cpuSubType;
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 uint32_t HeaderAndLoadCommandsAtom<arm>::cpuSubType() const
 {
 	return _state.cpuSubType;
 }
+#endif
 
+#if SUPPORT_ARCH_arm64
 template <>
 uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuSubType() const
 {
 	return CPU_SUBTYPE_ARM64_ALL;
 }
+#endif
 
 
 
diff -ur ld64-241.9/src/ld/LinkEdit.hpp ld64-241.9/src/ld/LinkEdit.hpp
--- ld64-241.9/src/ld/LinkEdit.hpp	2015-01-22 20:59:47.000000000 +0100
+++ ld64-241.9/src/ld/LinkEdit.hpp	2015-01-22 05:32:47.000000000 +0100
@@ -1595,6 +1595,7 @@
 				for (ld::Fixup::iterator fit = atom->fixupsBegin(); fit != atom->fixupsEnd(); ++fit) {
 					if ( fit->kind != ld::Fixup::kindLinkerOptimizationHint) 
 						continue;
+#if SUPPORT_ARCH_arm64
 					ld::Fixup::LOH_arm64 extra;
 					extra.addend = fit->u.addend;
 					_encodedData.append_uleb128(extra.info.kind);
@@ -1606,6 +1607,7 @@
 						_encodedData.append_uleb128((extra.info.delta3 << 2) + fit->offsetInAtom + address);
 					if ( extra.info.count > 2 )
 						_encodedData.append_uleb128((extra.info.delta4 << 2) + fit->offsetInAtom + address);
+#endif
 				}
 			}
 		}
diff -ur ld64-241.9/src/ld/Options.cpp ld64-241.9/src/ld/Options.cpp
--- ld64-241.9/src/ld/Options.cpp	2015-01-22 20:59:48.000000000 +0100
+++ ld64-241.9/src/ld/Options.cpp	2015-01-22 20:52:17.000000000 +0100
@@ -580,8 +580,13 @@
 				#endif		
 					}
 					break;
+#if SUPPORT_ARCH_arm_any
 				case CPU_TYPE_ARM:
+#endif
+#if SUPPORT_ARCH_arm64
 				case CPU_TYPE_ARM64:
+#endif
+#if SUPPORT_ARCH_arm_any || SUPPORT_ARCH_arm64
 					if ( (fMacVersionMin == ld::macVersionUnset) && (fIOSVersionMin == ld::iOSVersionUnset) && (fOutputKind != Options::kObjectFile) ) {
 				#if defined(DEFAULT_IPHONEOS_MIN_VERSION)
 						warning("-ios_version_min not specified, assuming " DEFAULT_IPHONEOS_MIN_VERSION);
@@ -592,6 +597,7 @@
 				#endif
 					}
 					break;
+#endif
 			}
 #ifdef SUPPORT_SNAPSHOTS
 			fLinkSnapshot.recordArch(fArchitectureName);
@@ -1683,9 +1689,11 @@
 						symbolStart = NULL;
 				}
 				else if ( strncmp(symbolStart, "arm:", 4) == 0 ) {
+#if SUPPORT_ARCH_arm_any
 					if ( fArchitecture == CPU_TYPE_ARM )
 						symbolStart = &symbolStart[4];
 					else
+#endif
 						symbolStart = NULL;
 				}
 				if ( symbolStart != NULL ) {
@@ -3668,6 +3676,7 @@
 			#endif		
 					}
 					break;
+#if SUPPORT_ARCH_arm_any
 				case CPU_TYPE_ARM:
 					if ( (fOutputKind != Options::kObjectFile) && (fOutputKind != Options::kPreload) ) {
 			#if defined(DEFAULT_IPHONEOS_MIN_VERSION)
@@ -3679,6 +3688,7 @@
 			#endif
 					}
 					break;
+#endif
 				default:
 					// architecture will be infered later by examining .o files
 					break;
@@ -3701,12 +3711,14 @@
 				fMacVersionMin = ld::mac10_4;
 			}
 			break;
+#if SUPPORT_ARCH_arm64
 		case CPU_TYPE_ARM64:
 			if ( fIOSVersionMin < ld::iOS_7_0 ) {
 				//warning("-mios_version_min should be 7.0 or later for arm64");
 				fIOSVersionMin = ld::iOS_7_0;
 			}
 			break;
+#endif
 	}
 	
 	// default to adding functions start for dynamic code, static code must opt-in
@@ -3746,6 +3758,7 @@
 				fAllowTextRelocs = true;
 				fUndefinedTreatment = kUndefinedDynamicLookup;
 				break;
+#if SUPPORT_ARCH_arm64
 			case CPU_TYPE_ARM64:
 				// arm64 uses new MH_KEXT_BUNDLE type
 				fMakeCompressedDyldInfo = false;
@@ -3754,6 +3767,8 @@
 				fKextsUseStubs = true;
 				fUndefinedTreatment = kUndefinedDynamicLookup;
 				break;
+#endif
+#if SUPPORT_ARCH_arm_any
 			case CPU_TYPE_ARM:
 				if ( fIOSVersionMin >= ld::iOS_5_0 ) {
                     // iOS 5.0 and later use new MH_KEXT_BUNDLE type
@@ -3765,6 +3780,7 @@
                     fUndefinedTreatment = kUndefinedDynamicLookup;
 					break;
 				}
+#endif
 				// else use object file
 			case CPU_TYPE_I386:
 				// use .o files
@@ -3817,6 +3833,7 @@
                 if ( fSplitSegs && (fBaseWritableAddress-fBaseAddress != 0x10000000) )
                     fBaseWritableAddress = fBaseAddress + 0x10000000;
                 break;
+#if SUPPORT_ARCH_arm_any
             case CPU_TYPE_ARM:
                 if ( fOutputKind != Options::kDynamicLibrary ) {
                     fSplitSegs = false;
@@ -3827,6 +3844,7 @@
 						fBaseWritableAddress = fBaseAddress + 0x08000000;
 				}
                 break;
+#endif
             default:
                 fSplitSegs = false;
                 fBaseAddress = 0;
@@ -3841,6 +3859,7 @@
 			break;
 		case CPU_TYPE_X86_64:
 			break;
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
 			switch ( fOutputKind ) {
 				case Options::kDynamicExecutable:
@@ -3863,6 +3882,7 @@
 				fBaseAddress = 0;
 			}
 			break;
+#endif
 	}
 
 	// <rdar://problem/6138961> -r implies no prebinding for all architectures
@@ -3908,6 +3928,7 @@
 			case CPU_TYPE_X86_64:
 				fPrebind = false;
 				break;
+#if SUPPORT_ARCH_arm_any
             case CPU_TYPE_ARM:
 				switch ( fOutputKind ) {
 					case Options::kDynamicExecutable:
@@ -3925,6 +3946,7 @@
 						break;
 				}
 				break;
+#endif
 		}
 	}
 
@@ -3951,10 +3973,12 @@
 			case CPU_TYPE_I386:
 				if ( fIOSVersionMin != ld::iOSVersionUnset ) // simulator never needs modules
 					break;
+#if SUPPORT_ARCH_arm_any
 			case CPU_TYPE_ARM:
 				if ( fPrebind )
 					fNeedsModuleTable = true; // redo_prebinding requires a module table
 				break;
+#endif
 		}
 	}
 	
@@ -3993,7 +3993,9 @@
 	switch ( fArchitecture ) {
 		case CPU_TYPE_I386:		
 		case CPU_TYPE_X86_64:		
+#if SUPPORT_ARCH_arm64
 		case CPU_TYPE_ARM64:		
+#endif
 			switch ( fOutputKind ) {
 				case Options::kObjectFile:
 				case Options::kStaticExecutable:
@@ -4010,10 +4012,12 @@
 					break;
 			}
 			break;
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
 			fAddCompactUnwindEncoding = false;
 			fRemoveDwarfUnwindIfCompactExists = false;
 			break;
+#endif
 		case 0:
 			// if -arch is missing, assume we don't want compact unwind info
 			fAddCompactUnwindEncoding = false;
@@ -4015,7 +4043,15 @@
 				fEncryptable = false;
 			break;
 	}
-	if ( (fArchitecture != CPU_TYPE_ARM) && (fArchitecture != CPU_TYPE_ARM64) )
+	if (
+#if SUPPORT_ARCH_arm_any
+		(fArchitecture != CPU_TYPE_ARM) &&
+#endif
+#if SUPPORT_ARCH_arm64
+		(fArchitecture != CPU_TYPE_ARM64) &&
+#endif
+		1
+		)
 		fEncryptable = false;
 
 	// don't move inits in dyld because dyld wants certain
@@ -4067,11 +4103,15 @@
 
 	// only ARM and x86_64 enforces that cpu-sub-types must match
 	switch ( fArchitecture ) {
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
+#endif
 		case CPU_TYPE_X86_64:
 			break;
 		case CPU_TYPE_I386:
+#if SUPPORT_ARCH_arm64
 		case CPU_TYPE_ARM64:
+#endif
 			fAllowCpuSubtypeMismatches = true;
 			break;
 	}
@@ -4117,6 +4157,7 @@
 			fPositionIndependentExecutable = true;
 	}
 
+#if SUPPORT_ARCH_arm_any
 	// armv7 for iOS4.3 defaults to PIE
 	if ( (fArchitecture == CPU_TYPE_ARM) 
 		&& fArchSupportsThumb2
@@ -4124,6 +4165,7 @@
 		&& (fIOSVersionMin >= ld::iOS_4_3) ) {
 			fPositionIndependentExecutable = true;
 	}
+#endif
 
 	// Simulator defaults to PIE
 	if ( fTargetIOSSimulator && (fOutputKind == kDynamicExecutable) )
@@ -4133,10 +4175,12 @@
 	if ( fDisablePositionIndependentExecutable )
 		fPositionIndependentExecutable = false;
 
+#if SUPPORT_ARCH_arm64
 	// arm64 is always PIE
 	if ( (fArchitecture == CPU_TYPE_ARM64) && (fOutputKind == kDynamicExecutable) ) {
 		fPositionIndependentExecutable = true;
 	}
+#endif
 
 	// set fOutputSlidable
 	switch ( fOutputKind ) {
@@ -4162,9 +4206,11 @@
 	if ( fMacVersionMin >= ld::mac10_7 ) {
 		fTLVSupport = true;
 	}
+#if SUPPORT_ARCH_arm64
 	else if ( (fArchitecture == CPU_TYPE_ARM64) && (fIOSVersionMin >= ld::iOS_8_0) ) {
 		fTLVSupport = true;
 	}
+#endif
 
 	// default to adding version load command for dynamic code, static code must opt-in
 	switch ( fOutputKind ) {
@@ -4369,9 +4415,15 @@
 	// <rdar://problem/12258065> ARM64 needs 16KB page size for user land code
 	// <rdar://problem/15974532> make armv7[s] use 16KB pages in user land code for iOS 8 or later
 	if ( fSegmentAlignment == 4096 ) {
-		if ( (fArchitecture == CPU_TYPE_ARM64) 
-		|| ((fArchitecture == CPU_TYPE_ARM) && (fIOSVersionMin >= ld::iOS_8_0) && 
-			((fSubArchitecture == CPU_SUBTYPE_ARM_V7S) || (fSubArchitecture == CPU_SUBTYPE_ARM_V7))) ) {
+		if (
+#if SUPPORT_ARCH_arm64
+			(fArchitecture == CPU_TYPE_ARM64) ||
+#endif
+#if SUPPORT_ARCH_arm_any
+			((fArchitecture == CPU_TYPE_ARM) && (fIOSVersionMin >= ld::iOS_8_0) && 
+				((fSubArchitecture == CPU_SUBTYPE_ARM_V7S) || (fSubArchitecture == CPU_SUBTYPE_ARM_V7))) ||
+#endif
+			0) {
 			switch ( fOutputKind ) {
 				case Options::kDynamicExecutable:
 				case Options::kDynamicLibrary:
@@ -4488,12 +4540,16 @@
 	if ( fStackAddr != 0 ) {
 		switch (fArchitecture) {
 			case CPU_TYPE_I386:
+#if SUPPORT_ARCH_arm_any
             case CPU_TYPE_ARM:
+#endif
 				if ( fStackAddr > 0xFFFFFFFFULL )
 					throw "-stack_addr must be < 4G for 32-bit processes";
 				break;
 			case CPU_TYPE_X86_64:
+#if SUPPORT_ARCH_arm64
 			case CPU_TYPE_ARM64:
+#endif
 				break;
 		}
 		if ( (fStackAddr & -4096) != fStackAddr )
@@ -4514,6 +4570,7 @@
 				if ( (fStackAddr > 0xB0000000ULL) && ((fStackAddr-fStackSize) < 0xB0000000ULL)  )
 					warning("custom stack placement overlaps and will disable shared region");
 				break;
+#if SUPPORT_ARCH_arm_any
             case CPU_TYPE_ARM:
 				if ( fStackSize > 0x2F000000 )
 					throw "-stack_size must be < 752MB";
@@ -4522,11 +4579,13 @@
                 if ( fStackAddr > 0x30000000ULL)
                     throw "-stack_addr must be < 0x30000000 for arm";
 				break;
+#endif
 			case CPU_TYPE_X86_64:
 				if ( fStackAddr == 0 ) {
 					fStackAddr = 0x00007FFF5C000000ULL;
 				}
 				break;
+#if SUPPORT_ARCH_arm64
 			case CPU_TYPE_ARM64:
 				if ( fStackSize > 0x20000000 )
 					throw "-stack_size must be < 512MB";
@@ -4534,6 +4593,7 @@
 					fStackAddr = 0x120000000ULL;
 				}
 				break;
+#endif
 		}
 		if ( (fStackSize & -4096) != fStackSize )
 			throw "-stack_size must be multiples of 4K";
@@ -4643,8 +4703,12 @@
 				alterObjC1ClassNamesToObjC2 = true;
 			break;
 		case CPU_TYPE_X86_64:
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
+#endif
+#if SUPPORT_ARCH_arm64
 		case CPU_TYPE_ARM64:
+#endif
 			alterObjC1ClassNamesToObjC2 = true;
 			break;
 	}
@@ -4799,11 +4799,15 @@
 		// zero page size not specified on command line, set default
 		switch (fArchitecture) {
 			case CPU_TYPE_I386:
+#if SUPPORT_ARCH_arm_any
             case CPU_TYPE_ARM:
+#endif
 				// first 4KB for 32-bit architectures
 				fZeroPageSize = 0x1000;
 				break;
+#if SUPPORT_ARCH_arm64
 			case CPU_TYPE_ARM64:
+#endif
 			case CPU_TYPE_X86_64:
 				// first 4GB for x86_64 on all OS's
 				fZeroPageSize = 0x100000000ULL;
@@ -4842,9 +4910,11 @@
 	
 	// -force_cpusubtype_ALL is not supported for ARM
 	if ( fForceSubtypeAll ) {
+#if SUPPORT_ARCH_arm_any
 		if ( fArchitecture == CPU_TYPE_ARM ) {
 			warning("-force_cpusubtype_ALL will become unsupported for ARM architectures");
 		}
+#endif
 	}
 	
 	// -reexported_symbols_list can only be used with -dynamiclib
diff -ur ld64-241.9/src/ld/OutputFile.cpp ld64-241.9/src/ld/OutputFile.cpp
--- ld64-241.9/src/ld/OutputFile.cpp	2015-01-22 20:59:47.000000000 +0100
+++ ld64-241.9/src/ld/OutputFile.cpp	2015-01-22 20:16:24.000000000 +0100
@@ -631,7 +631,12 @@
 		// is encoded in mach-o the same as:
 		//  .long _foo + 0x40000000
 		// so if _foo lays out to 0xC0000100, the first is ok, but the second is not.  
-		if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) ) {
+		if (
+#if SUPPORT_ARCH_arm_any
+			(_options.architecture() == CPU_TYPE_ARM) ||
+#endif
+			(_options.architecture() == CPU_TYPE_I386) ||
+			0) {
 			// Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload or -static
 			if ( (_options.outputKind() != Options::kPreload) && (_options.outputKind() != Options::kStaticExecutable) ) {
 				warning("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX", 
@@ -1235,22 +1240,26 @@
 		return false;
 	const ld::Fixup* f;
 	switch ( fixup->kind ) {
+#if SUPPORT_ARCH_arm64
 		case ld::Fixup::kindStoreTargetAddressARM64Page21:
 			return !mustBeGOT;
 		case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPage21:
 		case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPage21:
 			return true;
+#endif
 		case ld::Fixup::kindSetTargetAddress:
 			f = fixup;
 			do { 
 				++f;
 			} while ( ! f->lastInCluster() );
 			switch (f->kind ) {
+#if SUPPORT_ARCH_arm64
 				case ld::Fixup::kindStoreARM64Page21:
 					return !mustBeGOT;
 				case ld::Fixup::kindStoreARM64GOTLoadPage21:
 				case ld::Fixup::kindStoreARM64GOTLeaPage21:
 					return true;
+#endif
 				default:
 					break;
 			}
@@ -1267,22 +1276,26 @@
 		return false;
 	const ld::Fixup* f;
 	switch ( fixup->kind ) {
+#if SUPPORT_ARCH_arm64
 		case ld::Fixup::kindStoreTargetAddressARM64PageOff12:
 			return !mustBeGOT;
 		case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPageOff12:
 		case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPageOff12:
 			return true;
+#endif
 		case ld::Fixup::kindSetTargetAddress:
 			f = fixup;
 			do { 
 				++f;
 			} while ( ! f->lastInCluster() );
 			switch (f->kind ) {
+#if SUPPORT_ARCH_arm64
 				case ld::Fixup::kindStoreARM64PageOff12:
 					return !mustBeGOT;
 				case ld::Fixup::kindStoreARM64GOTLoadPageOff12:
 				case ld::Fixup::kindStoreARM64GOTLeaPageOff12:
 					return true;
+#endif
 				default:
 					break;
 			}
@@ -1318,7 +1331,9 @@
 	std::map<uint32_t, const Fixup*> usedByHints;
 	for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) {
 		uint8_t* fixUpLocation = &buffer[fit->offsetInAtom];
+#if SUPPORT_ARCH_arm64
 		ld::Fixup::LOH_arm64 lohExtra;
+#endif
 		switch ( (ld::Fixup::Kind)(fit->kind) ) { 
 			case ld::Fixup::kindNone:
 			case ld::Fixup::kindNoneFollowOn:
@@ -1580,6 +1595,7 @@
 				break;
 			case ld::Fixup::kindLinkerOptimizationHint:
 				// expand table of address/offsets used by hints
+#if SUPPORT_ARCH_arm64
 				lohExtra.addend = fit->u.addend;
 				usedByHints[fit->offsetInAtom + (lohExtra.info.delta1 << 2)] = NULL;
 				if ( lohExtra.info.count > 0 )
@@ -1588,6 +1604,7 @@
 					usedByHints[fit->offsetInAtom + (lohExtra.info.delta3 << 2)] = NULL;
 				if ( lohExtra.info.count > 2 )
 					usedByHints[fit->offsetInAtom + (lohExtra.info.delta4 << 2)] = NULL;
+#endif
 				break;
 			case ld::Fixup::kindStoreTargetAddressLittleEndian32:
 				accumulator = addressOf(state, fit, &toTarget);
@@ -2095,6 +2112,7 @@
 			//uint8_t loadSize, destReg;
 			//uint32_t scaledOffset;
 			//uint32_t imm12;
+#if SUPPORT_ARCH_arm64
 			ld::Fixup::LOH_arm64 alt;
 			alt.addend = fit->u.addend;
 			setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA);
@@ -2453,6 +2471,7 @@
 							fprintf(stderr, "unknown hint kind %d alt.info.kind at 0x%08llX\n", alt.info.kind, infoA.instructionAddress);
 					break;
 			}
+#endif
 		}
 		// apply hints pass 2
 		for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) {
@@ -2460,6 +2479,7 @@
 				continue;
 			InstructionInfo infoA;
 			InstructionInfo infoB;
+#if SUPPORT_ARCH_arm64
 			ld::Fixup::LOH_arm64 alt;
 			alt.addend = fit->u.addend;
 			setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA);
@@ -2491,6 +2511,7 @@
 					}
 					break;
 			}				
+#endif
 		}
 	}
 #endif // SUPPORT_ARCH_arm64
@@ -2505,6 +2526,7 @@
 			for (uint8_t* p=from; p < to; ++p)
 				*p = 0x90;
 			break;
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
 			if ( thumb ) {
 				for (uint8_t* p=from; p < to; p += 2)
@@ -2515,6 +2537,7 @@
 					OSWriteLittleInt32((uint32_t*)p, 0, 0xe1a00000);
 			}
 			break;
+#endif
 		default:
 			for (uint8_t* p=from; p < to; ++p)
 				*p = 0x00;
@@ -2843,7 +2866,11 @@
 				
 			// in -r mode, clarify symbolTableNotInFinalLinkedImages
 			if ( _options.outputKind() == Options::kObjectFile ) {
-				if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) {
+				if ( (_options.architecture() == CPU_TYPE_X86_64) ||
+#if SUPPORT_ARCH_arm64
+					(_options.architecture() == CPU_TYPE_ARM64) ||
+#endif
+					0 ) {
 					// x86_64 .o files need labels on anonymous literal strings
 					if ( (sect->type() == ld::Section::typeCString) && (atom->combine() == ld::Atom::combineByNameAndContent) ) {
 						(const_cast<ld::Atom*>(atom))->setSymbolTableInclusion(ld::Atom::symbolTableIn);
@@ -4071,8 +4098,10 @@
 		if ( _options.sharedRegionEligible() ) {
 			// <rdar://problem/13287063> when range checking, ignore high byte of arm64 addends
 			uint64_t checkAddend = addend;
+#if SUPPORT_ARCH_arm64
 			if ( _options.architecture() == CPU_TYPE_ARM64 )
 				checkAddend &= 0x0FFFFFFFFFFFFFFFULL;
+#endif
 			if ( checkAddend != 0 ) {
 				// make sure the addend does not cause the pointer to point outside the target's segment
 				// if it does, update_dyld_shared_cache will not be able to put this dylib into the shared cache
@@ -4279,12 +4308,17 @@
 
 bool OutputFile::useExternalSectionReloc(const ld::Atom* atom, const ld::Atom* target, ld::Fixup* fixupWithTarget)
 {
-	if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) {
+	if ( (_options.architecture() == CPU_TYPE_X86_64) ||
+#if SUPPORT_ARCH_arm64
+		(_options.architecture() == CPU_TYPE_ARM64) ||
+#endif
+		0) {
 		// x86_64 and ARM64 use external relocations for everthing that has a symbol
 		return ( target->symbolTableInclusion() != ld::Atom::symbolTableNotIn );
 	}
 	
 	// <rdar://problem/9513487> support arm branch interworking in -r mode 
+#if SUPPORT_ARCH_arm_any
 	if ( (_options.architecture() == CPU_TYPE_ARM) && (_options.outputKind() == Options::kObjectFile) ) {
 		if ( atom->isThumb() != target->isThumb() ) {
 			switch ( fixupWithTarget->kind ) {
@@ -4298,6 +4332,7 @@
 			}
 		}
 	}
+#endif
 	
 	if ( (_options.architecture() == CPU_TYPE_I386) && (_options.outputKind() == Options::kObjectFile) ) {
 		if ( target->contentType() == ld::Atom::typeTLV ) 
@@ -4365,7 +4400,11 @@
 	bool minusTargetUsesExternalReloc = (minusTarget != NULL) && this->useExternalSectionReloc(atom, minusTarget, fixupWithMinusTarget);
 	
 	// in x86_64 and arm64 .o files an external reloc means the content contains just the addend
-	if ( (_options.architecture() == CPU_TYPE_X86_64) ||(_options.architecture() == CPU_TYPE_ARM64)  ) {
+	if ( (_options.architecture() == CPU_TYPE_X86_64) ||
+#if SUPPORT_ARCH_arm64
+		(_options.architecture() == CPU_TYPE_ARM64) ||
+#endif
+		0 ) {
 		if ( targetUsesExternalReloc ) {
 			fixupWithTarget->contentAddendOnly = true;
 			fixupWithStore->contentAddendOnly = true;
Only in ld64-241.9/src/ld: OutputFile.o
diff -ur ld64-241.9/src/ld/Resolver.cpp ld64-241.9/src/ld/Resolver.cpp
--- ld64-241.9/src/ld/Resolver.cpp	2015-01-22 20:59:47.000000000 +0100
+++ ld64-241.9/src/ld/Resolver.cpp	2015-01-22 20:30:28.000000000 +0100
@@ -431,6 +431,7 @@
 		// update cpu-sub-type
 		cpu_subtype_t nextObjectSubType = file.cpuSubType();
 		switch ( _options.architecture() ) {
+#if SUPPORT_ARCH_arm_any
 			case CPU_TYPE_ARM:
 				if ( _options.subArchitecture() != nextObjectSubType ) {
 					if ( (_options.subArchitecture() == CPU_SUBTYPE_ARM_ALL) && _options.forceCpuSubtypeAll() ) {
@@ -449,6 +450,7 @@
 					}
 				}
 				break;
+#endif
 			
 			case CPU_TYPE_I386:
 				_internal.cpuSubType = CPU_SUBTYPE_I386_ALL;
diff -ur ld64-241.9/src/ld/parsers/archive_file.cpp ld64-241.9/src/ld/parsers/archive_file.cpp
--- ld64-241.9/src/ld/parsers/archive_file.cpp	2015-01-22 20:59:47.000000000 +0100
+++ ld64-241.9/src/ld/parsers/archive_file.cpp	2015-01-22 05:57:03.000000000 +0100
@@ -232,8 +232,12 @@
 
 template <> cpu_type_t File<x86>::architecture()    { return CPU_TYPE_I386; }
 template <> cpu_type_t File<x86_64>::architecture() { return CPU_TYPE_X86_64; }
+#if SUPPORT_ARCH_arm_any
 template <> cpu_type_t File<arm>::architecture()    { return CPU_TYPE_ARM; }
+#endif
+#if SUPPORT_ARCH_arm64
 template <> cpu_type_t File<arm64>::architecture()  { return CPU_TYPE_ARM64; }
+#endif
 
 
 template <typename A>
diff -ur ld64-241.9/src/ld/parsers/macho_dylib_file.cpp ld64-241.9/src/ld/parsers/macho_dylib_file.cpp
--- ld64-241.9/src/ld/parsers/macho_dylib_file.cpp	2015-01-22 20:59:47.000000000 +0100
+++ ld64-241.9/src/ld/parsers/macho_dylib_file.cpp	2015-01-22 06:07:53.000000000 +0100
@@ -258,11 +258,15 @@
 bool File<A>::_s_logHashtable = false;
 
 template <> const char* File<x86_64>::objCInfoSegmentName() { return "__DATA"; }
+#if SUPPORT_ARCH_arm_any
 template <> const char* File<arm>::objCInfoSegmentName() { return "__DATA"; }
+#endif
 template <typename A> const char* File<A>::objCInfoSegmentName() { return "__OBJC"; }
 
 template <> const char* File<x86_64>::objCInfoSectionName() { return "__objc_imageinfo"; }
+#if SUPPORT_ARCH_arm_any
 template <> const char* File<arm>::objCInfoSectionName() { return "__objc_imageinfo"; }
+#endif
 template <typename A> const char* File<A>::objCInfoSectionName() { return "__image_info"; }
 
 template <typename A>
@@ -1020,6 +1024,7 @@
 	}
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 bool Parser<arm>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle)
 {
@@ -1046,9 +1051,11 @@
 			return false;
 	}
 }
+#endif
 
 
 
+#if SUPPORT_ARCH_arm64
 template <>
 bool Parser<arm64>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle)
 {
@@ -1075,6 +1082,7 @@
 			return false;
 	}
 }
+#endif
 
 
 bool isDylibFile(const uint8_t* fileContent, cpu_type_t* result, cpu_subtype_t* subResult)
@@ -1090,17 +1098,21 @@
 		*subResult = CPU_SUBTYPE_X86_ALL;
 		return true;
 	}
+#if SUPPORT_ARCH_arm_any
 	if ( Parser<arm>::validFile(fileContent, false) ) {
 		*result = CPU_TYPE_ARM;
 		const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent;
 		*subResult = header->cpusubtype();
 		return true;
 	}
+#endif
+#if SUPPORT_ARCH_arm64
 	if ( Parser<arm64>::validFile(fileContent, false) ) {
 		*result = CPU_TYPE_ARM64;
 		*subResult = CPU_SUBTYPE_ARM64_ALL;
 		return true;
 	}
+#endif
 	return false;
 }
 
@@ -1126,6 +1138,7 @@
 	return "x86_64";
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 const char* Parser<arm>::fileKind(const uint8_t* fileContent)
 {
@@ -1141,6 +1154,7 @@
 	}
 	return "arm???";
 }
+#endif
 
 #if SUPPORT_ARCH_arm64
 template <>
@@ -1166,9 +1180,11 @@
 	if ( Parser<x86>::validFile(fileContent, true) ) {
 		return Parser<x86>::fileKind(fileContent);
 	}
+#if SUPPORT_ARCH_arm_any
 	if ( Parser<arm>::validFile(fileContent, true) ) {
 		return Parser<arm>::fileKind(fileContent);
 	}
+#endif
 #if SUPPORT_ARCH_arm64
 	if ( Parser<arm64>::validFile(fileContent, false) ) {
 		return Parser<arm64>::fileKind(fileContent);
diff -ur ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp
--- ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp	2015-01-22 20:59:47.000000000 +0100
+++ ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp	2015-01-22 20:38:57.000000000 +0100
@@ -867,6 +867,7 @@
 	}
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 void Atom<arm>::verifyAlignment(const macho_section<P>&) const
 {
@@ -875,6 +876,7 @@
 			warning("ARM function not 4-byte aligned: %s from %s", this->name(), this->file()->path());
 	}
 }
+#endif
 
 #if SUPPORT_ARCH_arm64
 template <>
@@ -1262,6 +1264,7 @@
 	return true;
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 bool Parser<arm>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype)
 {
@@ -1282,8 +1285,10 @@
 	}
 	return true;
 }
+#endif
 
 
+#if SUPPORT_ARCH_arm64
 template <>
 bool Parser<arm64>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype)
 {
@@ -1296,6 +1301,7 @@
 		return false;
 	return true;
 }
+#endif
 
 
 template <>
@@ -1320,6 +1326,7 @@
 	return "x86_64";
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 const char* Parser<arm>::fileKind(const uint8_t* fileContent)
 {
@@ -1335,6 +1342,7 @@
 	}
 	return "arm???";
 }
+#endif
 
 #if SUPPORT_ARCH_arm64
 template <>
@@ -1599,11 +1607,13 @@
 	return false;
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 arm::P::uint_t Parser<arm>::realAddr(arm::P::uint_t addr)
 {
 	return addr & (-2);
 }
+#endif
 
 template <typename A>
 typename A::P::uint_t Parser<A>::realAddr(typename A::P::uint_t addr)
@@ -1867,8 +1877,12 @@
 
 template <> uint8_t Parser<x86>::loadCommandSizeMask()		{ return 0x03; }
 template <> uint8_t Parser<x86_64>::loadCommandSizeMask()	{ return 0x07; }
+#if SUPPORT_ARCH_arm_any
 template <> uint8_t Parser<arm>::loadCommandSizeMask()		{ return 0x03; }
+#endif
+#if SUPPORT_ARCH_arm64
 template <> uint8_t Parser<arm64>::loadCommandSizeMask()	{ return 0x07; }
+#endif
 
 template <typename A>
 bool Parser<A>::parseLoadCommands()
@@ -4065,12 +4079,14 @@
 		return 1 + (this->_machOSection - parser.firstMachOSection());
 }
 
+#if SUPPORT_ARCH_arm_any
 // arm does not have zero cost exceptions
 template <> 
 uint32_t CFISection<arm>::cfiCount(Parser<arm>& parser) 
 {
 	return 0; 
 }
+#endif
 
 template <typename A>
 uint32_t CFISection<A>::cfiCount(Parser<A>& parser)
@@ -4198,6 +4214,7 @@
 
 
 
+#if SUPPORT_ARCH_arm_any
 template <>
 void CFISection<arm>::cfiParse(class Parser<arm>& parser, uint8_t* buffer, 
 									libunwind::CFI_Atom_Info<CFISection<arm>::OAS>::CFI_Atom_Info cfiArray[], 
@@ -4206,6 +4223,7 @@
 	// arm does not use zero cost exceptions
 	assert(count == 0);
 }
+#endif
 
 
 
@@ -4310,8 +4328,12 @@
 
 template <> bool CFISection<x86_64>::bigEndian() { return false; }
 template <> bool CFISection<x86>::bigEndian() { return false; }
+#if SUPPORT_ARCH_arm_any
 template <> bool CFISection<arm>::bigEndian() { return false; }
+#endif
+#if SUPPORT_ARCH_arm64
 template <> bool CFISection<arm64>::bigEndian() { return false; }
+#endif
 
 
 template <>
@@ -5229,11 +5251,13 @@
 	return ld::Fixup::kindStoreLittleEndian32;
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 ld::Fixup::Kind NonLazyPointerSection<arm>::fixupKind()
 {
 	return ld::Fixup::kindStoreLittleEndian32;
 }
+#endif
 
 template <>
 ld::Fixup::Kind NonLazyPointerSection<arm64>::fixupKind()
@@ -7346,10 +7370,14 @@
 			return ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) );
 		case CPU_TYPE_I386:
 			return ( mach_o::relocatable::Parser<x86>::validFile(fileContent) );
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
 			return ( mach_o::relocatable::Parser<arm>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) );
+#endif
+#if SUPPORT_ARCH_arm64
 		case CPU_TYPE_ARM64:
 			return ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) );
+#endif
 	}
 	return false;
 }
@@ -7370,17 +7398,21 @@
 		*subResult = CPU_SUBTYPE_X86_ALL;
 		return true;
 	}
+#if SUPPORT_ARCH_arm_any
 	if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) {
 		*result = CPU_TYPE_ARM;
 		const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent;
 		*subResult = header->cpusubtype();
 		return true;
 	}
+#endif
+#if SUPPORT_ARCH_arm_any
 	if ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, false, 0) ) {
 		*result = CPU_TYPE_ARM64;
 		*subResult = CPU_SUBTYPE_ARM64_ALL;
 		return true;
 	}
+#endif
 	return false;
 }					
 
@@ -7395,9 +7427,11 @@
 	if ( mach_o::relocatable::Parser<x86>::validFile(fileContent) ) {
 		return mach_o::relocatable::Parser<x86>::fileKind(fileContent);
 	}
+#if SUPPORT_ARCH_arm_any
 	if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) {
 		return mach_o::relocatable::Parser<arm>::fileKind(fileContent);
 	}
+#endif
 	return NULL;
 }
 
@@ -7409,9 +7443,11 @@
 	if ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) ) {
 		return mach_o::relocatable::Parser<x86_64>::hasObjC2Categories(fileContent);
 	}
+#if SUPPORT_ARCH_arm_any
 	else if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) {
 		return mach_o::relocatable::Parser<arm>::hasObjC2Categories(fileContent);
 	}
+#endif
 	else if ( mach_o::relocatable::Parser<x86>::validFile(fileContent, false, 0) ) {
 		return mach_o::relocatable::Parser<x86>::hasObjC2Categories(fileContent);
 	}
diff -ur ld64-241.9/src/ld/passes/branch_island.cpp ld64-241.9/src/ld/passes/branch_island.cpp
--- ld64-241.9/src/ld/passes/branch_island.cpp	2014-09-11 00:24:46.000000000 +0200
+++ ld64-241.9/src/ld/passes/branch_island.cpp	2015-01-22 06:23:52.000000000 +0100
@@ -285,6 +285,7 @@
 static uint64_t textSizeWhenMightNeedBranchIslands(const Options& opts, bool seenThumbBranch)
 {
 	switch ( opts.architecture() ) {
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
 			if ( ! seenThumbBranch )
 				return 32000000;  // ARM can branch +/- 32MB
@@ -293,6 +294,7 @@
 			else
 				return  4000000;  // thumb1 can branch +/- 4MB
 			break;
+#endif
 	}
 	assert(0 && "unexpected architecture");
 	return 0x100000000LL;
@@ -302,6 +304,7 @@
 static uint64_t maxDistanceBetweenIslands(const Options& opts, bool seenThumbBranch)
 {
 	switch ( opts.architecture() ) {
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
 			if ( ! seenThumbBranch )
 				return 30*1024*1024;	// 2MB of branch islands per 32MB
@@ -310,6 +313,7 @@
 			else
 				return 3500000;			// 0.5MB of branch islands per 4MB
 			break;
+#endif
 	}
 	assert(0 && "unexpected architecture");
 	return 0x100000000LL;
@@ -654,8 +658,10 @@
 	
 	// only ARM needs branch islands
 	switch ( opts.architecture() ) {
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
 			break;
+#endif
 		default:
 			return;
 	}
diff -ur ld64-241.9/src/ld/passes/branch_shim.cpp ld64-241.9/src/ld/passes/branch_shim.cpp
--- ld64-241.9/src/ld/passes/branch_shim.cpp	2014-09-11 00:24:46.000000000 +0200
+++ ld64-241.9/src/ld/passes/branch_shim.cpp	2015-01-22 06:33:01.000000000 +0100
@@ -276,6 +276,9 @@
 //
 void doPass(const Options& opts, ld::Internal& state)
 {	
+#if !SUPPORT_ARCH_arm_any
+	return;
+#else
 	// only make branch shims in final linked images
 	if ( opts.outputKind() == Options::kObjectFile )
 		return;
@@ -386,6 +389,7 @@
 		// append all new shims to end of __text
 		sect->atoms.insert(sect->atoms.end(), shims.begin(), shims.end());
 	}
+#endif
 }
 
 
diff -ur ld64-241.9/src/ld/passes/dtrace_dof.cpp ld64-241.9/src/ld/passes/dtrace_dof.cpp
--- ld64-241.9/src/ld/passes/dtrace_dof.cpp	2015-01-22 20:59:47.000000000 +0100
+++ ld64-241.9/src/ld/passes/dtrace_dof.cpp	2015-01-22 06:33:51.000000000 +0100
@@ -179,8 +179,12 @@
 	switch ( opts.architecture() ) {
 		case CPU_TYPE_I386:
 		case CPU_TYPE_X86_64:
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
+#endif
+#if SUPPORT_ARCH_arm64
 		case CPU_TYPE_ARM64:
+#endif
 			storeKind = ld::Fixup::kindStoreLittleEndian32;
 			break;
 		default:
diff -ur ld64-241.9/src/ld/passes/stubs/stubs.cpp ld64-241.9/src/ld/passes/stubs/stubs.cpp
--- ld64-241.9/src/ld/passes/stubs/stubs.cpp	2014-09-11 00:24:46.000000000 +0200
+++ ld64-241.9/src/ld/passes/stubs/stubs.cpp	2015-01-22 06:34:56.000000000 +0100
@@ -324,9 +324,11 @@
 				if ( _options.outputKind() != Options::kDynamicLibrary ) 
 					throwf("resolver functions (%s) can only be used in dylibs", atom->name());
 				if ( !_options.makeCompressedDyldInfo() ) {
+#if SUPPORT_ARCH_arm_any
 					if ( _options.architecture() == CPU_TYPE_ARM )
 						throwf("resolver functions (%s) can only be used when targeting iOS 4.2 or later", atom->name());
 					else
+#endif
 						throwf("resolver functions (%s) can only be used when targeting Mac OS X 10.6 or later", atom->name());
 				}
 				stubFor[atom] = NULL;	
@@ -354,6 +356,7 @@
 		throw "symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o";
 
 	// disable arm close stubs in some cases
+#if SUPPORT_ARCH_arm_any
 	if ( _architecture == CPU_TYPE_ARM ) {
         if ( codeSize > 4*1024*1024 )
             _largeText = true;
@@ -377,6 +380,7 @@
             }
         }
     }
+#endif
 	
 	// make stub atoms 
 	for (std::map<const ld::Atom*,ld::Atom*>::iterator it = stubFor.begin(); it != stubFor.end(); ++it) {
diff -ur ld64-241.9/src/other/ObjectDump.cpp ld64-241.9/src/other/ObjectDump.cpp
--- ld64-241.9/src/other/ObjectDump.cpp	2015-01-22 20:59:47.000000000 +0100
+++ ld64-241.9/src/other/ObjectDump.cpp	2015-01-22 05:32:46.000000000 +0100
@@ -806,6 +806,7 @@
 		case ld::Fixup::kindStoreThumbHigh16:
 			printf(", then store high-16 in Thumb movt");
 			break;
+#if SUPPORT_ARCH_arm64
 		case ld::Fixup::kindStoreARM64Branch26:
 			printf(", then store as ARM64 26-bit pcrel branch");
 			break;
@@ -845,6 +846,7 @@
 		case ld::Fixup::kindStoreARM64PCRelToGOT:
 			printf(", then store as 32-bit delta to GOT entry");
 			break;
+#endif
 		case ld::Fixup::kindDtraceExtra:
 			printf("dtrace static probe extra info");
 			break;
@@ -989,6 +991,7 @@
 		case ld::Fixup::kindSetTargetTLVTemplateOffsetLittleEndian64:
 			printf("tlv template offset of %s", referenceTargetAtomName(ref));
 			break;
+#if SUPPORT_ARCH_arm64
 		case ld::Fixup::kindStoreTargetAddressARM64Branch26:
 			printf("ARM64 store 26-bit pcrel branch to %s", referenceTargetAtomName(ref));
 			break;
@@ -1022,6 +1025,7 @@
 		case ld::Fixup::kindStoreTargetAddressARM64TLVPLoadNowLeaPageOff12:
 			printf("ARM64 store 12-bit page offset of lea for TLV of %s", referenceTargetAtomName(ref));
 			break;
+#endif
 		//default:
 		//	printf("unknown fixup");
 		//	break;
diff -ur ld64-241.9/src/other/rebase.cpp ld64-241.9/src/other/rebase.cpp
--- ld64-241.9/src/other/rebase.cpp	2014-09-11 00:24:46.000000000 +0200
+++ ld64-241.9/src/other/rebase.cpp	2015-01-22 05:46:29.000000000 +0100
@@ -160,9 +160,11 @@
 					case CPU_TYPE_X86_64:
 						fRebasers.push_back(new Rebaser<x86_64>(&p[fileOffset]));
 						break;
+#if SUPPORT_ARCH_arm_any
 					case CPU_TYPE_ARM:
 						fRebasers.push_back(new Rebaser<arm>(&p[fileOffset]));
 						break;
+#endif
 					default:
 						throw "unknown file format";
 				}
@@ -186,9 +188,11 @@
 			else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC_64) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_X86_64)) {
 				fRebasers.push_back(new Rebaser<x86_64>(mh));
 			}
+#if SUPPORT_ARCH_arm_any
 			else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_ARM)) {
 				fRebasers.push_back(new Rebaser<arm>(mh));
 			}
+#endif
 			else {
 				throw "unknown file format";
 			}
@@ -236,7 +240,9 @@
 template <> cpu_type_t Rebaser<ppc64>::getArchitecture()  const { return CPU_TYPE_POWERPC64; }
 template <> cpu_type_t Rebaser<x86>::getArchitecture()    const { return CPU_TYPE_I386; }
 template <> cpu_type_t Rebaser<x86_64>::getArchitecture() const { return CPU_TYPE_X86_64; }
+#if SUPPORT_ARCH_arm_any
 template <> cpu_type_t Rebaser<arm>::getArchitecture() const { return CPU_TYPE_ARM; }
+#endif
 
 template <typename A>
 uint64_t Rebaser<A>::getBaseAddress() const
@@ -875,8 +881,10 @@
 			return "i386";
 		case CPU_TYPE_X86_64:
 			return "x86_64";
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
 			return "arm";
+#endif
 	}
 	return "unknown";
 }
@@ -969,6 +977,7 @@
 		else if ( arch == CPU_TYPE_X86_64 ) {
 			return 0x200000000ULL;
 		}
+#if SUPPORT_ARCH_arm_any
 		else if ( arch == CPU_TYPE_ARM ) {
 			// place dylibs below dyld
 			uint64_t topAddr = 0x2FE00000;
@@ -977,6 +986,7 @@
 				throwf("total size of images (0x%X) does not fit below 0x2FE00000", totalSize);
 			return topAddr - totalSize;
 		}
+#endif
 		else
 			throw "unknown architecture";
 	}
@@ -1043,7 +1053,9 @@
 			onlyArchs.insert(CPU_TYPE_POWERPC64);
 			onlyArchs.insert(CPU_TYPE_I386);
 			onlyArchs.insert(CPU_TYPE_X86_64);
+#if SUPPORT_ARCH_arm_any
 			onlyArchs.insert(CPU_TYPE_ARM);
+#endif
 		}
 		
 		// scan files and collect sizes
diff -ur ld64-241.9/src/other/unwinddump.cpp ld64-241.9/src/other/unwinddump.cpp
--- ld64-241.9/src/other/unwinddump.cpp	2015-01-22 20:59:47.000000000 +0100
+++ ld64-241.9/src/other/unwinddump.cpp	2015-01-22 05:45:28.000000000 +0100
@@ -97,7 +97,9 @@
 
 template <>	 const char*	UnwindPrinter<x86>::archName()		{ return "i386"; }
 template <>	 const char*	UnwindPrinter<x86_64>::archName()	{ return "x86_64"; }
+#if SUPPORT_ARCH_arm_any
 template <>	 const char*	UnwindPrinter<arm>::archName()		{ return "arm"; }
+#endif
 #if SUPPORT_ARCH_arm64
 template <>	 const char*	UnwindPrinter<arm64>::archName()	{ return "arm64"; }
 #endif
@@ -1072,7 +1074,9 @@
 #if SUPPORT_ARCH_arm64
 			onlyArchs.insert(CPU_TYPE_ARM64);
 #endif
+#if SUPPORT_ARCH_arm_any
 			onlyArchs.insert(CPU_TYPE_ARM);
+#endif
 		}
 		
 		// process each file
--- ld64-241.9/src/other/machochecker.cpp	2015-01-23 01:54:12.000000000 +0100
+++ ld64-241.9/src/other/machochecker.cpp	2015-01-23 01:57:11.000000000 +0100
@@ -252,6 +252,7 @@
 	return false;
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 bool MachOChecker<arm>::validFile(const uint8_t* fileContent)
 {	
@@ -269,6 +270,7 @@
 	}
 	return false;
 }
+#endif
 
 #if SUPPORT_ARCH_arm64
 template <>
@@ -294,7 +296,9 @@
 template <> uint8_t MachOChecker<ppc64>::loadCommandSizeMask()	{ return 0x07; }
 template <> uint8_t MachOChecker<x86>::loadCommandSizeMask()	{ return 0x03; }
 template <> uint8_t MachOChecker<x86_64>::loadCommandSizeMask() { return 0x07; }
+#if SUPPORT_ARCH_arm_any
 template <> uint8_t MachOChecker<arm>::loadCommandSizeMask()	{ return 0x03; }
+#endif
 #if SUPPORT_ARCH_arm64
 template <> uint8_t MachOChecker<arm64>::loadCommandSizeMask()	{ return 0x07; }
 #endif
@@ -324,11 +328,13 @@
 	return threadInfo->thread_register(7);
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 arm::P::uint_t MachOChecker<arm>::getInitialStackPointer(const macho_thread_command<arm::P>* threadInfo)
 {
 	return threadInfo->thread_register(13);
 }
+#endif
 
 #if SUPPORT_ARCH_arm64
 template <>
@@ -362,11 +368,13 @@
 	return threadInfo->thread_register(16);
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 arm::P::uint_t MachOChecker<arm>::getEntryPoint(const macho_thread_command<arm::P>* threadInfo)
 {
 	return threadInfo->thread_register(15);
 }
+#endif
 
 #if SUPPORT_ARCH_arm64
 template <>
@@ -1025,6 +1033,7 @@
 	return fFirstWritableSegment->vmaddr();
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 arm::P::uint_t MachOChecker<arm>::relocBase()
 {
@@ -1033,6 +1042,7 @@
 	else
 		return fFirstSegment->vmaddr();
 }
+#endif
 
 #if SUPPORT_ARCH_arm64
 template <>