2022-08-22 19:00:00 -05:00
|
|
|
include ../tools.mk
|
2015-01-15 16:23:18 -06:00
|
|
|
|
2015-08-21 23:43:56 -05:00
|
|
|
TARGETS =
|
|
|
|
ifeq ($(filter arm,$(LLVM_COMPONENTS)),arm)
|
2015-01-15 16:23:18 -06:00
|
|
|
# construct a fairly exhaustive list of platforms that we
|
|
|
|
# support. These ones don't follow a pattern
|
2015-08-21 23:43:56 -05:00
|
|
|
TARGETS += arm-linux-androideabi arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabi
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86)
|
|
|
|
X86_ARCHS = i686 x86_64
|
|
|
|
else
|
|
|
|
X86_ARCHS =
|
|
|
|
endif
|
2015-01-15 16:23:18 -06:00
|
|
|
|
|
|
|
# these ones do, each OS lists the architectures it supports
|
2015-08-21 23:43:56 -05:00
|
|
|
LINUX=$(filter aarch64 mips,$(LLVM_COMPONENTS)) $(X86_ARCHS)
|
|
|
|
ifeq ($(filter mips,$(LLVM_COMPONENTS)),mips)
|
|
|
|
LINUX += mipsel
|
|
|
|
endif
|
|
|
|
|
|
|
|
WINDOWS=$(X86_ARCHS)
|
2015-01-15 16:23:18 -06:00
|
|
|
# fails with: failed to get iphonesimulator SDK path: no such file or directory
|
|
|
|
#IOS=i386 aarch64 armv7
|
2015-08-21 23:43:56 -05:00
|
|
|
DARWIN=$(X86_ARCHS)
|
2015-01-15 16:23:18 -06:00
|
|
|
|
|
|
|
$(foreach arch,$(LINUX),$(eval TARGETS += $(arch)-unknown-linux-gnu))
|
|
|
|
$(foreach arch,$(WINDOWS),$(eval TARGETS += $(arch)-pc-windows-gnu))
|
|
|
|
#$(foreach arch,$(IOS),$(eval TARGETS += $(arch)-apple-ios))
|
|
|
|
$(foreach arch,$(DARWIN),$(eval TARGETS += $(arch)-apple-darwin))
|
|
|
|
|
|
|
|
all: $(TARGETS)
|
|
|
|
|
|
|
|
define MK_TARGETS
|
|
|
|
# compile the rust file to the given target, but only to asm and IR
|
|
|
|
# form, to avoid having to have an appropriate linker.
|
|
|
|
#
|
|
|
|
# we need some features because the integer SIMD instructions are not
|
|
|
|
# enabled by-default for i686 and ARM; these features will be invalid
|
|
|
|
# on some platforms, but LLVM just prints a warning so that's fine for
|
|
|
|
# now.
|
|
|
|
$(1): simd.rs
|
2015-04-17 06:58:47 -05:00
|
|
|
$$(RUSTC) --target=$(1) --emit=llvm-ir,asm simd.rs \
|
Fold aarch64 feature +fp into +neon
Arm's FEAT_FP and Feat_AdvSIMD describe the same thing on AArch64:
The Neon unit, which handles both floating point and SIMD instructions.
Moreover, a configuration for AArch64 must include both or neither.
Arm says "entirely proprietary" toolchains may omit floating point:
https://developer.arm.com/documentation/102374/0101/Data-processing---floating-point
In the Programmer's Guide for Armv8-A, Arm says AArch64 can have
both FP and Neon or neither in custom implementations:
https://developer.arm.com/documentation/den0024/a/AArch64-Floating-point-and-NEON
In "Bare metal boot code for Armv8-A", enabling Neon and FP
is just disabling the same trap flag:
https://developer.arm.com/documentation/dai0527/a
In an unlikely future where "Neon and FP" become unrelated,
we can add "[+-]fp" as its own feature flag.
Until then, we can simplify programming with Rust on AArch64 by
folding both into "[+-]neon", which is valid as it supersets both.
"[+-]neon" is retained for niche uses such as firmware, kernels,
"I just hate floats", and so on.
2021-12-03 19:56:59 -06:00
|
|
|
-C target-feature='+neon,+sse2' -C extra-filename=-$(1)
|
2015-01-15 16:23:18 -06:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach targetxxx,$(TARGETS),$(eval $(call MK_TARGETS,$(targetxxx))))
|