forked from OSchip/llvm-project
				
			Check architectures to make sure that we can build for all of them
before we try to. Patch by Patrick Walton! llvm-svn: 131098
This commit is contained in:
		
							parent
							
								
									b74944a829
								
							
						
					
					
						commit
						539ec3ae90
					
				| 
						 | 
					@ -6,6 +6,19 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Description := Static runtime libraries for clang/Darwin.
 | 
					Description := Static runtime libraries for clang/Darwin.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# A function that ensures we don't try to build for architectures that we
 | 
				
			||||||
 | 
					# don't have working toolchains for.
 | 
				
			||||||
 | 
					CheckArches = \
 | 
				
			||||||
 | 
					  $(shell \
 | 
				
			||||||
 | 
					    result=""; \
 | 
				
			||||||
 | 
					    for arch in $(1); do \
 | 
				
			||||||
 | 
					      gcc -arch $$arch; \
 | 
				
			||||||
 | 
					      if test $$? == 1; then result="$$result$$arch "; fi; \
 | 
				
			||||||
 | 
					    done; \
 | 
				
			||||||
 | 
					    echo $$result)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Configs :=
 | 
					Configs :=
 | 
				
			||||||
UniversalArchs :=
 | 
					UniversalArchs :=
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,23 +26,23 @@ UniversalArchs :=
 | 
				
			||||||
# still be referenced from Darwin system headers. This symbol is only ever
 | 
					# still be referenced from Darwin system headers. This symbol is only ever
 | 
				
			||||||
# needed on i386.
 | 
					# needed on i386.
 | 
				
			||||||
Configs += eprintf
 | 
					Configs += eprintf
 | 
				
			||||||
UniversalArchs.eprintf := i386
 | 
					UniversalArchs.eprintf := $(call CheckArches,i386)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Configuration for targetting 10.4. We need a few functions missing from
 | 
					# Configuration for targetting 10.4. We need a few functions missing from
 | 
				
			||||||
# libgcc_s.10.4.dylib. We only build x86 slices since clang doesn't really
 | 
					# libgcc_s.10.4.dylib. We only build x86 slices since clang doesn't really
 | 
				
			||||||
# support targetting PowerPC.
 | 
					# support targetting PowerPC.
 | 
				
			||||||
Configs += 10.4
 | 
					Configs += 10.4
 | 
				
			||||||
UniversalArchs.10.4 := i386 x86_64
 | 
					UniversalArchs.10.4 := $(call CheckArches,i386 x86_64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Configuration for targetting iOS, for some ARMv6 functions, which must be
 | 
					# Configuration for targetting iOS, for some ARMv6 functions, which must be
 | 
				
			||||||
# in the same linkage unit, and for a couple of other functions that didn't
 | 
					# in the same linkage unit, and for a couple of other functions that didn't
 | 
				
			||||||
# make it into libSystem.
 | 
					# make it into libSystem.
 | 
				
			||||||
Configs += ios
 | 
					Configs += ios
 | 
				
			||||||
UniversalArchs.ios := i386 x86_64 armv6 armv7
 | 
					UniversalArchs.ios := $(call CheckArches,i386 x86_64 armv6 armv7)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Configuration for use with kernel/kexts.
 | 
					# Configuration for use with kernel/kexts.
 | 
				
			||||||
Configs += cc_kext
 | 
					Configs += cc_kext
 | 
				
			||||||
UniversalArchs.cc_kext := armv6 armv7 i386 x86_64
 | 
					UniversalArchs.cc_kext := $(call CheckArches,armv6 armv7 i386 x86_64)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
###
 | 
					###
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue