summaryrefslogtreecommitdiff
blob: 5a235ec85e325f30b0f9192949a383cbca73c535 (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
Fully conditionalise arm support so it can be disabled on 10.4.

--- ld64-236.3/src/ld/HeaderAndLoadCommands.hpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/HeaderAndLoadCommands.hpp	2015-01-23 06:56:04.000000000 +0100
@@ -605,8 +605,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
 
 
 
@@ -625,17 +629,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
 
 
 
--- ld64-236.3/src/ld/LinkEdit.hpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/LinkEdit.hpp	2015-01-23 06:56:04.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
 				}
 			}
 		}
--- ld64-236.3/src/ld/Options.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/Options.cpp	2015-01-23 07:05:43.000000000 +0100
@@ -567,8 +567,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);
@@ -579,6 +584,7 @@
 				#endif
 					}
 					break;
+#endif
 			}
 #ifdef SUPPORT_SNAPSHOTS
 			fLinkSnapshot.recordArch(fArchitectureName);
@@ -1649,9 +1655,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 ) {
@@ -3483,6 +3491,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)
@@ -3494,6 +3503,7 @@
 			#endif
 					}
 					break;
+#endif
 				default:
 					// architecture will be infered later by examining .o files
 					break;
@@ -3516,12 +3526,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
@@ -3561,6 +3573,7 @@
 				fAllowTextRelocs = true;
 				fUndefinedTreatment = kUndefinedDynamicLookup;
 				break;
+#if SUPPORT_ARCH_arm64
 			case CPU_TYPE_ARM64:
 				// arm64 uses new MH_KEXT_BUNDLE type
 				fMakeCompressedDyldInfo = false;
@@ -3569,6 +3582,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
@@ -3580,6 +3595,7 @@
                     fUndefinedTreatment = kUndefinedDynamicLookup;
 					break;
 				}
+#endif
 				// else use object file
 			case CPU_TYPE_I386:
 				// use .o files
@@ -3632,6 +3648,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;
@@ -3642,6 +3659,7 @@
 						fBaseWritableAddress = fBaseAddress + 0x08000000;
 				}
                 break;
+#endif
             default:
                 fSplitSegs = false;
                 fBaseAddress = 0;
@@ -3656,6 +3674,7 @@
 			break;
 		case CPU_TYPE_X86_64:
 			break;
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
 			switch ( fOutputKind ) {
 				case Options::kDynamicExecutable:
@@ -3678,6 +3697,7 @@
 				fBaseAddress = 0;
 			}
 			break;
+#endif
 	}
 
 	// <rdar://problem/6138961> -r implies no prebinding for all architectures
@@ -3723,6 +3743,7 @@
 			case CPU_TYPE_X86_64:
 				fPrebind = false;
 				break;
+#if SUPPORT_ARCH_arm_any
             case CPU_TYPE_ARM:
 				switch ( fOutputKind ) {
 					case Options::kDynamicExecutable:
@@ -3740,6 +3761,7 @@
 						break;
 				}
 				break;
+#endif
 		}
 	}
 
@@ -3766,10 +3788,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;
@@ -3815,7 +3843,15 @@
 	// only iOS main executables should be encrypted
 	if ( fOutputKind != Options::kDynamicExecutable )
 		fEncryptable = false;
-	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
@@ -3867,11 +3903,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;
 	}
@@ -3917,6 +3957,7 @@
 			fPositionIndependentExecutable = true;
 	}
 
+#if SUPPORT_ARCH_arm_any
 	// armv7 for iOS4.3 defaults to PIE
 	if ( (fArchitecture == CPU_TYPE_ARM) 
 		&& fArchSupportsThumb2
@@ -3924,15 +3965,18 @@
 		&& (fIOSVersionMin >= ld::iOS_4_3) ) {
 			fPositionIndependentExecutable = true;
 	}
+#endif
 
 	// -no_pie anywhere on command line disable PIE
 	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 ) {
@@ -3958,9 +4002,11 @@
 	if ( fMacVersionMin >= ld::mac10_7 ) {
 		fTLVSupport = true;
 	}
+#if SUPPORT_ARCH_arm64
 	else if ( (fArchitecture == CPU_TYPE_ARM64) && (fIOSVersionMin >= 0x00080000) ) {
 		fTLVSupport = true;
 	}
+#endif
 
 	// default to adding version load command for dynamic code, static code must opt-in
 	switch ( fOutputKind ) {
@@ -4149,6 +4195,7 @@
 	}
   
 	// <rdar://problem/12258065> ARM64 needs 16KB page size for user land code
+#if SUPPORT_ARCH_arm64
 	if ( fArchitecture == CPU_TYPE_ARM64 ) {
 		if ( fSegmentAlignment == 4096 ) {
 			switch ( fOutputKind ) {
@@ -4166,6 +4213,7 @@
 			}
 		}
 	}
+#endif
 	
 	// <rdar://problem/13624134> linker should not convert dwarf unwind if .o file has compact unwind section
 	switch ( fOutputKind ) {
@@ -4267,12 +4315,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 )
@@ -4293,6 +4345,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";
@@ -4301,11 +4354,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";
@@ -4313,6 +4368,7 @@
 					fStackAddr = 0x120000000ULL;
 				}
 				break;
+#endif
 		}
 		if ( (fStackSize & -4096) != fStackSize )
 			throw "-stack_size must be multiples of 4K";
@@ -4422,8 +4478,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;
@@ -4621,9 +4685,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
--- ld64-236.3/src/ld/OutputFile.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/OutputFile.cpp	2015-01-23 06:56:04.000000000 +0100
@@ -629,7 +629,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", 
@@ -1229,22 +1234,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;
 			}
@@ -1261,22 +1270,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;
 			}
@@ -1311,7 +1324,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:
@@ -1570,6 +1585,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 )
@@ -1578,6 +1594,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);
@@ -2057,6 +2074,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);
@@ -2415,6 +2433,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) {
@@ -2422,6 +2441,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);
@@ -2453,6 +2473,7 @@
 					}
 					break;
 			}				
+#endif
 		}
 	}
 
@@ -2469,6 +2490,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)
@@ -2479,6 +2501,7 @@
 					OSWriteLittleInt32((uint32_t*)p, 0, 0xe1a00000);
 			}
 			break;
+#endif
 		default:
 			for (uint8_t* p=from; p < to; ++p)
 				*p = 0x00;
@@ -2807,7 +2830,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);
@@ -4030,8 +4057,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
@@ -4238,12 +4267,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 ) {
@@ -4257,6 +4291,7 @@
 			}
 		}
 	}
+#endif
 	
 	if ( (_options.architecture() == CPU_TYPE_I386) && (_options.outputKind() == Options::kObjectFile) ) {
 		if ( target->contentType() == ld::Atom::typeTLV ) 
@@ -4324,7 +4359,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;
--- ld64-236.3/src/ld/parsers/archive_file.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/parsers/archive_file.cpp	2015-01-23 06:56:04.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>
--- ld64-236.3/src/ld/parsers/macho_dylib_file.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/parsers/macho_dylib_file.cpp	2015-01-23 07:01:27.000000000 +0100
@@ -250,11 +250,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>
@@ -1006,6 +1010,7 @@
 	}
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 bool Parser<arm>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle)
 {
@@ -1032,9 +1037,11 @@
 			return false;
 	}
 }
+#endif
 
 
 
+#if SUPPORT_ARCH_arm64
 template <>
 bool Parser<arm64>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle)
 {
@@ -1061,6 +1068,7 @@
 			return false;
 	}
 }
+#endif
 
 
 bool isDylibFile(const uint8_t* fileContent, cpu_type_t* result, cpu_subtype_t* subResult)
@@ -1084,17 +1084,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
 #ifdef SUPPORT_ARCH_ppc
 	if ( Parser<ppc>::validFile(fileContent, false) ) {
 		*result = CPU_TYPE_POWERPC;
@@ -1123,6 +1135,7 @@
 	return "x86_64";
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 const char* Parser<arm>::fileKind(const uint8_t* fileContent)
 {
@@ -1138,6 +1151,7 @@
 	}
 	return "arm???";
 }
+#endif
 
 #if SUPPORT_ARCH_arm64
 template <>
@@ -1163,9 +1177,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);
--- ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp	2015-01-23 07:02:23.000000000 +0100
@@ -861,6 +861,7 @@
 	}
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 void Atom<arm>::verifyAlignment(const macho_section<P>&) const
 {
@@ -869,6 +870,7 @@
 			warning("ARM function not 4-byte aligned: %s from %s", this->name(), this->file()->path());
 	}
 }
+#endif
 
 #if SUPPORT_ARCH_arm64
 template <>
@@ -1218,6 +1220,7 @@
 	return true;
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 bool Parser<arm>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype)
 {
@@ -1238,8 +1241,10 @@
 	}
 	return true;
 }
+#endif
 
 
+#if SUPPORT_ARCH_arm64
 template <>
 bool Parser<arm64>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype)
 {
@@ -1252,6 +1257,7 @@
 		return false;
 	return true;
 }
+#endif
 
 
 template <>
@@ -1276,6 +1282,7 @@
 	return "x86_64";
 }
 
+#if SUPPORT_ARCH_arm_any
 template <>
 const char* Parser<arm>::fileKind(const uint8_t* fileContent)
 {
@@ -1291,6 +1298,7 @@
 	}
 	return "arm???";
 }
+#endif
 
 #if SUPPORT_ARCH_arm64
 template <>
@@ -1802,8 +1810,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()
@@ -3921,8 +3933,10 @@
 		return 1 + (this->_machOSection - parser.firstMachOSection());
 }
 
+#if SUPPORT_ARCH_arm_any
 // arm does not have zero cost exceptions
 template <> uint32_t CFISection<arm>::cfiCount() { return 0; }
+#endif
 
 template <typename A>
 uint32_t CFISection<A>::cfiCount()
@@ -4050,6 +4064,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[], 
@@ -4058,6 +4073,7 @@
 	// arm does not use zero cost exceptions
 	assert(count == 0);
 }
+#endif
 
 template <>
 void CFISection<arm64>::cfiParse(class Parser<arm64>& parser, uint8_t* buffer, 
@@ -4159,8 +4175,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 <>
@@ -5077,11 +5097,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()
@@ -7170,10 +7192,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;
 }
@@ -7194,17 +7220,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;
 }					
 
@@ -7219,9 +7249,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;
 }
 
@@ -7233,9 +7265,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);
 	}
--- ld64-236.3/src/ld/passes/branch_island.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/passes/branch_island.cpp	2015-01-23 06:56:04.000000000 +0100
@@ -284,6 +284,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
@@ -292,6 +293,7 @@
 			else
 				return  4000000;  // thumb1 can branch +/- 4MB
 			break;
+#endif
 	}
 	assert(0 && "unexpected architecture");
 	return 0x100000000LL;
@@ -301,6 +303,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
@@ -309,6 +312,7 @@
 			else
 				return 3500000;			// 0.5MB of branch islands per 4MB
 			break;
+#endif
 	}
 	assert(0 && "unexpected architecture");
 	return 0x100000000LL;
@@ -653,8 +657,10 @@
 	
 	// only ARM needs branch islands
 	switch ( opts.architecture() ) {
+#if SUPPORT_ARCH_arm_any
 		case CPU_TYPE_ARM:
 			break;
+#endif
 		default:
 			return;
 	}
--- ld64-236.3/src/ld/passes/branch_shim.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/passes/branch_shim.cpp	2015-01-23 06:56:04.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
 }
 
 
--- ld64-236.3/src/ld/passes/dtrace_dof.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/passes/dtrace_dof.cpp	2015-01-23 06:56:04.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:
--- ld64-236.3/src/ld/passes/stubs/stubs.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/passes/stubs/stubs.cpp	2015-01-23 06:56:04.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) {
--- ld64-236.3/src/ld/Resolver.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/ld/Resolver.cpp	2015-01-23 06:56:04.000000000 +0100
@@ -396,6 +396,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() ) {
@@ -414,6 +415,7 @@
 					}
 				}
 				break;
+#endif
 			
 			case CPU_TYPE_I386:
 				_internal.cpuSubType = CPU_SUBTYPE_I386_ALL;
--- ld64-236.3/src/other/machochecker.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/other/machochecker.cpp	2015-01-23 06:56:04.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 <>
--- ld64-236.3/src/other/ObjectDump.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/other/ObjectDump.cpp	2015-01-23 06:56:04.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;
@@ -839,6 +840,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;
@@ -983,6 +985,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;
@@ -1010,6 +1013,7 @@
 		case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPageOff12:
 			printf("ARM64 store 12-bit page offset of lea of %s", referenceTargetAtomName(ref));
 			break;
+#endif
 		//default:
 		//	printf("unknown fixup");
 		//	break;
--- ld64-236.3/src/other/rebase.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/other/rebase.cpp	2015-01-23 06:56:04.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
--- ld64-236.3/src/other/unwinddump.cpp.orig	2015-01-23 06:55:36.000000000 +0100
+++ ld64-236.3/src/other/unwinddump.cpp	2015-01-23 07:03:16.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